Go Down

Topic: ARDUINO UNO, RELAY AND LIGHT BULB (Read 6222 times) previous topic - next topic

I have successfully connected and the relay, resistor , transistor and diode to the arduino, i used the LED program to trigger the 5 V relay. I have problems with the light bulb however. I stripped the extension a i have tried connecting it the way I'm showing on the picture. I have no idea what am I doing wrong. This is what I'm following:
http://www.glacialwanderer.com/hobbyrobotics/?p=9
I'm unsure about the wires, my relay doesn't seem to activate the light...please help, and see attached pictures

floresta

#1
Oct 02, 2012, 03:59 am Last Edit: Oct 02, 2012, 04:03 am by floresta Reason: 1
Sorry - I can't resist....
"I have no idea what am I doing wrong."

Make sure that your life insurance is paid up.  Better yet, you really should start by controlling an LED or a low voltage lamp before you deal with a 120 V load.  You might also consider using the pricy but much safer 'Powerswitch tail' (http://www.adafruit.com/products/268).

The next best option would be to use a solid state relay in place of most of your components.

Otherwise ...
The relay terminal connections in your upper pair of diagrams do not agree with one another although either will work.  In the top half you have the common 'C' terminal connected to the light bulb and in the lower half you have it connected to the AC supply.  By the way, this is the lower right terminal in your third diagram, the one you have incorrectly shown with a 'ground' symbol.  In the top half you have the normally open 'NO' terminal connected to the AC supply and in the lower half you have it connected to the light bulb.  This is the terminal with the red check mark in the third diagram.

Get the lower part of your upper diagram working - that is get the relay to control the light.  If you connect 5V between the connections labeled 'Pin 12' and 'GND' the lamp should light up.

Now add the other parts to implement the upper part of the upper diagram.  Don't overlook the fact that the battery needs to have it's upper end connected to GND.  When you connect the terminal labeled 'I/O pin' to the +5 Volt end of the battery the relay should energize and turn the light on.

Now you can connect the Arduino.


Don

[Edit] I just noticed that this really belongs in the 'General Electronics' section of the forum, perhaps a moderator can move it.

Thank you Don. I have tried the LED, works fine. I need to make the lights work, and I know the first picture does not agree with the relay below, it was for reference. I am building the circuit shown on http://www.glacialwanderer.com/hobbyrobotics/?p=9, with the relay shown on my picture. And I am taking precautions, thanks for your observations. I need this to work, is for a project in school. After it does, I'll put it in a box with the powerswitch tail you suggested, I actually have one, but that is going to be used after the whole thing is in a box.

That's why I need suggestions for it to work.

dhenry

Quote
I have no idea what am I doing wrong.


Your wiring is so simple that if you did follow it you would have reported a success.

I do agree with the other poster that you probably want to think twice before proceeding with this.

dannable

Any possibility you could post a photo showing how you have wired it up? And perhaps your code? Not a link to the project you are following, but the code you are using.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

floresta

Quote
I have tried the LED, works fine.

Please explain this in a little more detail.  If you were able to control the LED with your relay then you should also be able to control the lightbulb.

Don

I know all that!!!! I know the wiring is simple and I also know that if I was able to make the LED work, the lightbulb should work too. I came here for help because it doesn't work!

This is my first part. Coil is in the front. Like I circled on the picture, I'm trying to connect the lightbulb on the other side.

int outPin = 13;

And this is the program I'm using to toggle relay. Like I said, it works as far as activating the coil. I'll worry about a more complex program later after my lightbulb works.


void setup()
{
     pinMode(outPin, OUTPUT);
}

void loop()
{
     digitalWrite(outPin, HIGH);
     delay(10000);
     digitalWrite(outPin, LOW);
     delay(10000);
}

floresta

To test this with an LED you can connect a 220 ohm resistor (more or less) between +5V and the LED anode.  Connect the LED cathode to the relay terminal that you have marked with a check.  Connect the relay terminal that you have marked with a GND symbol to the GND end of the 5V supply.

Don

Go Up