Offline
Newbie
Karma: 0
Posts: 39
|
 |
« on: July 17, 2011, 08:50:58 am » |
Hi everyone,
I am testing the LDR recently, but I have no breadboard,(I found most project with LDR is done through a breadboard).
My question is, can I connect my LDR directly to my arduino, and to control the LED on my arduino (13)? If it can, how to connect?
Thank you.
Sarah
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6837
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #1 on: July 17, 2011, 12:03:43 pm » |
If the leads are long enough you could just poke them into the appropriate header holes. If not extend them with some wire soldered on.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 90
Posts: 9428
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #3 on: July 18, 2011, 07:02:43 am » |
TO connect an LDR correctly it must be part of a voltage divider
+5V ---- [ LDR ] -----* ------[Resistor] ----- GND
Connect analog port of Arduino to * in the middle The valueof resistor must be in the same order as the LDR when in the dark. (a 10 K will work probably too)
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #4 on: July 18, 2011, 02:11:35 pm » |
If the leads are long enough you could just poke them into the appropriate header holes. If not extend them with some wire soldered on.
______ Rob
Could you please tell me which leads should poke into which header holes?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #5 on: July 18, 2011, 02:13:44 pm » |
Thank you for your reply, but I don't want to use a breadboard, I want to know if I can connect them together without a breadboard?
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15318
Measurement changes behavior
|
 |
« Reply #6 on: July 18, 2011, 03:20:38 pm » |
Well as already drawn for you: TO connect an LDR correctly it must be part of a voltage divider
+5V ---- [ LDR ] -----* ------[Resistor] ----- GND So, one end of the LDR goes to a +5vdc pin, one end of the resistor goes to a ground pin. Now the problem, the other ends of both the LRD and resistor must connect to the analog input pin you are using. As usually two wires won't fit into one pin hole, and you don't want to use a breadboard, then you must solder the connection between the LRD and resistor and then add a single wire from that junction connection to the analog input pin. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #7 on: July 18, 2011, 03:42:32 pm » |
but I don't want to use a breadboard Good for you I hate those things, they are more trouble than they are worth. I always solder stuff up an a small piece of strip board. If you keep the wires long you can always use the components again. The thing to remember is that physically you can make the topological arrangement of components any way you like. What is important is that they are all connected electrically in the right way. You tell that from a schematic.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 39
|
 |
« Reply #8 on: July 21, 2011, 10:17:39 am » |
I have got a breadboard, but with no resistor, do I have to get one, why? Well as already drawn for you: TO connect an LDR correctly it must be part of a voltage divider
+5V ---- [ LDR ] -----* ------[Resistor] ----- GND So, one end of the LDR goes to a +5vdc pin, one end of the resistor goes to a ground pin. Now the problem, the other ends of both the LRD and resistor must connect to the analog input pin you are using. As usually two wires won't fit into one pin hole, and you don't want to use a breadboard, then you must solder the connection between the LRD and resistor and then add a single wire from that junction connection to the analog input pin. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Online
Tesla Member
Karma: 90
Posts: 9428
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #9 on: July 21, 2011, 10:31:04 am » |
I have got a breadboard, but with no resistor, do I have to get one, why? Yes, you have to, there should be a flow from + to GND and the Arduino measure the voltage drop. - http://en.wikipedia.org/wiki/Voltage_divider - If you connect the LDR to 5V and the other end to the Analog in the voltage will allways be 5 Volt as there is nothing that pulls it to GND level.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 73
Posts: 6837
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #10 on: July 21, 2011, 10:33:15 am » |
You have to form a voltage divider and take your reading from the centre (the * in the above drawing). Without two resistors (the LDR is just a special type of resistor) you are just pulling the Arduino pin low and so will always read a value of 0.
Now if for some reason you live in outer mongolia and can't get a resistor and just want to play to see what happens there are two ways to do this.
1) If you have a second LDR use that instead of the fixed resistor, as you light and shade either of the LDRs the reading will change. 2) Use the internal pullup resistor instead of the external resistor (I'm pretty sure this will work with an analogue input).
Both these methods will be very imprecise but will at least allow you to have a play.
Personally I'd just go and get a resistor.
______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #11 on: July 30, 2012, 11:30:26 pm » |
Does anybody can post a simple Fritzing wiring diagram. I think people will be able to better understand what you mean by creating a power divider and taking the input from the middle. Thanks a lot!
|
|
|
|
|
Logged
|
|
|
|
|
Belgium
Offline
Full Member
Karma: 0
Posts: 182
|
 |
« Reply #12 on: July 31, 2012, 03:48:14 am » |
+5V ---- [ LDR ] -----* ------[Resistor] ----- GND
it's not more than this :o maybe this is clearer (?) +5V [ wire ] [ LDR ] [ wire ] [ wire to analog in ] [ wire ] [ Resistor ] [wire] GND
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #13 on: July 31, 2012, 11:38:22 pm » |
Is that a proper connection for the LDR TinkerKit sensor? I think I am getting the right reads as they vary from 20 to about 900 when put under light bulb. Resistor shown is a 10k resistor. Thank you in advance.
|
|
|
|
|
Logged
|
|
|
|
|
Manchester (England England)
Offline
Brattain Member
Karma: 277
Posts: 25556
Solder is electric glue
|
 |
« Reply #14 on: August 01, 2012, 04:09:30 pm » |
Is that a proper connection for the LDR TinkerKit sensor? No, you don't need that resistor.
|
|
|
|
|
Logged
|
|
|
|
|
|