Need help with Relays not switching back.

Hey guys, im trying to interface my arduino with a 5v relay through a Transistor, my diagram is as follows:

Arduino Pin 13 --> 1k R --> Transistor Base
5v External Input --> Transistor Collector
Transistor Collector --> Relay Coil

the problem is, whenever i digitalWrite(13, HIGH) the Relay switches state fine, but once i write the pin LOW, it doesnt switch back to its original position,

however, if i disconnect any of the grounds, or even the arduino pin 13, it switches back to the original,

does anyone know how i can make it so that it switches back when i want it to?

thank you very much

Sorry i meant Transistor Emitter --> Relay Coil

:stuck_out_tongue:

Sorry but a drawing would be worth more then your description. For instance your description has no reference to anything going to ground. Current flow must start at ground and end up at a positive voltage source in your case, no matter what components you want to utilize.

Here is a typical relay circuit, does it match yours or your description?

Lefty

Im sorry, i forget :stuck_out_tongue:

yes, thats the drawing that ive been using for reference, i tried changin it up a little, but i still get the same results,

i just set up my board exactly like that,

but still, once the relay switches on, it never switches off until i physically disconnect one of the grounds,

any ideas?

bump,

how can i turn the relay back to the original position using the arduino?

What is the relay you are using, and the other parts? Maybe that has something to do with it.
Post a link to its datasheet.

Maybe you should post your code to make sure there isn't something wierd going on in your sketch. Also where are you getting the +5vdc from? where are you grounding the emitter lead to?
You said your using pin13. That also has a on-board led, is it not turning off just as your relay is not dropping out when you write the low to pin 13?

Lefty

If you are perhaps using a MOSFET instead of a transistor in the schematic you said you used, then this is typical behavior without a resistor to ground the gate so it doesn't float.

Hello Roddiy
perhaps you do not have a diode in antiparallel with the relay?
Look the circuit:
Txapuzas electrónicas: PaperRelé. Relé controlado por transistor PaperRelay - An homemade transistor drive for Relay (Spanish)

Greetings

That diode just removes the emf to it won't damage the transistor used to drive the relay

Sorry i meant Transistor Emitter --> Relay Coil

Did you mean that?

Anyway if you have the circuit as per that drawing there's no way it won't turn off if the Arduino pin is low.

We gotta see your code, and remember that some transistors have different pinouts so it's easy to put them in backwards.


Rob

Thanks a lot for the replies guys,

as for the answers:

The relay is a 5v relay from Radioshack( had to get one in a hurry), and im supplying it with an external power of 6v, the arduino doesnt give enough juice to power one of these,

its rated 5v nominal, 6.5v maximum, 58ohm +- 10% at the coils, ive triple checked all my wiring, everythings fine, the relay switches once, so idt its the wiring :confused:

yes, i have a diode to protect from emf,

the code is very simple, its the Blink sketch, and ive tried it with other pins, but still gives the same result :confused:

i dont have the base of the transistor grounded, what resistor should i use?

Transistor part number?

Radioshack MPS2222A, i looked up the datasheets, it looks very compatible with the 2N2222.

^^ NPN Transistor btw :slight_smile:

Again without a drawing of how you have it wired it's hard to see where you have gone wrong. Have you connecter the negitive side of the 6 volt external ground to the emitter lead AND to the Arduino ground pin? What size resistor are you using? See all these micro questions might not be required if we could we a drawing.

Lefty

My setup is configured exactly like this:

im using a 1k Resistor, although ive tried with 470 ohm and 2.2k and same thing :confused:

one interesting thing, is that if i put a really small transistor (180 ohm) it clicks back and forth, and with no transistor it clicks really fast,

with bigger transistors (> 2.2k ) it doesnt even click once.

maybe i should try using a Tip102 transistor?

Sure, try it.

and its an SPDT relay, could that be it?