HDJD-S822 Color Sensor Breakout

Initial report by Manuela Donoso 30 03, 2012



The HDJD-S822-QR999 is a high performance effective light to voltage converting sensor. This color senor module can detect the color of an object and report it back to your processor for applications like color sorting. The sensor combines a photodiode array and three transimpedance amplifiers in a single monolithic CMOS IC solution. With a Red (R), Green (G) and Blue (B) color filters coated over the photodiode array, the sensor converts RGB light to analog voltage outputs, denoted by VROUT, VGOUT and VBOUT, respectively. The sensor is packaged in a 5x5x0.75 [mm] surface mount QFN-16 package. The HDJD-S822 is really simply to get it up and running.


This sensor is made by Avago Technologies and distributed by Sparkfun.
Sparkfun (US) cost: $24.95
Robossavy (Europe) cost: 14.89


Ideal choice of for open loop and closed loop color identification. Potential applications are such as: general color detection, industrial process, environmental lighting, cabin lighting, decorative lighting and etc. Also can be used for monitor calibration.

Electrical Characteristics


1. Sensor: HDJD-S822 Color sensor Breakboard
2. Amplifier: MMBT2222 NPN General Purpose Amplifier

Resistors: The board uses SMD resistors. They are very small, so instead of color bands (as normal resistors) they have stamped numbers and letters on the top side of the component. (useful website to calculate SMD resistors fast)
3. SMD 331 Resistor: a 330 ohm resistor.
4. SMD 100 Resistor: a 10 K ohm resistor.
5. SMD 01A Resistor: a 100 ohm resistor.
6. LED
7. 2 capacitors of 0.1u

Also link any retail sources, for example if you're using a breakout board, or any other parts that making the sensor easier.

Give the voltage and amperage ranges, and any other relevant electrical data.

Describe the electrical changes when the sensor senses whatever physical changes it senses. Include graphs as needed.

Pin Descriptions

Microcontroller Connections

Here is a schematic of how to connect the sensor to Arduino, it is super easy.
Left part of the sensor starting from top:
GSB0 (blue wire), GSB1 (blue wire), GSG0 (green wire), GSG1 (green wire), GSR0 (orange wire), GSR1 (orange wire)
Right part of sensor starting from top:
VB (blue wire), VG (green wire), VR (orange wire), LED (yellow wire), GND (black wire), PWR (red wire)
Explain how to connect the sensor to a microcontroller or computer. Include a schematic and any other necessary diagrams. Make sure to include a list of every part in the schematic.

Additional parts needed to use it

To connect the sensor to Arduino I solder headers pins, this way it can be easily hook to the breadboard.

Code Sample

Give a code sample for the microcontroller you developed the example on. Link it to the Code group of the wiki, formatting the link like this:

Code Sample

In your code sample, show how to do the following:

  • read the sensor's output and save in a variable.
  • convert the sensor's output range to a voltage range corresponding to the microcontroller's analog-to-digital range.
  • convert from voltage to the physical property that the sensor measures. Provide the appropriate math in a separate function, as needed.
  • print the raw sensor reading, the voltage reading, and the physical property reading serially

Typical Behavior

Describe the behavior of the sensor when you use it to sense something. Note any peculiarities that you had to work around, or things that might affect someone else's use. Graphs and images are useful here.

Application Notes

Describe your own application of the sensor. Link to any external documentation of your project, and discuss how you got the sensor to do what you needed it to.


Sparkfun Product Showcase video (watch from minute 2.20)
Color Sensor Tutorial
Fritzing open-source software to create a pcb layout


Color Sensor, RGB, convert light.