Pages: [1]   Go Down
Author Topic: Relay curcuit not switching on  (Read 2379 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi everyone,
I am new to the arduino world. I want to make a simple relay switch that sits ontop of a cord connected to my wall (220V).
I want it, on my command using arduino, to turn on and thus turn on a light.
I have a Compact fluorescent lamp as my light bulb (one of those energy saving lights.
My arduino is connected to my laptop via USB for power (I bought and am waiting for a 9V wall adapter)

The circuit i'm using is as shown in this site.
http://www.glacialwanderer.com/hobbyrobotics/?p=9

My circuit works fine until the relay (I checked and can see the diode site that is connected to the relay is getting 5V or 0V on my command using arduino, but for some reason the other side (i.e. the output of the relay) is always on 0...

Any suggestions on what I might try in order to get this working?
Thanks!
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 597
Posts: 33311
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If the relay is always on then perhaps the diode is wired the wrong way round. The line should point to the +5V.
Or you have wired up the normally closed contacts. Can you here the relay turn on and off?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The relay does NOT turn on (opposite to what you wrote that it stays on constantly)

I cannot hear the relay go on and off.
Logged

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 597
Posts: 33311
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If the relay is not on but your lamp is then you have used the normally closed contacts in place of the normally open ones.

You have also miss wired the transistor if the relay is not coming on and off, or you have forgotten to set that pin as an output in the setup function.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I apologize as I think I have not explained it clearly.

The lamp is off constantly.
the whole circuit, up to the part where the relay connects (the 2 relay pins that are parallel to the diode in the site i posted in my first post) get 5V or 0 on my command (using the arduino lol)

so what i was trying to explain is that my circuit works fine, but for some reason the relay does not turn on and off, it is off constantly...

thanks again for the help
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 44
Posts: 1508
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you show a photo of your setup ?
One that shows all components and what wires go where.
Could be all kinds of things causing your problem.
Also please tell us what relay you are using (what is written on it, or also a photo of the text on it).
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 597
Posts: 33311
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
so what i was trying to explain is that my circuit works fine,
So what is the problem?
Quote
but for some reason the relay does not turn on and off
Then the circuit is not working fine. What makes you think it is working fine?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@ MAS 3
I have 2 setups, with 2 different relays.
As of now I took the cord which runs on the relay off, but of course when i was testing it was connected.

3 images are attached:
     1 (blue relay) is simpler and connected to a breadboard (soldered)
     1 (relay not seen) is the same and connects to the relay in image 3. This does not use a breadboard as i thought i might have had an issue with the soldering (I don't)
     1 image of the 2nd relay - gray relay

@Grumpy_Mike

What I mean the circuit is working is that until the relay (if you look at the gray relay picture i am referring to the point where the wires connect to it in the image), I can control the 5V or 0V making its way there on command.
Thanks


* 1.JPG (3192.27 KB, 3264x2448 - viewed 30 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and the other 2 images....  smiley-roll


* 2.JPG (3076.74 KB, 3264x2448 - viewed 21 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

last one...


* 3.JPG (3087.82 KB, 3264x2448 - viewed 19 times.)
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 44
Posts: 1508
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Some more questions.
Is the transistor a 2n2222 as mentioned in the link you supplied ?
I can't see what relay you used in the first pic (the blue one), so can't tell you anything about that and will ignore it for the rest of this reply.

Make a measurement on your diode, the side that does not have the line and the other measuring pin at 0 volt.
Measure voltage.
At the moment the relay should be off, you should measure close to 5 volts there.
At the moment the relay should be on, you should measure 0.6 volts.
Tell us what you measure in both states please.

The second relay is a solid state relay.
It does not click and you cannot feel it switching when you touch it during switching.
It has a LED on it, so you can see that lighting up when the relay is supposed to switch.

You can check the blue relay to see if you connected it correctly.
Measure Ohms across the used pins.
You should measure something between 200 and 1500 Ohms or so.
Also check whether it is to be polarised, so if it has a + and - side at the coil.
Most of the times you can see that on the top of it.


So after writing all of this, i decided i'd check again assuming the transistor you used is indeed a 2N2222.
Looked up (Googling) where Collector, Base and Emittor are.
Looking towards the flat side of that transistor, holding the pins downwards, they are at C B E.
You have the red wire connected to + at the solid state relay, and at the Emittor.
This cannot be correct.
The green wire is at the 0 volts of the relay, at the Cathode of the diode and at an orange wire going nowhere (i'll assume it would go to either 5 volts or 0 volts) .
This is also incorrect.
There is also a yellow wire going somewhere unknown, and connected to the collector.
The diode is not neccesary when using a solid state relay, but if you still want to use it, connect it directly to that relay's screw terminal.
Connect the Cathode (the side with the line) to + and the Anode to - (this would suggest it is "upside down", but is exactly what it is supposed to do in this case).
Check the drawing in the link you posted for this.
You can also see that the + side of the relay is supposed to be directly connected to + 5 volts.
The - side is to be connected to the Collector of your transistor.
And the Emittor is to be directly connected to 0 volts.

Short: Your transistor is probably upside down, and so are your relay and diode.

Tip:
Print the photo from your link.
Use colored crayons or so to mark each different line, corresponding to the colors you have available in your jumper wires.
So now each connection should be in its own color.
You need 4 colors, not counting the connection to your Arduino.
Mark each connection once you connected it.

You might think this is a bit of a childish approach, but it makes it very clear and easy to keep everything in track.

Recheck everything i told you here as it is 3:34 AM over here, and i might have missed something or assumed too much.


[Edit]Typo's[/edit]
« Last Edit: December 25, 2012, 09:45:58 pm by MAS3 » Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

WOW! Finally (1/2 of it works)

Solid state circuit - you were right, I had the green and red wires going to the + and - wrong. switched it and now the led finally turns on, and the lamp works on my command!!

the n2222 circuit still doesn't work. I haven't changed anything. I hear it clicking when the relay turns on and off. I checked resistance on all the top 3 pin pairs of the relay (when the circuit is not connected to anything) and they were all infinite.

also measured the diode, the side that does not have the line and the other measuring pin at 0 volt.
Measured voltage.
At the moment the relay should be off, you should measure close to 5 volts there. - I measured close to zero.
At the moment the relay should be on, you should measure 0.6 volts. - I measured close to 5V

I verified again, the actual circuit up to the blue relay are the same in both circuits

Thanks again for your help, hopefully we can figure this one out as well...
Logged

The Netherlands
Offline Offline
Edison Member
*
Karma: 44
Posts: 1508
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote from: yoavac
the lamp works on my command!!

How do you command it then ?

Quote from: yoavac
the n2222 circuit still doesn't work. I haven't changed anything.
also measured the diode, the side that does not have the line and the other measuring pin at 0 volt.
Measured voltage.
At the moment the relay should be off, you should measure close to 5 volts there. - I measured close to zero.
At the moment the relay should be on, you should measure 0.6 volts. - I measured close to 5V

Ok, i Googled again and downloaded a Fairchild datasheet (instead of just a quick look at some pictures like i did yesterday).
The 2N2222 is E B C so not what i said yesterday, sorry for that.
So the yellow wire should be connected to 0 volts.
The red wire in the picture should be connected to - of your solid state relay.
The green wire in the picture should be connected to +5 volts.
Leave the other end of the diode (orange wire) disconnected.
Remember that these observations are to the pictures you posted, and might be different to what you have at this moment as you have done some changes since.

Do the same measurements, measure at 0 volts (black measuring pin) and relay - (red measuring pin).
Again, you should see relay off = 5 volts, on = 0.6 volts.
Logged

Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

Pages: [1]   Go Up
Jump to: