Project: Color detection

51 views
Skip to first unread message

Sébastien Verspecht

unread,
Dec 13, 2017, 3:56:33 AM12/13/17
to TI-Innovator
Hello,

I've made a little project on TI-Innovator with a RGB led and a light level sensor to detect color.
As I'm not a physic teacher, I maybe make mistake or omit some important things but here are most important ideas:
- Light emitted by an LED on a paper with an incidence's angle of 45° will be reflected on light level sensor with an reflection's angle of 45°.
- To prevent parasitic lights from led (directly) to sensor, we place an opaque panel between them.
- If we place a blue sheet of paper, blue's rays from led will be reflected to light sensor where red's rays will be absorbed by sheet.
- Then if we send colors, one by one, to sheet, we can mesure level of reflection for each color and then, determine color of the sheet placed in the construction.
- We first make a White and a Black balance to have a range of values that can be received by light level sensor. As normally, white paper will reflect all colors and black will absorb all of them.

I'm pretty conscient that kind of paper will affect quality of datas received and for better output I would have to adapt values (to prevent too blue light of onboard LED).

You'll find .TNS file attached. Please don't hesitate to adapt, correct or reuse it.

Here are also videos of project running:
- Presentation (in french): https://youtu.be/RaY6h74qoUw
- Quick demonstration (no speech): https://youtu.be/3r0msNhNtAc

Regards,

Sébastien

Color_detection.tns

Sébastien Verspecht

unread,
Dec 16, 2017, 1:55:33 PM12/16/17
to ti-inn...@googlegroups.com
Hello,

I’ve just begun to use my TI-Innovator Rover and I wanted to test integrated color’s sensor.
Here is a little video of my test: https://youtu.be/6jWgiJTn-t0

