Pages: [1]   Go Down
Author Topic: advice on wiring a photoresistor please  (Read 1221 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I'm pretty new in electronics (decades of experience in computing, but close to 0 in electronics, this has to change!).

I read this page which does not say much: http://www.libelium.com/squidbee/index.php?title=Adding_a_light_sensor

Why is there a 1K resistor in it?

Why is it a 1K resistor and not a different one?

Why is the resistor at the top and the sensor at the bottom and not the other way around?

I must be missing some basic knowledge, please help me.

I hope I can help others when I get better. For now I'll browse this forum for computing questions I can answer
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2350
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset



the 1k resistor is to simply limit the current, the LDR (Light Diode Resistor) is also acting as a resistor, the difference is, the 1k resistor will always be 1k, while the LDR can vary from a few Ohms in bright light or a 100K - into the Millions depending on the manufacturer.

As the LDR gets less light (more resistance), the more of a voltage drop across the LDR (higher the analog in read value to the Arduino).

swap the 1k and LDR around, and you'll have the opposite happens... (in an analog circuit, you'd have it go to a transistor to switch an LED on, in which case swapping around would simply mean having the transistor switch on with a LOW light level or the other way round, have the transistor switch on when it's Bright.

Ohms law will explain this.
« Last Edit: November 04, 2012, 03:41:17 am by cjdelphi » Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2350
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.kpsec.freeuk.com/trancirc.htm

if you look at the attached image, you can see how swapping the LDR around you can get 2 different things happening "on when dark" or "on when Light"


* LDRReistor.png (329.52 KB, 1920x1080 - viewed 33 times.)
Logged

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

Thanks cjdelphi, it's slowly becoming clearer.

So if I did the setup in http://www.libelium.com/squidbee/index.php?title=Adding_a_light_sensor without the Arduino (just a 5 volts + and a 5 volts - taken from an old power adapter I hacked).
How would I connect it, and where would I put my volt-meter to witness the change in voltage?

I'm guessing +5V would be my +5v of the power adapter.
And I would connect the volt-meter to it too.
Gnd would be my -5 volts of the power adapter.
And the one marked "to an analog input would be connected to the volt-meter's other cable.
Correct?

I'm trying to see how I would check that things work before connecting the Arduino. I'm trying to define my work methodology as you can see!
« Last Edit: November 04, 2012, 04:01:52 am by 16pide » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33296
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm guessing +5V would be my +5v of the power adapter.
And I would connect the volt-meter to it too.
Gnd would be my -5 volts of the power adapter.
And the one marked "to an analog input would be connected to the volt-meter's other cable.
Correct?
Yes  smiley

However better to connect your volt meter to ground with the other end of it to the junction of the LDR and resistor.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 65
Posts: 2446
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So if I did the setup in http://www.libelium.com/squidbee/index.php?title=Adding_a_light_sensor without the Arduino (just a 5 volts + and a 5 volts - taken from an old power adapter I hacked).
What is the hacked power adapter as the 5 volt - may be -5V and not GND
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33296
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A lot of beginners confuse the output of a supply by thinking if it is a 5V supply and it is marked + and - then one is +5V and the other is -5V, it seldom is.
However to test this connect the volt meter across the supply and if it reads 10V then you do have a +5V and -5V supply but this is unlikely. If it reads just 5V then you are safe to go ahead as planned.
Logged

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

thanks
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 158
Posts: 2879
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What people were actually describing, including the original link, and without specifically calling
that, was a "voltage divider". Look at the "Resistive divider" section,

http://en.wikipedia.org/wiki/Voltage_divider

The fixed resistor value is normally chosen so the voltage swing will be centered around some
nominal value, such as the voltage divider output at normal room illumination.

Logged

Pages: [1]   Go Up
Jump to: