Chameleon
1140 0
Production process

Objective

Here we adopt a color sensor to read color value from a object around you and the LED light on the sensor will turn to the corresponding color as the object.

MicroduinoChameleon-t.jpg

Principle

The color sensor can read color values and then be analyzed by CoreUSB to get the light to show the corresponding color.

Microduino11Chameleon-sch.jpg

Equipment

ModuleNumberFunctionmCookie-CoreUSB1Core boardmCookie-Hub1Sensor pin boardMicroduino-Color Detector1Color sensorMicroduino-Light1Light-sensitive sensormCookie-OLED1Display modulemCookie-BM1Battery management

MicroduinoChameleon-module.jpg

Preparation

  • Setup 1:Connect CoreUSB and PC/MAC with a USB cable, then open Arduino IDE.

CoreUSB Ble pc.jpg
  • Setup 2:Click Files > Examples > mCookie > _303_BashfulChameleon, then load the program.

303 BashfulChameleon load.jpg
  • Setup 3:Load the code, select the right board and COM port, and download the program. When you see “Done Uploading” notice, it means program has been written into CoreUSB.

303 BashfulChameleon load-ok.jpg

Program Description

  • Control pin description


#define PIN 6   Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
  • Color matching


redValue=map(red, 1024, 2048, 0, 255); greenValue=map(green, 1800, 2824, 0, 255);//blueValue=map(blue, 1024, 2048, 0, 255); blueValue=map(blue, 1024, 1792, 0, 255);

Hardware Buildup

  • Setup 1: Connect the color sensor to IIC of Sensorhub and LED light to D6.

MicroduinoChameleon2.JPG
LED light’s connection method can refer to the picture above. Please mind the connection order, which starts from LED’s IN interface to OUT.

CoreUSB Ble steup11.jpg
  • Setup 2: Connect the activated battery box to BM.

CoreUSB Ble steup2.jpg
  • Setup 3:Stack all modules together without fixed order and finish the circuit buildup.

MicroduinoChameleon steup3.jpg
In bad light, you can turn off LED light on the color sensor. Get the dice in the middle of the color sensor close to any object with different color and the led light will change accordingly.

MicroduinoChameleon on light.jpg
Reference color:

MicroduinoChameleon color.jpg

Result

You can DIY your LEGO chameleon. Just put the color sensor close the object and the color of the LED light will change to the same as the object.

MicroduinoChameleon ok legao.jpg

Required hardware
No data
Code show
No data
Attachment download
No data
0
Chris
Asset info

Creation time:11/08/2018

Author:chris
Asset recommendation
No data
Course recommendation
No data
Master, don't look at it silently. Please login to help me comment.

Register now