Hi All,
It's not precisely an Arduino question, but I'm hoping you can help me. I'd like to connect 4 photoresistors to 4 analog inputs on the Arduino board. The schematic I'm using and a picture of the hardware setup is below. So I've got 5V into a 10K pot for bias adjustment, then it splits out to four 4.7K resistors, connects to the analog in, and passes through the photoresistor to reach ground. Here's the schematic:
And a picture:
The problem is that changing the value on one photoresistor also causes the others to change. I'd like to isolate them better. I could use larger resistors, but as the 5% tolerance becomes closer to the total resistance range of the photoresistor, I'm going to have problems with calibrating all of them equally. Any help? Maybe throw a diode in there somewhere?
I think the problem is that as the current through one photoresistor changes (since its resistance changes), the current goes through the 10k pot so changes the reference voltage for all of the photoresistors.
Try getting rid of that 10k pot and using a separate one for each photoresistor.
I agree that the common 10K pot is the problem, but I'd like to avoid having four pots each of which have to be individually configured. I'm making this device (it's a little theremin/synthesizer) for my sister, so I'd like to keep the control set simple.
Since I've put the LED/photoresistor combo inside the box, it's pretty stable. So I could maybe put internal screw-driven pots for each input, and implement the remaining calibration dynamically in software... but that's hardly an elegant solution. Any other ideas?
If your goal is to have a steady, but adjustable, voltage, going into your resistor array, use the pot in a voltage divider, then feed that voltage into an opamp (like half an LM358) wired as a unity-gain buffer. The opamp will compensate for the variations in current as the photoresistors change.
Turns out I had a 358, so I tried that with the circuit above, and it worked like a charm! Thanks for the help! The input levels are also much more stable, so I would recommend this for anyone who's trying to use a photoresistor input.
Only thing is, I was getting a swing of about 600, and now I'm only getting around 200. But I think by monkeying with the resistance values or the VREF reference voltage, I can get that range back, and keep the improved stability.
You're welcome. I suggested the 358 because my recollection is that the 741 requires both a + and - supply, while the 358 and its quad 324 brother are happy with just +5V.
If you want to restrict the range of adjustment, and get finer control, put fixed resistors above and/or below the pot. E.g., with a 10K pot and a 10K to ground, your range will be limited to 2.5-5V. With 10K above and below, it would be about 1.7-3.4V.
Also, be sure to tie off the unused opamp, so it doesn't turn into an oscillator. I usually wire it as a unity-gain buffer, and tie the + input to ground.