David Huang's Ultra-Low-Cost Color Sensor Turns an Arduino Into a Wobbly Handheld Scanner

Using three colored LEDs, a simple photoresistor, and some clever code, Huang's latest low-cost build competes with commercial sensors.

Gareth Halfacree
3 years agoSensors / Upcycling

Low-cost sensor expert David Huang is back with another build, this time putting together a color sensor that doubles as a functional — if somewhat wobbly — handheld scanner.

Huang has impressed before with projects which turn low- or zero-cost scrap materials into impressively functional sensors, including a string-based wearable tension sensor and a foam-and-pencil pressure sensor. His latest build, though, is marginally more expensive in parts — but offers impressive results.

"We usually use the [AMS] TCS3200 as the color sensor on Arduino," Huang explains in translation. "This kind of sensor will react to the reflection of the LED light around it, and that’s how the sensor works: The reflection from the object will send the color into this chip [which has a] light sensor. It will react to the RGB (Red, Green, and Blue) light."

"The Arduino program can distinguish the red light, the green light, and the blue light. According to the different numerical values it will be able to tell which color it is. But I am not going to use that color sensor: we are going to make our own, and it costs almost nothing."

This ultra-low-cost color sensor proves accurate enough for use as a somewhat clumsy handheld scanner. (📹: David Huang)

Huang's homebrew color sensor is built from single red, green, and blue LEDs, a photoresistor, and a frame built from a straw, some scrap cardboard, and black duct tape — all held in place with hot glue.

"This is how it works: We turn on the red, green, and blue LED lights, let it shine on the object, and the reflection goes onto the photoresistor," Huang notes. "And the red object won't absorb the red light, so the photoresistor will sense the higher numerical value. On the other hand, the red object will absorb the blue light and the green light, so the photoresistor will sense the lower numerical value. This is how the sensor tell the different color."

How effective is Huang's ultra-low-cost approach? After calibration, it proves good enough to act as a handheld color scanner of sorts — approximating the appearance of a grid of color squares on the display of a connected computer.

Huang's full video is now available on YouTube in Chinese, with machine-translated English subtitles.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles