Skip to content

active color-sensor based on TCS34725 for lego mindstorms ev3

License

Notifications You must be signed in to change notification settings

ensonic/legoev3_tcs34725

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

legoev3_tcs34725

An active color-sensor based on TCS34725 for lego mindstorms ev3. The goal is to have a color sensor that can sense colors on screns or color on surfaces illuminated by leds.

1st prototype

The prototype is based on the Adafruit RGB Color Sensor with IR filter and White LED - TCS34725. Unfortunately this breakout board already has 10k pullup resistors for the I2C lines. The LEGO EV3 requires 82k pullup resistors instead. So the first step was to remove the two SMD resistors above the SCL and 3V3 pins:

modifications

Next I plugged the board on a mini breadboard and added 82k resistos and also connected the LED pin to GND to disable the led on the breakout. The LED is only needed to sense reflected light.

The sensor uses a mindstorms cable which I have cut in half and conncted the wires as below:

EV3 Cable Adafruit pin (JP1)
Pin 1 (white) N/C
Pin 2 (black) N/C
Pin 3 (red) GND
Pin 4 (green) VIN
Pin 5 (yellow) SCL
Pin 6 (blue) SDA

demo code

Once the sensor is plugged, the right port mode needs to be choosen (below it has been plugged to port '1':

echo "other-i2c" | sudo tee /sys/devices/platform/legoev3-ports/lego-port/port0/mode

Copy sensor-test.py to the ev3 and run it. It will print brightness and r,g,b values as soon as the change.

$ python3 ./sensor-test.py
Device found
#090605: C: 3551, R: 2491, G: 1541, B: 1450
#090505: C: 3470, R: 2413, G: 1509, B: 1413
#0a0707: C: 4664, R: 2724, G: 1942, B: 1913
#151719: C: 15740, R: 5509, G: 5899, B: 6506

ev3 color sensor dimensions

Axis mm holes remark
Length 40 mm 5
Depth 24 mm 3
Height 22 mm 3 without connector
Height 31.35 mm 4 with connector

'holes' are sizes in lego technic beams.

TODO

Links

About

active color-sensor based on TCS34725 for lego mindstorms ev3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published