This is only a preview of the October 2021 issue of Silicon Chip. You can view 0 of the 112 pages in the full issue. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Tele-com – an intercom using analog phones":
Items relevant to "Two- or Three-Way Stereo Active Crossover – Part 1":
Articles in this series:
Items relevant to "SMD Test Tweezers":
Items relevant to "Touchscreen Digital Preamp with Tone Control – Part 2":
Articles in this series:
Items relevant to "Colour recognition using LEDs and an LDR":
Items relevant to "Battery charger with WiFi interface":
Purchase a printed copy of this issue for $10.00. |
CIRCUIT NOTEBOOK
Interesting circuit ideas which we have checked but not built and tested. Contributions will be
paid for at standard rates. All submissions should include full name, address & phone number.
Colour recognition using LEDs and an LDR
I decided to make a box that determines the colour of objects placed
upon it. Rather than using a prebuilt
module or phone app, I’m doing it from
first principles, using three LEDs (red,
green & blue) and a light-dependent
resistor (LDR).
I have found that both adults and
children are very impressed and spend
quite a bit of time playing with it.
On the top, it has an LCD screen that
shows the result, an on/off switch, a
pushbutton for initiating a test and a
cylinder that has the LDR and LEDs
mounted in the bottom.
The object to be measured is placed
over the cylinder. When you press the
pushbutton, the microcontroller inside
switches each coloured LED on sequentially and measures the intensity of the
reflected light using an LDR, a constant current source and the analog-todigital converter in the microcontroller.
Circuit
Ideas
Wanted
siliconchip.com.au
It converts the LDR resistance to a
voltage that it can measure using a constant current source. The percentage of
each colour is calculated, along with
the overall colour of the object. The
result is displayed on the LCD screen.
The results are quite reproducible, and
it works for different shade intensities
of each colour.
Consider a purple object. It would
reflect most of the blue or red light incident on it, but not green. So when the
blue or red LED is lit, the LDR resistance is low, and when the green LED
is lit, the LDR resistance is high. This is
how the unit can determine the colour
of the object.
All the components are available offthe-shelf and are mounted on a simple
PCB that plugs into the display.
To cater for the considerable variation in parameters of the coloured
LEDs and LDR, four potentiometers are
used for the initial calibration, which
only requires a DVM.
Place a white object over the sensor and remove IC1 from its socket.
Short socket pin 2 to ground, set VR2
mid-way and measure the voltage at
socket pin 15. Then short socket pin
13 to ground instead of 2, and adjust
VR3 to get the same voltage at pin 15.
Repeat for socket pin 12 and VR4.
If you can’t get the voltages equal,
adjust VR2 one way or the other then
repeat the above steps. Finally, replace
the micro, press the test button and
check the readings. Adjust VR1 to
get them all above 200, and re-adjust
VR2-VR4 (if necessary) to make the
readings equal.
The Gerber files for the PCB and
CAD drawings for the box and LED/
LDR holder, along with the HEX file
and BASIC source code for the PIC
are available from siliconchip.com.
au/Shop/6/5931
Les Kerr, Ashby, NSW. ($120)
Got an interesting original circuit that you have cleverly devised? We will pay good money to
feature it in Circuit Notebook. We can pay you by electronic funds transfer, cheque or direct to
your PayPal account. Or you can use the funds to purchase anything from the SILICON CHIP Online
Store, including PCBs and components, back issues, subscriptions or whatever. Email your circuit
and descriptive text to editor<at>siliconchip.com.au
Australia’s electronics magazine
October 2021 103
|