Page 1 of 2
Lego 2.0 color sensor
Posted: 03 Jan 2011, 18:47
by mattallen37
The Lego 2.0 color sensor seems somewhat a mystery, there seems to be NO documentation on it, or the digital protocol the NXT uses to "talk" with it. If you know of a schematic for it, please direct me or post it, same with any other technical information you might have on it.
What is the third, (bottom of three) "things" on the front? I know the top two are a phototransistor, and an RGB LED, but what is the bottom one? something to do with IR? IR LED? What is it for?
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 18:56
by philoo
mattallen37 wrote:The Lego 2.0 color sensor seems somewhat a mystery, there seems to be NO documentation on it, or the digital protocol the NXT uses to "talk" with it. If you know of a schematic for it, please direct me or post it, same with any other technical information you might have on it.
Like you, I have
nothing about it
What is the third, (bottom of three) "things" on the front? I know the top two are a phototransistor, and an RGB LED, but what is the bottom one? something to do with IR? IR LED? What is it for?
The third "thing" is just a bump in plastic case, for aesthetic purposes (RGB -> 3 colors -> 3 bumps...)
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 19:02
by mattallen37
philoo wrote:Like you, I have
nothing about it
The third "thing" is just a bump in plastic case, for aesthetic purposes (RGB -> 3 colors -> 3 bumps...)
Hmm, I guess I'll call the mindstorms technical support, and see what I can find out.
Ok, that is just plain stupid. I knew they made some weird decisions when making the sensor, but that one makes no technical sense whatsoever.
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 19:23
by mightor
mattallen37 wrote:philoo wrote:Like you, I have
nothing about it
The third "thing" is just a bump in plastic case, for aesthetic purposes (RGB -> 3 colors -> 3 bumps...)
Hmm, I guess I'll call the mindstorms technical support, and see what I can find out.
Ok, that is just plain stupid. I knew they made some weird decisions when making the sensor, but that one makes no technical sense whatsoever.
Hehe, I wish you good luck. Philo and I are both in the MCP4 with far more access to technical info than most and even we're not getting answers. You could learn a fair bit from the source code of the NXT firmware but that's about as much fun as pulling teeth. Fairly edumakashunal, though. The Lejos firmware source code is probably a bit easier to read and better documented (I know that is not saying much, seeing as what we're comparing it with).
The 3rd bump is for aesthetic purposes only, makes it look more balanced. Or something. God knows what molten plastic fumes they were inhaling at the time this was conjured up.
- Xander
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 19:39
by mattallen37
It is hard to believe that nobody has reverse engineered it yet (at least not posted results), seeing as how many other lego electrical items have been reverse engineered.
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 19:51
by mattallen37
Well, I just got off the phone, and you're right, there is no public information on it. That is really crazy, seeing as how much they documented the 1.0 kit.
Re: Lego 2.0 color sensor
Posted: 03 Jan 2011, 21:04
by gloomyandy
Hi,
I wrote the leJOS driver for the light sensor (based on my interpretation of what the Lego firmware does, and confirming the timing using a scope). The interface is strange, but makes some sense given that it needs to use he I/O pins in a rather odd way (using one of the pins as both a digital and analogue line), and that they wanted to use very high speed switching to allow a RGB samples to be made.
As to reverse engineering it, well my guess is that inside there is a tricolor led, a very low end microcontroller (one that allows for programming of calibration data), and a phototransistor (possibly with some additional amplification). I think that's all you would need. The microcontroller handles the serial protocol and contains the calibration data, it also drives the led. I suspect that the phototransistor output is connected directly to the I/O line that can be used for both digital and analogue I/O and is not processed by the microcontroller... All of this is just a guess but that's how I would do it...
Andy
Re: Lego 2.0 color sensor
Posted: 04 Jan 2011, 14:38
by milluzaj
Xander, I know you usually open sensors. Have you cracked the LEGO color sensor open?
Andy have you documented any of the timing you used?
Re: Lego 2.0 color sensor
Posted: 04 Jan 2011, 15:16
by mightor
Andy,
I am starting to run out of spare covers, maybe when I get a couple more, I will
- Xander
Re: Lego 2.0 color sensor
Posted: 04 Jan 2011, 16:25
by gloomyandy
Spare covers, Hah! It's spare fingers I need. Having opened up a few of these Lego sensors, I'm not sure I've ever managed it yet without a trail of blood.... But maybe I'm just doing it the wrong way...
As to documenting the timing, well the old hackers reply of "It's in the source Luke" would apply, so other than the leJOS/Lego source code, no I don't think I ever did write the details down... But to be honest it's not that difficult to understand...
Andy