Pages: [1]   Go Down
Author Topic: LDR  (Read 1739 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
LDR
 Bigger Bigger  Smaller Smaller  Reset Reset

hi guys...
i put together a LDR using the potetial divider circuit(see this link http://www.doctronics.co.uk/ldr_sensors.htm#circuit%203 ) and i am using arduino to read the values of LDR. i am getting values like 800 wen bright light is shown and around 300 wen light is off... wat basically r these values??? is it the p.d across the ldr??? and in wat format is it showing (like the 800 range)?? is it ascii?? wat do need to do to get say p.d in volts and to print it to serial port the same value say which i will get if i connect a multimeter across it ends?? (ie. say x volts...)
can someone please help me with this???
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your using one of the analog pins? if so, analogRead gives values from 0 to 1024. 0 equals 0V, 1024 equals 5V.

So ...

800 is 3.9v
300 is 1.46v

= )

Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yup i use analog pins... thanx 4 that info mate... smiley
is 1024 for 5V only?? or if i give a 9V input , 1024 implies 9V?? :-?
Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yup = )
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You don't want to put 9v directly on the pin, the maximum is 5 volts for a board that is running on 5 volts! If you want to measure 9v you would use a voltage divider.  The value you read will always be 5v divided by 1024 but  if using a divider ( say with  two equal value resistors to divide the voltage in half) 1024 would equal 10 volts.  A search on voltage divider should yield more info on this

(John I think you need your morning coffee  smiley-wink )
« Last Edit: November 07, 2008, 06:41:15 am by mem » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hey sorry, but i didnt understand.... :-[
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[glow]>you don't want to put 9v directly on the pin[/glow]
This means don't connect 9 volts to any arduino digital or analog input pin

[glow]>the maximum is 5 volts for a board that is running on 5 volts![/glow]
The maximum voltage you should connect to these pins is the voltage powering the controller chip  (usually 5 volts)

[glow]>If you want to measure 9v you would use a voltage divider. /glow]
If you use a voltage divider to divide the voltage in half (using two equal value resistors) then the maximum value from analogRead will actually be 10 volts ( you get 5 volts on the pin because you have given 10 volts into the voltage divider and that has divided the voltage in half)

[glow]A search on voltage divider should yield more info on this [/glow]

I hope that (and a read on some of the hits from google ) will help.
Here is one of the threads where this has been discussed: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226005458

Have fun !
« Last Edit: November 07, 2008, 11:35:23 am by mem » Logged

0
Offline Offline
God Member
*****
Karma: 0
Posts: 731
skcor oniudrA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

lol I still have sleep in my eyes and the nuke is busy churning out the coffee = )
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
>you don't want to put 9v directly on the pin
This means don't connect 9 volts to any arduino digital or analog input pin

>the maximum is 5 volts for a board that is running on 5 volts!
The maximum voltage you should connect to these pins is the voltage powering the controller chip  (usually 5 volts)

>If you want to measure 9v you would use a voltage divider.  
The method called a voltage divider is used to measure more than 5 volts


>The value you read will always be 5v divided by 1024 but  if using a divider ( say with  two equal value resistors to divide the voltage in half) 1024 would equal 10 volts.
If you use a voltage divider to divide the voltage in half (using two equal value resistors) then the maximum value from analogRead will actually be 10 volts ( you get 5 volts on the pin because you have given 10 volts into the voltage divider and that has divided the voltage in half)

thanx mate understood... except 4 the first part...
you don't want to put 9v directly on the pin

i got a 9V pin i audrino board so i can take a 9v output rite??
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
i got a 9V pin i audrino board so i can take a 9v output rite??


I am not sure I understand your question. These comments above refer to the data input and output pins.

The only pin you can put 9 volts onto is the power input pin. This voltage is fed into a voltage regulator which on most boards provides the chip with 5 volts.  The voltage on the input pins must not be higher than 5 volts.

 If something is still not clear, perhaps try and re-phrase your question.
« Last Edit: November 08, 2008, 10:20:11 am by mem » Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.mediafire.com/imageview.php?quickkey=xjdts4ismzd&thumb=5
plz see this
i meant the power pin i can take a output of 9V 4m that rite???
« Last Edit: November 08, 2008, 11:08:05 am by dev_000 » Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 Yes, the 9v pin can take positive nine volts. But you must not connect that voltage to any other pin on the arduino board. If you want to measure this voltage using the arduino analogRead, you must reduce the voltage (for example by two resistors connected as a voltage divider) so it is not higher than 5 volts when connected to one of the analog pins.
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 235
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

k now understood... 8-)
sorry for the trouble.... smiley
« Last Edit: November 08, 2008, 12:26:25 pm by dev_000 » Logged

Pages: [1]   Go Up
Jump to: