relay

Thread Starter

RoboToy

Joined Jul 28, 2010
4
I use HFD27/005-S relay dpdt device that work with 5 volt and minimum 40 mili amper
I want to turn on this relay with PIC18F the leg of the relay need to receive 5 volt for "1" logy
The problem is that the PIC can out maximum 25 mili amper and this is give that "1" logy is 3 volt and not 5 volt
I search after solution for this problem
 

tom66

Joined May 9, 2009
2,595
Use an NPN transistor on the output. Do you know how to make an open collector output? You must already have a 5V supply for this relay to work. It *may* work just about at 3V but you risk it not closing sometimes. Also, don't forget your flyback/catch diodes.
 

tom66

Joined May 9, 2009
2,595
Is this homework??

The transistor acts as a switch. The coil is either conducting current or not, which turns the relay on and off.
 

BillB3857

Joined Feb 28, 2009
2,570
You will also need a flyback diode across the relay coil. I omitted this for clarity.
Now you are really confusing the issue!













(For the noobe, the Flyback Diode protects the transistor from the inductive kick when the relay is de-energized.)
 

tom66

Joined May 9, 2009
2,595
I was only demonstrating controlling a relay, which is what he wanted. The diode would be a 1N4148 or 1N400x series across the relay coil.

What comments do you want, RoboToy??
 

BMorse

Joined Sep 26, 2009
2,675
It is usually best to include a whole circuit and explain each function of the components especially for noob's.... can not hold someones hand half way across then let go :(



@RoBoToy:

This is a typical circuit on how to control a relay with a pic output... you can not drive the relay directly from the pic pin, this could damage the pic, you should always use a transistor such as the 2n3904 to turn on the low current relays, the 1N4148 diode across the coil of the relay will snub out any back EMF(electro magnetic field) when the relay is turned off, this will protect the diode and the rest of the circuit from getting big current spikes.... the 330 ohm resistor between the pic pin and the transistor base prevents the transistor from damaging the pic pin from drawing too much current, and prevents the transistor from getting saturated which could cause it to over heat, and possibly get burned out quick...
pic Relay Control.png

B. Morse
 
Last edited:
Top