0

TCS37425 RGB color sensor board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TCS37425 RGB color sensor board

by hgeagle on Tue May 21, 2013 3:42 pm

The product description says:
" The LED can be easily turned on or off by any logic level output."
(connect to which contact(s) on the board?)

The adafruit learning system tutorial states:
>Interrupts and LED control:
>vo id Adafruit_TCS34725: : setInterrupt(bo o lean i)
>Sets the sensor interrupt to generate an interrupt when the detected level is within the limits
>(see setIntLimits() below).
>Passing "false" will enable the on-board led for reflected light measurement.
>Passing "true" will turn the led off for incident light measurement.
(sounds simple...)

I am running the example "colorview" with the line:
"tcs.setInterrupt(true); // turn off LED"
but the LED stays on all the time.
What am I missing? What do I do wrong?
Could you supply a schematic of the board?

Thanks,
hgeagle

hgeagle
 
Posts: 7
Joined: Tue May 21, 2013 3:10 pm

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Wed May 22, 2013 5:32 am

Are you using the breakout board or the Flora version of the sensor? With the breakout board you can control the LED with the LED pin. I'm looking into the library issue & schematics.

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by hgeagle on Wed May 22, 2013 8:41 am

Currently I am using the breakout board. Thanks for looking into this!

hgeagle
 
Posts: 7
Joined: Tue May 21, 2013 3:10 pm

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Wed May 22, 2013 1:35 pm

Here's the word from the design team:
tie LED low to turn it off (or to a digital pin to control it on/off)

to control the LED from the INT pin, tie LED to INT. then you can call setInterrupt to turn it on/off. just give it at least 50ms to stabilize before you take a reading!


and example code:
Code: Select all | TOGGLE FULL SIZE
 tcs.setInterrupt(false);      // turn on LED
 delay(60);  // takes 50ms to read

 tcs.getRawData(&r, &g, &b, &c);

 tcs.setInterrupt(true);  // turn off LED  delay(1000);

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by hgeagle on Thu May 23, 2013 1:02 pm

Thanks, that did it!
It might be useful to include the wiring (LED - INT) in the color sensor tutorial(s). I did not see it there...
I am wondering how this issue is dealt with in case of the Flora color sensor version (there is no LED or INT pin).
The "Chamaleon Scarf" is really cool!!

hgeagle
 
Posts: 7
Joined: Tue May 21, 2013 3:10 pm

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Thu May 23, 2013 1:51 pm

Thanks for the feedback. I'll be updating the tutorial shortly. :)

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by michaelaf on Thu May 23, 2013 2:57 pm

Hello,

I am doing the same thing today, also wanting to turn the led off. Does "tie LED to INT" mean connect the two pins on the TCS sensor board with a wire on the breadboard? I imagine this is what you mean but I'd rather be sure...

Thanks

michaelaf
 
Posts: 3
Joined: Sun Apr 28, 2013 6:33 am

Re: TCS37425 RGB color sensor board

by hgeagle on Thu May 23, 2013 3:07 pm

Hello michaelaf,

Yes, use a wire and connect LED with INT on the breadboard. But then you need to use the code
"tcs.setInterrupt(true); // turn off LED"
to turn the led off.

I think you can just connect the LED pin with "ground" (".. tie LED low...") to turn it off without code. It works, I tried it, but without seeing the schematic I cannot be sure if that could lead to other problems.

Maybe Bill could advise... :)

hgeagle
 
Posts: 7
Joined: Tue May 21, 2013 3:10 pm

Re: TCS37425 RGB color sensor board

by michaelaf on Thu May 23, 2013 3:32 pm

Hello hgeagle,

I've done it via the breadboard and it worked perfectly. Thanks :D

michaelaf
 
Posts: 3
Joined: Sun Apr 28, 2013 6:33 am

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Thu May 23, 2013 4:00 pm

Yes, you can tie it to ground or pull it low with a spare pin if you have one.

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by michaelaf on Wed May 29, 2013 3:11 am

Hi Again,

Is there a way to turn the LED off all the time? At the moment, using "tcs.setInterrupt(true); the LED flashes briefly each time the loop runs, but I'd like it to be off all the time. How can I write this into setup instead of the loop?

michaelaf
 
Posts: 3
Joined: Sun Apr 28, 2013 6:33 am

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Wed May 29, 2013 7:02 am

Is there a way to turn the LED off all the time?

Call setInterrupt(true) in setup (and never again). Or just wire the LED pin to GND.

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by d4rren on Wed Mar 05, 2014 7:57 am

Hi

Is there a way of turning the LED off/on if using the Flora color sensor version (there is no LED or INT pin)?

I've tried the tcs.setInterrupt(true/false); method but without success.

If this is not successful my plan B will be to connect VIN to a digital pin and briefly power up the sensor when I want to use it.

Thanks
d4rren
 
Posts: 1
Joined: Wed Mar 05, 2014 7:03 am

Re: TCS37425 RGB color sensor board

by adafruit_support_bill on Wed Mar 05, 2014 8:17 am

The Flora version does not have LED control. I think your Plan B is the way to go.

adafruit_support_bill
 
Posts: 82189
Joined: Sat Feb 07, 2009 10:11 am

Re: TCS37425 RGB color sensor board

by uobine on Sun Jun 22, 2014 11:25 pm

Hello! I major Design Engineering in university in Korea and I studying TCS37425 RGB color sensor with a RGB Neopixel.
l tried "Chameleon Scarf" arduino source, and I need some more source.
This source is now possible to only once, but color recognition is, I is repeated once, but want to be able to detect the sensor.
Therefore, after the last of the sauce in the "void loop" I hope to inform.
uobine
 
Posts: 1
Joined: Sun Jun 22, 2014 11:10 pm

Please be positive and constructive with your questions and comments.