Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
pmod:pmodcolor:reference-manual [2022/09/13 18:01] – changed forum.digilentinc.com to forum.digilent.com Jeffrey | pmod:pmodcolor:reference-manual [2023/02/09 14:31] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Pmod COLOR Reference Manual ====== | ||
+ | |||
+ | The Digilent Pmod COLOR (Revision A) is a color sensor module with the ability to sense red, green, blue and clear light. The onboard [[http:// | ||
+ | |||
+ | {{Digilent Image Gallery | ||
+ | | image = {{: | ||
+ | | image = {{: | ||
+ | | image = {{: | ||
+ | | image = {{: | ||
+ | | image = {{: | ||
+ | }} | ||
+ | |||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Features ===== | ||
+ | * Red, green, blue, and clear light sensing | ||
+ | * IR-blocking filter | ||
+ | * White LED for reflective measurements | ||
+ | * Suitable for use behind darkened glass | ||
+ | * Small PCB size for flexible designs 0.8" × 1.25" (2.0 cm × 3.2 cm) | ||
+ | * 6-pin Pmod connector with I²C interface | ||
+ | * Pass-through Pmod host port for daisy chaining | ||
+ | * Follows Digilent {{/ | ||
+ | * Library and example code available on the [[pmod: | ||
+ | |||
+ | |||
+ | ===== Specifications ===== | ||
+ | ^ Parameter | ||
+ | | Power Supply Voltage | ||
+ | ^ Parameter | ||
+ | | Responsivity to blue light (λ = 465 nm) | Red Channel¹ | ||
+ | | ::: | Green Channel¹ | ||
+ | | ::: | Blue Channel¹ | ||
+ | | ::: | Clear Channel | ||
+ | | Responsivity to green light (λ = 525 nm) | Red Channel¹ | ||
+ | | ::: | Green Channel¹ | ||
+ | | ::: | Blue Channel¹ | ||
+ | | ::: | Clear Channel | ||
+ | | Responsivity to red light (λ = 615 nm) | Red Channel¹ | ||
+ | | ::: | Green Channel¹ | ||
+ | | ::: | Blue Channel¹ | ||
+ | | ::: | Clear Channel | ||
+ | ^ Parameter | ||
+ | | Output Resolution | ||
+ | |||
+ | ¹ - Percent values are with respect to the counts measured by the clear (non-color filtered) channel | ||
+ | ---- | ||
+ | |||
+ | |||
+ | ===== Pinout Table Diagram ===== | ||
+ | |||
+ | ^ Header J1 | ||
+ | ^ Pin ^ Signal | ||
+ | | 1 | IO1/ | ||
+ | | 2 | IO2/ | ||
+ | | 3 | SCL | Serial Clock | 3 | SCL | Serial Clock | SDA | ||
+ | | 4 | SDA | Serial Data | 4 | SDA | Serial Data | ||
+ | | 5 | GND | Power Supply Ground | ||
+ | | 6 | VCC | Power Supply (3.3V) | ||
+ | | |||||| LED_EN | ||
+ | |||
+ | ===== Physical Dimensions ===== | ||
+ | |||
+ | The pins on the pin header are spaced 100 mil apart. The PCB is 1.34 inches long on the sides parallel to the pins on the pin header and 0.8 inches long on the sides perpendicular to the pin header. | ||
+ | ---- | ||
+ | |||
+ | ===== Functional Description ===== | ||
+ | The Pmod Color utilizes the TCS3472 to detect color in the near vicinity. While communicating with the host board via the [[pmod: | ||
+ | |||
+ | ===== Serial Communication ===== | ||
+ | |||
+ | The Pmod COLOR communicates with the host board via the [[learn/ | ||
+ | |||
+ | The TCS3472 can set the gain and integration time for each round of data collection. Integration time provides more time for the color sensor to collect more data, providing accurate data and helping to prevent the data from disproportionately capturing any overexposure that may occur. Each set of the 16-bit data is organized in a low-byte, high-byte arrangement. | ||
+ | |||
+ | |||
+ | ===== Register Details ===== | ||
+ | |||
+ | ==== Data Registers ==== | ||
+ | |||
+ | Each of the three colors (RGB) and the clear color byte has two registers to store the high and low data bytes for each measurement. The data registers are arranged in a low byte, high byte arrangement. | ||
+ | |||
+ | ^ Data Registers addresses 0x14 to 0x1B || | ||
+ | ^ Address | ||
+ | | 0x14 | Clear Data Low Byte | | ||
+ | | 0x15 | Clear Data High Byte | | ||
+ | | 0x16 | Red Data Low Byte | | ||
+ | | 0x17 | Red Data High Byte | | ||
+ | | 0x18 | Green Data Low Byte | | ||
+ | | 0x19 | Green Data High Byte | | ||
+ | | 0x1A | Blue Data Low Byte | | ||
+ | | 0x1B | Blue Data High Byte | | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Command Register ==== | ||
+ | The Command register controls the functionality of the internal address pointer and clears interrupts. | ||
+ | |||
+ | ^Bit Name ^Bit Number | ||
+ | |CMD |7 |Command | ||
+ | |TYPE |6-5 |Type |00¹ |Selects the type of data transfer² | ||
+ | |ADDR/ | ||
+ | |||
+ | ¹ - This is the value on power-up and reset | ||
+ | ² - See the [[pmod: | ||
+ | ³ - See the [[pmod: | ||
+ | |||
+ | === Transaction Table === | ||
+ | ^ Transaction Table ^^ | ||
+ | ^Bit Values | ||
+ | |00 |Repeated bytes at the same register | ||
+ | |01 |Auto-increment to the next register | ||
+ | |10 |Reserved - Do not write | | ||
+ | |11 |Special function³ | ||
+ | |||
+ | ³ - See the [[pmod: | ||
+ | |||
+ | === Address Field and Special Function Table === | ||
+ | ^ Address Field and Special Function Field ^^ | ||
+ | ^Bit Values | ||
+ | |00110 | ||
+ | |Other | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Control Register (0x0F) ==== | ||
+ | The Control Register (0x0F) sets the gain factor applied to the ADC color data. | ||
+ | |||
+ | ^ Control Register | ||
+ | ^Bit Name ^Bit Number | ||
+ | |Reserved | ||
+ | |AGAIN | ||
+ | |||
+ | ¹ - This is the value on power-up and reset | ||
+ | ² - See the [[pmod: | ||
+ | |||
+ | === RGBC Gain Value Table === | ||
+ | ^ RGBC Gain Value Table ^^ | ||
+ | ^Bit Value ^RGBC Gain Value | | ||
+ | |00 |1x gain | | ||
+ | |01 |4x gain | | ||
+ | |10 |16x gain | | ||
+ | |11 |60x gain | | ||
+ | |||
+ | |||
+ | ==== Status Register (0x13) ==== | ||
+ | The Status register (0x13) is a read-only register that provides the state of the channel interrupt and if the ADCs have completed a data collection. | ||
+ | |||
+ | ^ Status Register | ||
+ | ^Bit Name ^Bit Number | ||
+ | |Reserved | ||
+ | |AINT |4 |Analog Data Interrupt | ||
+ | |Reserved | ||
+ | |AVALID | ||
+ | |||
+ | ¹ - This is the value on power-up and reset | ||
+ | |||
+ | ===== Quick Start ===== | ||
+ | |||
+ | Here is the series of commands to acquire a set of data from the Pmod COLOR via pseudo I²C code. | ||
+ | |||
+ | - Power on the Pmod COLOR. | ||
+ | - Provide a START condition and call the device ID with a write bit< | ||
+ | - Wait to receive an ACK from the Pmod COLOR. | ||
+ | - Provide a command to maintain the pointer address OR'd with the Enable register (0x00) < | ||
+ | - Wait to receive an ACK from the Pmod COLOR. | ||
+ | - Send the Enable Address and enable the oscillators. < | ||
+ | - Delay at least 2.4 mS before starting a data collection initiation. | ||
+ | - Send the Enable Address and enable the ADCs for all 4 channels. < | ||
+ | - Wait to receive an ACK from the Pmod COLOR and then send a STOP condition. | ||
+ | - Delay 2.4 ms for the ADCs preparing themselves for data measurement and at least 2.4 ms by default for the integration time during the data collection process. | ||
+ | - Send a START condition and call the device ID with a write bit < | ||
+ | - Wait to receive an ACK from the Pmod COLOR. | ||
+ | - Provide a command to auto-increment the address pointer OR'd with the first data register (0x14) < | ||
+ | - Wait to receive an ACK from the Pmod COLOR | ||
+ | - Provide a RESTART condition and call the device ID with a read bit< | ||
+ | - Wait to receive an ACK from the Pmod COLOR. | ||
+ | - Collect all 8 data bytes corresponding to the low and high data byte registers of the clear, red, green, and blue data, respectively, | ||
+ | - Send a STOP condition. | ||
+ | |||
+ | |||
+ | ===== Applications Information ===== | ||
+ | The %%Pmod COLOR%% is ideal for fun applications that perform different tasks based on the color of an object. This is perfect for sorting different objects or controlling a motor based on the detected color temperature. | ||
+ | |||
+ | |||
+ | ==== Data Conversion ==== | ||
+ | The AMS TCS3472 module has four different ADC channels to detect red, green, blue, and clear ambient light data. Colorimeters of this nature do not have perfect sensing capability so some of the color sensors, notably green and blue, do not measure the full data range of the data | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Timing Diagrams ==== | ||
+ | An example timing diagram for reading and writing to the Pmod COLOR taken from the AMS datasheet is provided below: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | When using an external power supply to run the Pmod, be sure to stay within the parameters provided in [[pmod: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Additional Information ===== | ||
+ | |||
+ | The schematics of the %%Pmod COLOR%% are available {{reference: | ||
+ | |||
+ | Example code demonstrating how to get information from the %%Pmod COLOR%% can be found on its Resource Center [[pmod: | ||
+ | |||
+ | If you have any questions or comments about the %%Pmod COLOR%%, feel free to post them under the appropriate section (" | ||
+ | |||
+ | |||
+ | {{tag> | ||