Loading...
Pages: [1]   Go Down
Author Topic: Read voltage drop from photoresister without a second resistor?  (Read 295 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am  starting to play with my Arduino Uno and have a question about hooking a photoresistor to my Uno. Most tutorials connect the photoresistor like this using a second resistor:

Code:
+5V --> PhotoResistor --> . --> 10K --> Ground
                          |
                        Pin X
 

I think this technique is called a "voltage divider" and I understand how it can be used to read the variable voltage drop that occurs from the PhotoResistor.

My question is why can't I just measure the drop without the 10K resistor? In other words, would the following work (where we read the voltage drop from Pin X)?

Code:
+5V --> PhotoResistor --> . --> Ground
                          |
                        Pin X

Thanks a lot!
Logged

Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Because if the photoresistor goes to 0 ohms, you'll have a dead short across your 5v to 0v....
Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks! That makes sense.
Logged

Denmark
Offline Offline
God Member
*****
Karma: 19
Posts: 683
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also pin x is connected to ground, so your reading will allways be zero
Logged

Mayne Island, BC, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 28
PICs, Arduinos and Pi, Oh My!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Remember the path to the answer is always the path of least resistance!
Logged

Don't breath in the magic smoke!

Montreal
Offline Offline
Edison Member
*
Karma: 16
Posts: 2209
Per aspera ad astra.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What, don't have a resistor? Use a cap in voltage divider, here is tutorial:
http://learn.adafruit.com/photocells/using-a-photocell
Logged


Johannesburg UTC+2
Offline Offline
Edison Member
*
Karma: 34
Posts: 1705
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also pin x is connected to ground, so your reading will allways be zero

Oh, yeah..... that too. I forgot about that bit.  smiley-red
« Last Edit: January 17, 2013, 09:45:48 pm by JimboZA » Logged

IT Crowd:
Roy... "Have you tried turning it off and on again?"
Moss.. "Have you tried forcing an unexpected reboot?"

United Kingdom
Offline Offline
Faraday Member
**
Karma: 131
Posts: 4675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can manage without the second resistor. Connect the photoresistor between the analog input pin and ground, and make a pinMode call to enable the internal pullup resistor by setting pin mode INPUT_PULLUP (or by writing a HIGH to the pin while leaving it set as an input).
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. http://www.eschertech.com

Offline Offline
Edison Member
*
Karma: 114
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are many ways to do it: you can use the internal pull-up; you can read it via a capacitor; or an inductor, or a diode, or a current source, etc.

Logged

Pages: [1]   Go Up
Print
 
Jump to: