Pages: [1]   Go Down
Author Topic: Read voltage drop from photoresister without a second resistor?  (Read 563 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
Faraday Member
**
Karma: 60
Posts: 3242
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

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

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

Thanks! That makes sense.
Logged

Denmark
Offline Offline
Edison Member
*
Karma: 35
Posts: 1029
Happy Hobbyist
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
Jr. Member
**
Karma: 0
Posts: 67
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: 23
Posts: 2485
Per aspera ad astra.
View Profile
 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
Faraday Member
**
Karma: 60
Posts: 3242
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


* rif.jpg (2.82 KB, 260x194 - viewed 9 times.)
« Last Edit: January 17, 2013, 09:45:48 pm by JimboZA » Logged

Have you looked for answers in the Learning, Reference, Products and Playground tabs on http://arduino.cc/en/ ?
Look here http://electronicsclub.info/ for basic electronics

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
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. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Edison Member
*
Karma: 116
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
Jump to: