Pages: [1]   Go Down
Author Topic: Using a PhotoSensor as a variable resistor on opposite day  (Read 671 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 2
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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!

Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5551
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 290
Posts: 25733
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

"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.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26378
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Newbie
*
Karma: 2
Posts: 12
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

* SMAcircuit.pdf (60.6 KB - downloaded 12 times.)
Logged

Pages: [1]   Go Up
Jump to: