Relay Problem

Hi everynone!
Long time no see!

My problem today is quite troublesome :-[

I've made a complete system handly a 3x4 keypad to drive a 5V relay when correct combination is entered+piezo and some more stuff.

Problem is;
When I played with my relay before,they worked perfectly!
Now they can't even activate when the output pin goes up.
I got a LED working fine on that same exact pin.
Also checked the voltage using a resistor from that pin to ground and I get 4.7V wich is enough for the relay but still he ain't working.
WhenI plug it in,the voltage I read is basicly 0. (I'd like to say once again; it was working before (before mean alone,relay only with nothing else)and now it's not(keypad is wired and a piezo,both are off while the relay should activate.

I tried using a transistor but my lack of skills in electronics showed me pretty quickly how bad I was :-/

Does anyone has a simple bit of explanation on what would cause that and how to fix it?

Also,
2 days ago I touched the chip by notlooking where I putted my fingers (FTDI chip) and the arduino pin13 started blinking non stop even after a reset and kept on going until I got a usb cable in to reload program and now it's fine,maybe I burnt something?

thanks
Jay

Problem is;
When I played with my relay before,they worked perfectly!

Have you tried hooking the relay directly up to the(a) power source? What happens? Be sure to only hook the relay up to a power source of the proper voltage. In other words, don't go hooking up a 5V relay to a 12V source to test it.

Now they can't even activate when the output pin goes up.
I got a LED working fine on that same exact pin.
Also checked the voltage using a resistor from that pin to ground and I get 4.7V wich is enough for the relay but still he ain't working

WhenI plug it in,the voltage I read is basicly 0. (I'd like to say once again; it was working before (before mean alone,relay only with nothing else)and now it's not(keypad is wired and a piezo,both are off while the relay should activate.

Hmm... That doesn't sound too good.

I tried using a transistor but my lack of skills in electronics showed me pretty quickly how bad I was :-/

If your relay could take more than 40ma when active then it might have damaged the output. If you can at all help it you want to use transistors for just about anything you hope to turn on/off with the arduino. I know, it might sound silly to go arduino -> transistor -> relay but it's for the best.

Does anyone has a simple bit of explanation on what would cause that and how to fix it?

Also, if you directly hooked up a relay to the output of the arduino and had no reverse bias diode then you must go directly to electrical engineer jail. Do not pass GO. Do not collect $200. Relays have a bad habit of having something I'd like to call "inductive kickback." You charge it up with 5V and when you quit giving it power it gets lonely and kicks you back at 100V for a couple of microseconds. It's bye bye output pin then.

Also,
2 days ago I touched the chip by notlooking where I putted my fingers (FTDI chip) and the arduino pin13 started blinking non stop even after a reset and kept on going until I got a usb cable in to reload program and now it's fine,maybe I burnt something?

Well it does not sound like you did it any favors but if you were able to save it afterwards then hopefully it'll last for a while yet. Sometimes you can damage things but not enough to totally fry it. Just enough to mess it up a bit and drastically shorten it's useful life. Things happen... That's why butterfingered people like me have 1. anti-static mats and straps 2. spares

To sum up this whole thing:

USE TRANSISTORS. If you don't know how then look it up. There's help all over the Internet. Or, if you've got some specific transistors laying around then tell us what they are and I or someone else will help you use what you have. Also, get properly rated diodes. They've got to be rated to take a reasonably large surge voltage (although with a diode in there the surge will never get anywhere near as bad as it would have been without) If you are running at 5V then 100V diodes would be fine. They're really easy to get.

The questions are

what are the voltage/current specs of the relay?
did your provide a 'bypass' or 'free-wheeling' diode across the relay coil?

Even so called 'sensitive' relays can draw over the rated current of an Arduino output pin (40 mA), damaging the output pin.
But the output could still function at a reduced capacity, like to drive an LED (20 mA?).

Also without a free-wheeling diode, the Arduino output could be subject to damaging high voltages.

Quickest way to tell would be to first to check the coil resistance. If it is less than 125 ohms, you need to drive it with a transistor.
If it is greater than 125 ohms, connect a free-wheeling diode across the coil, and try it again but use a different output pin.
If it works on the new pin, but fails to work on the original output pin, then yes your Arduino chip is damaged.

Wow thanks for such quick answering ^^

what are the voltage/current specs of the relay?
did your provide a 'bypass' or 'free-wheeling' diode across the relay coil?

I did had a free-wheeling bypass diode on but not the first time I used it(couple weeks ago) :-/

Specs of the Relay;
Omron G2R-1A-E
5VDC

16A250VAC
16A30VDC
Clear Case

http://www.omron.com/ecb/products/pry/121/g2r_1_e.html

Quickest way to tell would be to first to check the coil resistance

Resistance is 45ohm

I tried 2 pins and both got me same result.

I went to see an electromechanic teacher that told me to use a PN2222A transistor with a 1000k resistance on the output pin.He told me to plug the resistor other's end to midde pin(base),negative side of the relay on one side and ground to the other side(bypass diode included a always) stil I get some weird results,either the relay goes on forever a soon as I plug it or it never goes on....

I'm afraid I burnt my arduin :cry:
any thing else I need to know?
will this relay work on a brand new arduino nano?(with a bypas diode)

Resistance is 45ohm

Yeah... that's not good. 5V / 45 ohms = 111ma which is far in excess of the 40ma you are allowed to draw off of an arduino pin.

I went to see an electromechanic teacher that told me to use a PN2222A transistor with a 1000k resistance on the output pin.He told me to plug the resistor other's end to midde pin(base),negative side of the relay on one side and ground to the other side(bypass diode included a always) stil I get some weird results,either the relay goes on forever a soon as I plug it or it never goes on....

This teacher told you do... what now? ... I can't quite figure out what that's supposed to do. What you really want to do is hook up +5V from the power supply to the relay. Hook the base of the transistor up to an arduino pin with a 1K resistor in between. Hook the emitter up to ground. Hook the common up to the other side of the relay. Hook up your diode. Now when you give the transistor +5V output from the arduino it will take 5 / 1000 = 5ma. The gain of the transistor appears to be maybe about 60 at that point so your max load would be 60 * 5 = 300ma. That's over what you actually need so the transistor will be saturated which is what you want.

Wow.

I checked out the specs for the relay. The 5 volt DC version requires 106 mA... looks like your chip is fried. Thats over 5 times the current the Atmega is rated for.

Order a new bootloaded Atmega to replace the fried one (available from nkcelectronics.com or sparkfun.com, among others).

Then use a transistor rated for at least 150 mA to drive the relay.

ALWAYS BYPASS RELAY COILS WITH A FREE-WHEELING DIODE! It's a 5 cent solution to prevent damage to a $50 Arduino.

Yeah lol thanks,I'm never going to forget that ever =P

although,I made it work ^^

most of the pins are half-fried (good for logic but not driving stuff)
I got my transistor running the good way ^^
And found sma mitake I made ^^' didn't declre my pins a output (which was a problem for my pasword failed LED that didn't worked too good.)

So thanks to all and If you could learn only one thing from this post

ALWAYS USE A BYPASS DIODE AGAINST A RELAY!

thanks mr Rice^^