Go Down

### Topic: Using a PhotoSensor as a variable resistor on opposite day (Read 1 time)previous topic - next topic

#### psharma

##### May 10, 2011, 09:07 pm
Hi, I am using a photosensor as a variable resistor to vary the current according to light levels in my project. I am stumped on two problems and I was hoping a kind genius could help me out

1- I need to adjust the values to a much smaller range. According to my multimeter the photosensor has a resistance range from 200 Ohms (light) to 10K Ohms (dark), but I need a range of about 5-50 Ohms. Any quick and dirty way to tweak these values w/o hooking up 40 of these in parallel?

2- I would like to reverse the effect of the photosensor. So instead of increasing resistance with decreasing light, the resistance would decrease with decreasing light.

Any tips would be greatly appreciated!

#### cr0sh

#1
##### May 10, 2011, 09:16 pm
for item 1, you could try putting a resistor in parallel with the photoresistor.

for item 2, you can't do anything about that, I don't think - photoresistors don't work that way. What you can do, though, is invert the measurement with some math in your code; it will lead to the same result.
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

#### AWOL

#2
##### May 10, 2011, 09:17 pm
Normally, resistance isn't so important, it is what it does to a potential divider.
The inversion part is simple - put it in a different leg of a potential divider - but why do you think you need such a low resistance?
Can you tell us what you are trying to do?
What is the sensor?
An LDR?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

#3
##### May 10, 2011, 09:34 pm
Wire it in series with another resistor, amplify the juntion with an op amp into an analog port.

For example with 5V source and 10K in series, you would get output of (200/10K+200)*5 on low end, up to (10K/10K+10K)*5V on the highend. Multiply by 2 to get full 5V range readings out it.
Can't get the full compression you want, but can get a bunch.
Then map the 0-1023 readings into what you need.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### psharma

#4
##### May 10, 2011, 11:07 pm
I am actuating some muscle wire. The wire contracts more with more current, causing more movement in my installation. The current range I am going for is 0 to 200mA. I am using an oscillator circuit (with capacitor and 555 timer). The current is already oscillating but what I am trying to do is vary the peak current within that oscillation. For now, I want to vary the current w/o manipulating the sensor data in the code. So I am kind of just using the Arduino as a power supply right now (sorry Arduino!) This will change later but its what I need to do at this stage of the project.

The photosensor is acting as a variable resistor that regulates the current flow to the muscle wire. see circuit diagram attached.
5-50 Ohms gives me the 0-200mA current range I need. (I checked using regular resistors and a multimeter). But the photosensor is actually giving me 200-10K Ohms of resistance.

If I remapped the values using code in Arduino, what kind of output could I have? Could I specify a particular current output in a digital out pin?

Go Up