5V relay attached to LDR system

Hi folks,

Sorry for any confusion as I'm a complete neophyte at this but I need so help. So I have a functioning LDR system hooked up to my arduino using this sketch http://www.johnboucha.com/arduino-photoresistor/ I've reversed the code so the led turns on when Light is sensed, I want to then wire a relay off of the LED to a 9v battery and a small bulb via some alligator clips, I had it working fine yesterday but I took it apart and tried it again to no avail, The LED on the relay is on and the relay is clicking when light is sensed but nowhere near as loud as yesterday and obviously the small bulb is not turning on.

Again, sorry for any confusion as Im new to this but thanks in advance for any suggestions.

Best regards,

B

can you draw a simple sketch of the way you have it now ?
scan, take a picture whatever and post it.

sounds like you have swapped power and ground.

power goes to the relay coil
then from the coil to the transistor
then to ground.

you need to use a resistor between your arduino pin and the transistor.

and use a diode, installed in reverse, across the coil on the relay

this is what Im working with, how could I have got it to work the first time with only the things pictured? sorry again for the confusion :slight_smile: but I really appreciate the help.

b

battery was charged then ?

yes sir

Hi,
What is the voltage on the 9V rechargeable now?
Do you have a DMM?

Your picture does not show the complete circuit for the light and battery.
Where are the wires going to off screen?

Tom.... :slight_smile:

This is a finalized schematic of my creation in a "fritzing" format, Thanks in advance for the help...

if you burn out that LED connectted to the 9v, you can add a resistore to the new one,.

go ahead and order a new UNO straight away.
feeding power from the Arduino power pin will burn our your unit pretty quickly. the good news is that often you only loose part of the board. most people connedt the relay to an external pwoer supply, like a phone charger.

the other reason to order a new UNO is to get one that pin 10 does not get stressed.

in your case, the relay is probalby an e-bay special with a opto-isolator on it. this works exactly like an LED. you have to put in a resistor to limit current through the OPTO to a max of 20mA for the LED. some relay boards have that.... dome don't.

on the whole, you are off to a good start. once you get past these few hick-ups...
well, you will find other ways to burn up your stuff.

to reviewe :
#1) 9v LED HAS to have a resistor
#2) relay board HAS to be powered from a power supply, and NOT from the Arduino
#3) relay signal should have a resistor.

lastly, check your voltage on the 9v. batteries fail and you may not know straight away.