Here are some questions/remarks after this:
1°) It’s possible to send this command "READ RV.COLORINPUT" and to get an answer. But this answer is very strange. I have collected integers between 1 and 7. But what means this values? They seems like « pre-registered » colors. But in this case, how can we change or set this values. It could be nice if we can just compare a color to a number :)
2°) Is there a way on TI-Nspire to set a pixel (point or any other element) to a specific color on screen programmatically with TI-BASIC?
3°) Inspired by the way to get value from HMC588L module, how to link another color sensor TCS34725 (https://www.adafruit.com/product/1334) and get data through TI-Innovator Hub without Rover?

Have a nice weekend! 

Regards,

Sébastien

--
You received this message because you are subscribed to the Google Groups "TI-Innovator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/d756baba-f486-4f17-a359-028f62b5470f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Color_detection.tns>

John Hanna

unread,
Dec 16, 2017, 2:13:22 PM12/16/17
to ti-inn...@googlegroups.com

RGBCMYKWG

 

1=Red

2=Blue

3=Green

.

.

.

9=Gray

 

Regards,

         John

John Hanna

unread,
Dec 16, 2017, 2:16:19 PM12/16/17
to ti-inn...@googlegroups.com

2. No. Try Lua.

 

3. Yes. You need the name of the device, though. See the guide.

 

Regards,

         John

 

From: ti-inn...@googlegroups.com [mailto:ti-inn...@googlegroups.com] On Behalf Of Sébastien Verspecht
Sent: Saturday, December 16, 2017 1:56 PM
To: ti-inn...@googlegroups.com
Subject: Re: Project: Color detection

 

Hello,

AVRhobby .

unread,
Dec 16, 2017, 2:21:34 PM12/16/17
to ti-inn...@googlegroups.com
The numbers gives you these predefined colors. 1 = Red 2 = Green 3 = Blue 4 = Cyan 5 = Magenta 6 = Yellow 7 = Black 8 = White 9 = Gray 
you can use this numbers by example for stopping at a line, for turning an angle when a specific color is detected, for ... 
I think the number is the one that fits the most (not tested this yet). So maybe orange is also number 1. 

If you want to detect another color you can use rv.color.red , rv.color.blue and rv.color.green this gives you the ammont of R G B in numbers between 0 and 255  
0 is black, red(or blue or green) is not reflected by the object, 255 is red(or blue or green) is fully reflected by the object.
By doing this you have 3 numbers and these 3 numbers tells you the RGB value of a particular color.  

for question 2 and 3 i haven't an answer at this moment. 

To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TI-Innovator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/A2F51D02-AF47-4AAE-8E86-0D4B0956566E%40verspecht.com.

Sébastien Verspecht

unread,
Dec 16, 2017, 5:40:54 PM12/16/17
to ti-inn...@googlegroups.com
Thank you Franklin & John!

I’ll test more further «  standards colors » (Now, I’ve seen values and colors here: https://education.ti.com/html/webhelp/EG_Innovator/EN/content/eg_innovsys/m_rv-comm/read-rvsensors/rv.colorinput.HTML )
I haven’t yet completely read documentations of Rover’s commands…

Ok for colors in scripts on TI-Nspire... Unfortunately, despite having met twice my Lua’s god, Steve Arnold, I haven’t used it enough to be as familiar as with TI-Basic (with which I can use WITH my students).

For TCS34725, I’ll need at minimum name given in Hub (like name « COMPASS »  for HMC5883L) and, unfortunately, I didn’t see any mention to it in guide. It’s maybe an hidden feature of future version…

:)


To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ti-innovator/CAHo3%3D4u7xigV4iSYBHrzrq0FfqVXYD_a2W7hQScAb6CEpabrAA%40mail.gmail.com.

Sébastien Verspecht

unread,
Feb 24, 2018, 1:20:39 PM2/24/18
to TI-Innovator
Hello all,

I bought a TCS34725 RGB Sensor (like this https://www.adafruit.com/product/1334)
As it's same model that in Rover, I've tried to link it to my TI-Innovator directly trough I2C to have a more easy external way to get colors to make some projects with my students.

I've connected pins GND/VCC(3.3V)/SDA/SCL from sensor to I2C but after... I haven't founded a way to grab values from sensor.
Inspired by keyword "COMPASS" used for HMC5883L, I've tried multiples keywords (even RV.COLORINPUT) with no success.

Is there a way to access to values returned by sensor with actual sketch (1.2). If not is it planned for future versions?

Sébastien

Fotsch, Frederick

unread,
Feb 26, 2018, 7:24:15 PM2/26/18
to ti-inn...@googlegroups.com
Hi Sebastian,

Although this sensor is not currently an independent object, it is, as you know, part or ROVER. It is possible to access the color sensor object within ROVER without a Rover actually being  present on the Hub. To try this, you must strip off one end of a Grove cable and solder the yellow wire to SCL, white wire to SDA, red to 3.3V, and black to gnd. You may also optionally connect the white LED illumination select to BB3. Then plug the sensor into I2C and then Connect ROVER in your program. Next,  use READ RV.COLORINPUT to read the sensor.

Hope this helps, and let me know if it works. Please post any cool projects you have done back to this group.

Thanks,
Fred

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "TI-Innovator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator...@googlegroups.com.

Sébastien Verspecht

unread,
Mar 1, 2018, 6:55:33 AM3/1/18
to TI-Innovator
Hi Fred,
 
Thanks for your answer.
 
Unfortunately, I can’t make it works.
I’ve even tried with TCS34735 mounted on Rover without success.
If I don’t send command trough FP15-10-3 electronic board on Rover, I can’t get any value.

Extra question: Is it normal that after being unable to get colorinput, no more action/answer can be get from Rover?
Innovator seems to don’t recognize any request until I’ll unplugged it.

Regards,

Sébastien Verspecht
Professeur à l'Athénée Royal Jules Bordet, implantation de Soignies
Membre du CA et responsable du site internet de la SBPMef
Membre du groupe de formation T³Wallonie

Fotsch, Frederick

unread,
Mar 1, 2018, 8:16:51 AM3/1/18
to ti-inn...@googlegroups.com
Hi Sebastien,

To be clear, let me summarize:

1. This does not involve an actual hardware Rover. No modifications are being made to the actual Rover hardware.

2. You are using this  TCS34735 color sensor board https://www.adafruit.com/product/1334)

3. You soldered a Grove cable to the TCS34735 board with the yellow wire to SCL, white wire to SDA, red wire to 3.3V, and black to gnd. Also soldered a jumper wire with a male pin header to the LED enable on the TCS board.

4. You plugged the Grove cable from the TCS board into the I2C port on a stand alone Hub, no Rover involved.

5. You plugged the male pin header wire from the LED on the TCS board into BB3 on the Hub.

6.  You included CONNECT ROVER in your TI BASIC program.

7. You included the READ RV.COLORINPUT in a polling loop and displayed the result.

If you have done these steps with no success, will you please post a picture of your setup and also your TI Basic program?

Your second question concerning Rover, if the I2C cable is disconnected when Rover is on or being turned on, then the I2C bus becomes invalid and one must power cycle the entire system by disconnecting the calculator and turning off the Rover at the same time to regain the I2C communication.

Lastly, this is an advanced use of the Hub and is not a typical use scenario. However, one purpose of this group is to explore new ideas with no guarantee of success. That said, good luck, and keep on innovating!

Hope this helps,
Fred



Sent from my iPhone

On Mar 1, 2018, at 5:55 AM, Sébastien Verspecht <seba...@verspecht.com> wrote:

FP15-10-3

Sébastien Verspecht

unread,
Mar 1, 2018, 3:25:24 PM3/1/18
to ti-inn...@googlegroups.com
Hi Fred,

Thanks to have taking time to answer before this big event! (I wish you nice meetings!)

Unfortunately, I’ve completely followed your step (I’ve also integrate optional LED pin to BB3) but wit no more success.

Here is a photo of my setup. 


I’ve used dupont wires to link grove connector to TCS to make those links:
GROVE -> DUPONT -> TCS
BLACK -> GREY -> GND
RED -> PURPLE -> 3.3V
WHITE -> GREEN -> SDA
YELLOW -> BLUE -> SCL
[BB3 > BROWN > LED]

Please also find one (of multiples) script(s) tested to get values from this sensor.

Thanks again for your help.
I know that’s an unusual way to work but I wanted to let my students achieving their project of « color quizz » without « monopolizating » the ROVER in a perpendicular position to access to his color sensor ;)

Regards,

Sébastien Verspecht
Professeur à l'Athénée Royal Jules Bordet, implantation de Soignies
Membre du CA et responsable du site internet de la SBPMef
Membre du groupe de formation T³Wallonie


PS: As I was thinking/presuming problem could come from my new sensor. I’ve also switch TCS (mine and from ROVER). No difference: new TCS work like a charm in ROVER and « old » from ROVER don’t work more in my setup.


--
You received this message because you are subscribed to the Google Groups "TI-Innovator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ti-innovator...@googlegroups.com.
TCS34725.tns
Reply all
Reply to author
Forward
0 new messages