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?
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?
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?
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.
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
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
i dont have the base of the transistor grounded, what resistor should i use?
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.