ROBOTC.net forums
http://www.robotc.net/forums/

Question about HiTechnic Color Sensor V2
http://www.robotc.net/forums/viewtopic.php?f=41&t=2435
Page 1 of 1

Author:  SeaLyon [ Sun Jun 20, 2010 11:49 pm ]
Post subject:  Question about HiTechnic Color Sensor V2

Hi,

Quick question. Is there a way to disable the white LED on the sensor when the sensor is not in use? Seems odd that the LED comes on with NXT boot, seems like it should not waste battery power until needed.

Thanks,
Chris

Author:  SeaLyon [ Thu Jun 24, 2010 10:05 am ]
Post subject:  Re: Question about HiTechnic Color Sensor V2

Hi,

Can anyone help me with this? Appreciate it.

Thanks,
Chris

Author:  mightor [ Thu Jun 24, 2010 10:09 am ]
Post subject:  Re: Question about HiTechnic Color Sensor V2

You could disconnect it. The LED takes about 5mA, even with the 1400mAh rechargeable battery pack from Lego, you'll be able to run that for about 280 hours. Ok maybe not that long, but if you're worried about power consumption, you'd be better off disabling things like BT.

Regards,
Xander

Author:  SeaLyon [ Thu Jun 24, 2010 5:50 pm ]
Post subject:  Re: Question about HiTechnic Color Sensor V2

Hi,

There's no firmware support for keeping the LED off? Seems like it should be OFF by default (like the active light sensor) and LEGO Color Sensor. Then you could have an api call to enable/disable it from code as needed. Certainly seems like it shouldn't waste battery power if it's doing nothing (yes, I know it's only a few ma, but every bit helps!). Is this an issue for it in general, or just under RobotC? Is it ON by-default if running under NXT-G? Haven't tried it, but I'd guess not.

There's also the visual issue of having the LED on all the time. Yes, in my case it could actually matter. I know you can disable/enable it when using the passive parameter on the RGB call, but that only works if you specifically code for it. That's what I'm doing now and it appears to work fine, but it's just more code needed to fix something that appears broken in some way by default.

This is the application where I needed to talk to 4 NXTs from the PC via Bluetooth or IRLink. I've actually got the Bluetooth code running now (well, for the most part!) and am able to communicate with the 4 NXTs. I'm already shutting down BT when not being used and re-enabling to reduce battery drain, but I can't turn it off fully in this application unfortunately. Appreciate the reply.

Thanks,
Chris

Author:  mightor [ Fri Jun 25, 2010 12:56 am ]
Post subject:  Re: Question about HiTechnic Color Sensor V2

The trouble is, the firmware doesn't know it has an NXT 2.0 colour sensor connected to a specific port until *you* configure it as such. There's no auto-detect, if you know what I mean. So you when you switch on the NXT, it doesn't know how many motors or how many sensors are attached to it. This isn't a bug in the firmware, it's a hardware design choice by Lego.

The NXT 2.0 colour sensor is *nothing* like the old light sensor. It's a mix between analogue and digital, but not I2C. It uses a custom protocol (SPI-like) to initialise and configure its internals. It also doesn't use the standard AD (Analogue to Digital) conversion technique (which makes use of the ATmega8), instead it uses the ARM7's own ADC (AD Converter) to speed up conversion. So the sensor is fast, much faster than any true I2C sensor, but the trade-off is that most of the conversion/calculation work is done by the NXT's hardware and firmware. It also requires the coloured object to be very close to the sensor and it's much more influenced by main's power induced light flickering (50/60Hz) than the HiTechnic colour sensor.

A small init function in your program to turn off the LED is the way to go. When life gives you lemonade...

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/