Let's Make Robots!

combined analog input

Ahoy me hearties!

I'm working on a bot that will have a lot of sensor requirements. It must be able to sense objects both at the top and the bottom of the frame. Since I don't want to have to keep track of 8+ sensors, I was hoping to combine some of the sensor inputs.

For example, the bot will react the same to an object sensed at the bottom as one at the top, can I combine them?

Will this schematic work? And if so, will the adc reading be a sum of both sensors, or merely the highest one?

ldr.gif

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

in theory yours should work but you have to account for how restince is calculated series and paralell

(i love my basic electronics)

 i believe you would have to hook them up in series for it to work right....becaus LDR1 + LDR2 = TLDR right now its looking like

1/TLDR = 1/LDR1 + 1/LDR        to put it simply if you have 2 ldrs reading 100ohms  if you use this parrallel you get 50ohms

if you hook them up in series you get 200ohms lets say one reads 100ohms and the other 50ohms because of an object  in parralell it youd give you 33 ohms in seriesyou would have a readying of 150ohms 

you should get better reading in series 

 

it makes sense in my head 

 

 

try this post this setup should work for you

I know this is not exactly what you are asking for, but it is another  way to combine two LDR's. You could use two LDR's in a voltage divider way (substitute the normal resistor for a second LDR) like the leftmost part of your schematics, before the diode. If the light on the resistors are equal, you will get half the voltage supplied (2.5 V for a 5V supply). If the light is different, the measured voltage will either rise or fall, depending on the resistance of the LDR's.

as a non-electrician, let me say "SWEET."

thanks for your input, fellas. I suppose I could try the circuit myself before asking about it, but what usually happens is that after 1.5 hours of trying, it doesn't work, and I end up asking wWHY NOT instead of IF. So thanks for your time-saving, informative advice.

and who doesn't want to try monster-truck style? 

And see for yourself: you will read the highest voltage of the two. That means (in this circuit) that you're measuring the LDR with the most light on it.

If you want to measure the nearest obstacle and your robot is shining a light on obstacles, then you're reading the nearest object.

If you are looking for the darkest part in the surroundings, try swapping LDRs with Rs.

To be sure hook it up and see how it works. I would prefer to use both reading and if the object is short (the lower sensor says TOO CLOSE while the higher sensor says the object is far away) use tracks to drive over it monster truck style.