• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Analog to Digital converter

PJ33

New Member
I have build a simple colour senor usign leds and ldr. My aim is to classify boxes as green and red. My output at the moment is the voltage across the LDR but i would like to get a digital output. I was thinking of signal conditioning but because I am newinto electronics I dont know hot yo utilise it.
PS: I dont have ADC
 

Reloadron

Well-Known Member
Most Helpful Member
When I was a kid I did a science fair project I called SOC (Sound of Color) All it was, was a few transistors configured as an tone oscillator. The LDR controlled the tone frequency. I used an aimed small incandescent flashlight bulb configured with the LDR to reflect the light off a wheel with different colors of construction paper.

You want a digital out just look at an amplitude and use reflected light. Then as suggested use a uC setup as a comparator circuit. Make your red or green whichever logic state you want. Just about any small uC will work. Just note the return signal amplitudes for red and green. A simple comparator circuit. A LM339 or similar would work. That or a uC.

Ron
 

ChrisP58

Well-Known Member
Most Helpful Member
One problem with using the varying voltage levels from an LDR is that they're sensitive to brightness of the light, not the color of the light. As such, changes in the ambient light level, angle of incidence, or other factors can confuse your readings.

A better choice would be a true color sensor. Here are a few candidates:
https://www.adafruit.com/product/1334
https://www.adafruit.com/product/4698
https://www.adafruit.com/product/3779

All of these have digital data interfaces, so you'll need something that can talk I2C, such as an Arduino, Pi, or other microcontroller.
 
Last edited:

rjenkinsgb

Well-Known Member
Most Helpful Member
Look at the TCS3200 colour sensor.
You can get a module with the IC and white LEDs etc. to work with an Arduino or other MCU.

Or depending what you are making, you can also get a colour sensor for the Lego Mindstorms EV3 robotics gear.
 

gophert

Well-Known Member
Most Helpful Member
If you have red and green boxes, you should be able to identify them by sensing how much red or green light intensity reflects off of them. The deeper, darker red or green the boxes are, the better it will work. Most papers/cardboard have lots of reflective white pigment in the cellulose or in the red or green ink, or even white base oats of ink are used to make top coats of red or green ink "pop" a bit brighter. So, again, deep and darker shades of green and red will work better.
Green will reflect off of green but be absorbed by red. Red light will be reflected by red but absorbed by green. You should be able to get a significant (strong) signal difference.
 

PJ33

New Member
I am trying to convert the analog to digital output and I have decided to use a hex schmitt trigger inverter. Does this component have set thresholds or can i vary them?
 

alec_t

Well-Known Member
Most Helpful Member

PJ33

New Member
Sorry I am new in electronics adn i dont know how to use the datasheet, I just understand how the hex schmitt trigers work.
Will SN7414N or SNx414 do the work?
 

alec_t

Well-Known Member
Most Helpful Member
Will SN7414N or SNx414 do the work?
Those have fixed thresholds (albeit with some manufacturing tolerance).
 

rjenkinsgb

Well-Known Member
Most Helpful Member
Note that 74 TTL or LSTTL are not ideal for that type of use as the inputs take some current.

74HC devices would be better, or 4000 series such as a 40106. Those have effectively zero input load so won't affect the circuit feeding them.
The thresholds with those are roughly 2/3 and 1/3 the supply voltage.

However, if you want a variable threshold, a dedicated comparator IC would be a lot better still, eg. an LM311

You could connect the LDR circuit to one input and a variable or preset resistor across power, with the wiper connected to the other input of the 311, so you could set the switching threshold at any level you required.
 

alec_t

Well-Known Member
Most Helpful Member
The thresholds with those are roughly 2/3 and 1/3 the supply voltage.
You're probably thinking of a 555? CD40106 Schmitt trigger thresholds are about 55% and 45% of the supply voltage.
 

Latest threads

EE World Online Articles

Loading
Top