2. Color Sensor Module¶
Based on TCS3200, the Color sensor module 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 input and 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.
High-resolution conversion of light intensity to frequency
Programmable color and full-scale output frequency
Communicating directly with a microcontroller
Single-supply operation (2.7 V to 5.5 V)
Nonlinearity error typically 0.2% at 50 kHz
Stable 200 ppm/°C temperature coefficient
Name: Color Sensor Module
Working Voltage: DC 2.7~5.5V
Connection Mode: G-GND，V-VCC，S-signal pins
Size: 37.6 x 37.6mm
Net Weight: 5.1g
2.4. Outlook and Dimmensions¶
2.5. Quick to Start¶
Connect S0 to pin15, S1 to P1, S2 to P8, S3 to P12, OUT to P2, VCC to the Power Supply and GND to the GND. Then insert the micro:bit to Octopus:bit. Connect OLED to IIC port.
Add extension library:https://github.com/DoraLC/pxt-tcs3200-color-sensor
Show RGB value to OLED.
You can also download it directly below:
The value of the current red, blue and green is displaying on the OLED screen.
Avoid the interference of outside light,testing the better in a confined space No special requirements for light, but try to focus on a single The first use or restart or change light and so on, please adjust the WB(White Balance)