# LDR

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

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

= )

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

yup = )

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 )

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

>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)

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 !

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

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

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.

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

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.

k now understood... sorry for the trouble.... 