Color sensor module video tutorial
Hi, everyone, could you know something about our color sensor module? Based on TCS3200, it could filter RGB data from source light and convert it to a square wave with frequency directly proportional to light intensity. This small sensor has always been our hot products, of course, although we were ready for the technical materials in blog and wiki, friends also emailed us to ask for help, therefore, we release this tutorial, including its video and color sensor module user guide. Step by step, and you can handle it.
Color Sensor Module Introduction
The Color sensor module base on TCS3200 which is a programmable color light-to-frequency converter, it could filter RGB data from source light and convert it to a square wave(50% duty cycle) with frequency directly proportional to light intensity (irradiance). The full-scale output frequency can be scaled by one of three preset values via two control input pins(SO, S1 Selectable Options 2%, 20%, 100% frequency),and pin S2, S3 control the filter of RGB. Digital inputs and digital output allow interface to a microcontroller or other logic circuitry directly. Output enable (OE) places the output in the high-impedance state for multiple-unit sharing of a microcontroller input line. At last, user can calculate the color of the light by RGB values.
Hardware and Software Preparation
Step1 Upload the Code
1. Connect the Arduino UNO to PC with the Mini USB Cable.
2. Open the Arduino IDE1.0.X, and download code from our WIKI
3. If your IDE do not have TimerOne Library, please Download it from here
4. Choose the corresponding board and serial port 5. Compiling sketch until Done uploading appears
Step 2 Adjust the White Balance
1. We use TCS3200 chip for color sensor module.
2. The color sensor module power supply is from 3.27V to 5.5V
3. Connect the Arduino UNO and Color Sensor with Jumper Wire as below.
S0 connect to D6
OUT connect to D2 S1 connect to D5
VCC connect to VCC S2 connect to D4
GND connect to GND S3 connect to D3
OE connect to GND
4. Use white objects to perform white balance correction, after doing that, do not move the color sensor module and light source to ensure the accuracy of white balance value, therefore, we put the color sensor on the paper white part like below.
5. Open Arduino IDE and click Serial Monitor and set the BaudRate as 9600
6. The Serial Monitor would display lots of parameter values, and we choose some of them to explain to you.
- As the figure, the mark 1 is the RGB value at 1S period. The RGB value is Red=1126 , Green=707 and Blue =774.
- Then the mark 2 is the scale factor.
- Then use the scale factor for adjusting the RGB value to 255 as Mark 3.
1. The normal measurement distance is 0-2cm, so we put the color sensor module on the paper another part.
2. Open the Serial Monitor, and now you have got the object’s RGB value like (13 14 14 ), which means you have got the object color.