Arduino Forum

Using Arduino => General Electronics => Topic started by: Sunjaman on Mar 23, 2014, 08:03 pm

Title: ldr pre-process
Post by: Sunjaman on Mar 23, 2014, 08:03 pm
Hi, is there a passive way to compare (<=>) two ldr's voltages and generate a scaled output before arduino input pin? (In case uno's analog pins is not enough)
Title: Re: ldr pre-process
Post by: robtillaart on Mar 23, 2014, 08:06 pm
what is your goal,
what do you want to measure
Title: Re: ldr pre-process
Post by: Sunjaman on Mar 23, 2014, 08:13 pm
i have 2 photo resistors. each one in a voltage divider circuit. i want to compare these voltages to know which one is bigger or if they are equal. But i want this measurment to be scaled in a way that arduino can handle it. (0 to 5v, or 0, 2.5, 5)
Title: Re: ldr pre-process
Post by: robtillaart on Mar 23, 2014, 08:22 pm
you can use the analog Read for both but you definitely need to calibrate when they are equal.
The ADC of the arduino is multiplexed and often you have noise on your measurements.
So a difference of lets say 3 point on the 0..1023 scale that can be noise.
Title: Re: ldr pre-process
Post by: Sunjaman on Mar 23, 2014, 08:26 pm
i don't want to use arduino for this comparison because there is not enough analog inputs!
Title: Re: ldr pre-process
Post by: larryd on Mar 23, 2014, 08:27 pm
What is the range of resistance of your ldr?
What is the maximum voltage across the ldr?
Title: Re: ldr pre-process
Post by: Sunjaman on Mar 23, 2014, 08:35 pm
range 1kOhm to 1.3Mohm, in series with an 10k voltage 5 volts
Title: Re: ldr pre-process
Post by: Sunjaman on Mar 23, 2014, 08:52 pm
anyone?
Title: Re: ldr pre-process
Post by: larryd on Mar 23, 2014, 08:54 pm
In that configuration, your input to an analog input will be .5 to almost 5 volts.
You don't want to use an Arduino analog i/p and you want to do it using passive components.
I cannot help you here.
Title: Re: ldr pre-process
Post by: TomGeorge on Mar 24, 2014, 09:52 am
Hi, you will have to build some hardware to do the job.
OpAmp will help, but first what do you want out of the comparison.
The arduino analog is only positive  0 to +5V.
A standard differential amplifier will when you compare your two LDR outputs.
If LDR1 is Higher than LDR2 you get a positive voltage out.
If LDR2 is Higher than LDR1 you get a NEGATIVE voltage out.
It can be level shifted so that 2.5V is zero difference, above 2.5V is positive and below 2.5V is negative.
The trick is to do it with a single power supply rather than a balance pos/neg supply.

Tom....... :)