Color Light-To-Frequency Converter TCS3200 (CY8CKIT-050) Sample Program

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

One day, someone sent me a message that the person is having difficulty using TCS3200 with PSoC 5.

And as I wanted to find the next theme for my sample project, I ordered a couple of TCS3200 modules to my DigKey account.

I've tried some I2C color sensors before, but "frequency" as the output(?) was my first experiment.

And also I noticed that I have not done much programming (aka hacking) with PSoC 5LP, yet.

So I gave a try v(^_^)

IMG_3326.JPG

My schematic was something like below

001-schematic.JPG

The sensor has scaling choice of 0%, 2%, 20%, 100%

and color sense choice of Red, Blue, (Clear), and Green.

For the first prototype, I just let the program looping all choices, including probably nonsense 0%.

First I ran the loop with open air condition, like the picture above

003-Open-Air.JPG

Then I held an orange above the sensor

IMG_3327.JPG

The result was

002-with-Orange.JPG

So at least the values were affected.

moto

5 Replies
lock attach
Attachments are accessible only for community members.
diluc_3555836
Level 2
Level 2
First like received

20190122_144332.jpgHello, work with your code in the Psoc (CY8KIT-059) modifying the sensor since the tcs3200 with which I work does not have the OE rating.

But I presented the problem that does not show me a reading result. I do not know if I'm ignoring something or declaring an incorrect function!

I attach the modified code

grab-em-color-sensor-tcs3200-module-original-imaefuyk9dzgmyuy.jpeg

This shows me, without generating a measurement result of the sensor.

Sin título.jpg

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Dear Diego Luna-san,

I downloaded your project and re-targeted the device to my CY8CKIT-050.

And when I ran the program, same thing happened.

So I took a look at your schematic

and I found that you changed the timer period to 167.772sec where mine was 1sec.

To measure the frequency, I wanted count edges of each second.

000-Timer-config.JPG

So I changed the Timer Configure for 1sec period and checked Interrupts: On TC.

001-Timer-Config.JPG

And I ran the program.

002-TeraTerm.JPG

Meantime, seeing you TeraTerm screen shot, may be you are setting the new line to CR+LF,

being a Unix/Linux hacker, I prefer '\n' for a new line, but to survive in the Wintel world

I configure my TeraTerm Terminal setup as below.

New-Line > Receive > AUTO

003-TeraTerm-Setup.JPG

Note: locale Japanese is not mandatory 😜

Best Regards,

23-Jan-2019

Motoo Tanaka

0 Likes

thanks, change change the value in the timer, now if you throw results. thank you for sharing your practice

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Today I created a version for CY8CKIT-044.

IMG_3348.JPG

001-schematic.JPG

000-TCS3200-CY8CKIT-044-TeraTerm-Log.JPG

As CY8CKIT-044 can not hold two 24bit UDB counters,

I needed to modify the project to use smaller counter/timer and software ISR to handle interrupt and overflow of the counter.

BTW, I wonder why but some time, some where my brain mistook TCS3200 as TSC3200 ...

In this version, those typos were fixed (I hope).

moto

P.S. I found a bug, which adds carry out of Counter twice, and replaced the TeraTerm log and attached archive for CY8CKIT-044 with the fixed ones (4-Feb-2019)

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

本サンプルは CQ出版 インターフェース 2019年5月号に

2019年5月号 | Interface – CQ出版

ふえる今どきセンサNote

その16 RGB値を直接周波数で出力するカラー・センサTCS3200

として掲載されました。

I contributed this sample project to a Japanese technical magazine

"Interface" May/2019 edition.

moto

0 Likes