Interfacing TCS3200 color sensor with evive

About This Tutorial
In this tutorial we will interface TCS3200 color sensor with evive , and we will display value of Red ,Green and Blue component on tft display
Tutorial Info

Components Required

Image Component Quantity Available in Kit
evive 1
USB A-B Cable 1
Male to Female Jumper Cable 20cm 1
Color Recognition Sensor (TCS3200) 1
  • None

Introduction

The TCS3200 color sensor can detect a wide variety of color based on their wavelenght.This sensor is specially useful for color recognition projects.TCS3200 senses color light with the help of 8*8 array of photodiodes.

RGB color sensor

 

The TCS3200 has an array of photodiode with 4 different filter.A photodiode is a semiconductor device that convert light into current ,this sensor has

 

  • 16 photodiode with red filter     -sensitive to red wavelength
  • 16 photodiode with green filter – sensitive to green wavelength
  • 16 photodiode with blue filter   – sensitive to blue wavelenght 
  • 16 photodiode without filter

By selectively choosing the photodiode filter’s readings ,you are able to detect the intensity of the different colors.the sensor has a current -to-frequency converter that converts the photodiodes reading into a square wave with a frequency that is proportional to the light intensity of the chosen color.this frequency is then read by the evive board this is shown in figure below

Pin description

  • Power supply pins (VDD and GND)
  • Output frequency enable  pin( OE)
  • Output frequency pin (OUT)
  • RGB filter’s selection input pin (S2 and S3)
  • Output frequency scaling selection input pin ( S0 and S1)

Frequency scaling  and filter selection

Frequency scaling is useful for optimizing sensor reading’s for various frequency counters and microcontroller,we will use 20% frequency scaling for evive board ,by selecting perticular combination of control pin S0 and S1 frequency selection of 2% ,20% and 100% can be achieved ,take a look at table below

              Frequency scaling        S0         S1
               Power down       LOW        LOW
                    2%       LOW        HIGH
                  20%       HIGH        LOW
                 100%       HIGH        HIGH

Because photodiodes are connected in parallel combination we can use different combination of control pin S2 and S3 to select perticular photodiode, below figure show possible combination of S2 and S3 and there corresponding photodiode filter selection

           Photodiode filter type        S2        S3
                    Red filter      LOW       LOW
                    Blue filter      LOW       HIGH
                    No filter      HIGH       LOW
                   Green filter      HIGH       HIGH

Circuit diagram

  • Connect gnd and vdd of  TCS3200 module to gnd and vcc of evive respectively 
  • Connect S0 pin to pin number 2 of evive
  • Connect S1 pin to pin number 3 of evive
  • Connect S2 pin to pin number 4 of evive 
  • Connect S3 pin to pin number 5 of evive
  • Connect OUT pin to pin number 8 of evive

pulseIn() function

 Syntax    :    pulseIn(pin,value,timeout)

pulseIn() function is used to read pulses on perticular pin ,here pin is pin number on which we want to read pulse ,for example if value is  HIGH ,then pulseIn() wait for the pin to go HIGH ,if pin goes HIGH then it start timing ,when  pulse become LOW it stops timing and returns the length of the pulse in microseconds  

Code

 

 

 

 

 

 

 

This helped
This didn't help
Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Featured Projects
Digital-Tachometer
DIY Digital Tachometer

This project will show you how to make a digital tachometer to measure the speed of a motor or any ...

All articles loaded
No more articles to load
Close Menu
×
×

Cart

STEMpedia Starter Kit is now available on Indiegogo!
STEMpedia Starter Package is now on Indiegogo!
Get 41% OFF with Super Early Bird discounts!
x