Electronic – arduino – Lego Color Sensor + Arduino

arduinosensor

I have a color sensor from the original lego mindstorms set. I have had a hard time finding any reliable specs on the thing, but I did find somebody who has reverse engineered it quite a bit here. The thing only has two connectors though. I am not very good at circuits, but I would like to hook this up to my arduino and read values from it. Does this appear possible? If so, do you have any idea which pins to use, or what kind of code I need?

Best Answer

Most Lego sensors that i have seen use a bridge recifier so that they do only need to have two wires to operate. Also this allows the sensor to be plugged in at any orientation. The circuit for the light sensor is no different.

Using an Arduino, you would connect one wire to an output port and the other wire to an input. By reading the additional article at the bottom of the page, i would say that you should be able to turn the sensor on at the Arduino output for 1.2ms then off for 0.1ms. While off, read the value of the sensor at this time on the Arduino input.

This article also states that the lego RCX is outputting 8V so as the Arduino will only output 5V, you will need to take multiple values and extrpolate a table of values to determine the reading. The value will correspond to an analogue value of 0 to 127 from a lego sensor.