On the final code, we will read a few times each one of the RGB components and take an average, so we can reduce the error if one of the readings are bad. Grn = pulseIn(outPin, LOW) // Reading GREEN component of colorīlu = pulseIn(outPin, LOW) // Reading BLUE component of color Red = pulseIn(outPin, LOW) // Reading RED component of color As the photodiodes are connected in parallel, setting the S2 and S3 LOW and HIGH in different combinations allows you to select different photodiodes, as showed at above table. Next thing to do is to select the color to be read by the photodiode (Red, Green, or Blue), we use the control pins S2 and S3 for that. We will set S0 and S1, both in HIGH (100%): digitalWrite(s0,HIGH) Scaling the output frequency is useful to optimize the sensor readings for various frequency counters or microcontrollers. The first thing to define is the frequency scaling as defined at the table showed above. In order to properly use the sensor, we will install a small rubber ring to isolate the sensor from lateral light. We will use the 5V Arduino output to power the sensor. The Sensor as it si encapsulated should be powered between 2.7 and 5.5VDC. The OE (Enable) should be connected to GND (LOW). Photodiodes are 110 μm x 110 μm in size and are on 134-μm centers. Pins S2 and S3 are used to select which group of photodiodes (red, green, blue, clear) are active. 16 photodiodes are clear with no filters.Sixteen photodiodes have blue filters,.In the TCS3200, the light-to-frequency converter reads an 8 x 8 array of photodiodes. Output enable (OE) places the output in the high-impedance state for multiple-unit sharing of a microcontroller input line. Digital inputs and digital output allow direct interface to a microcontroller or other logic circuitry. The full-scale output frequency can be scaled by one of three preset values via two control input pins (S0 and S1). The output is a square wave (50% duty cycle) with frequency directly proportional to light intensity (irradiance). As described on its Datasheet, the TCS3200 is a programmable color light-to-frequency converters that combine configurable silicon photodiodes and a current-to-frequency converter on a single monolithic CMOS integrated circuit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |