Relay Flyback diode placement

Dermotx

Member
I am driving a 500 ohm relay directly from leg 5 of a PIC 08. I am a little puzzled by the placement of the flyback diode for the relay. Is it in the correct position as shown in the attached pdf file?
Thanks in advance if you can help.

Regards

Dermot
 

Attachments

boriz

Senior Member
No. The diode should be across, in parallel with just the coil. And it should not conduct while the coil is on, so the Anode must be at the coils most negative terminal, and the Cathode (pointy end) at the coils most +ve terminal.
 

boriz

Senior Member
500R coil? At 5V that’s only 10mA. What kind of super efficient relay are you using? You sure it’s not designed for higher coil voltage? Also, the diode on the AXE pin can be removed, the other diode will protect the AXE. I’m assuming that that AXE 0V is connected to the same ground.
 

boriz

Senior Member
Also, 6V is a little high for an AXE. Put a silicon diode inline with the Vcc so that the AXE gets < 5.5V
 

hippy

Technical Support
Staff member
Assuming the PICAXE can drive the relay coil directly ...

Code:
+V ---------.-----.     .-----
            |     |     |
           _|_     )    O
           /_\     )   \
.-----.     |      )    O
|     |     |     |     |
|  Ox |-----^-----'     `-----
|     |
`-----'
Code:
.------.
|      |
|   Ox |----.-----.     .-----
|      |    |     |     |
`------'   _|_     )    O
           /_\     )   \
            |      )    O
            |     |     |
           _|_   _|_    `-----
The second (bottom) configuration would be most suitable for an output which is set low at power on and reset and is normally not activated.
 

Dermotx

Member
Thank you very much Boriz and Hippy.
I was afraid to send the induced back emf in the direction of leg 5 of the picaxe in case it would damage it. Would the diode that I have coming from leg 5 not be extra insurance in case the voltage spike from the coil damages the picaxe?
I presume a small signal diode like the IN4148 will suffice?

By the way the picaxe is powered from a 4.5V source which is not shown. The relay is a 5V, 500 ohm from Maplin. Here's the link:

http://www.maplin.co.uk/Module.aspx?ModuleNo=2605

Thanks again for the advice.

Regards
Dermot
 

westaust55

Moderator
Flyback / Freewheeling diodes

When the voltage is removed from a coil or inductor, the voltage does not change instantly but there is magnetic energy stored in the coil. With the removal of the power source the magnetic field collapses at very high rate of speed. This very fast varying magnetic field causes a reverse emf (volatge) in the coil. This reverse emf results in the situation where there is a large voltage relative to the supply voltage across the coil/inductor plus the supply voltage itself resulting in the device such as the PICAXE chip briefly being subject to a voltage several times the supply voltage.

The purpose of the Flyback or Freewheeling diode is to provide a path for the reverse voltage across the coil or inductor to be dissipated. So the diode is orientated to prevent current flow from the normal supply but to short the reverse voltage when the coil is de-energised thus preventing the voltage spike.

It is not usually needed to place another diode in series with the coil. For extra low voltage circuits (read 5V) the volt drop across the diode is about 14% of the supply voltage and such volt drop is best avoided whenever possible.
 
Last edited:

Ralpht

New Member
It works exactly as westaus55 stated.

To clarify what westaus meant regarding a diode in series with pin 5, or any IC pin for that matter, bear in mind that the diode will drop about 0.5V. The output of the 08 will not be the same as VCC but a bit lower, then factor in the drop by the diode and you could approach an output nearly 1 volt less than what you expected.

This may not be sufficient to reliably operate the relay.

It is always good practise to drive relays and other "high" current devices with a transistor. You'll have the advantage of the drive current being limited by the transistor not the IC. The drive voltage will also be closer to VCC.

You will then have more current available to drive the relay (you never know - one may blow and you may not be able to replace it with the same type, so have to substitute a relay with a greater current draw.) With a driver transistor, you may be able to substitue the relay with another different one without worrying about it's current rating. This is of course limited by the transistor Collector/Emitter current which, even in small transistors, can approach half an amp or more with adequate heatsinking.

As well, it is better in an accident to blow a cheap tranny than a more expensive IC.
 
Last edited:

Michael 2727

Senior Member
Back EMF Voltages from a coil or inductor can be as high as 10 X the
input voltage, but reverse in polarity.
A 1N4148 usually have a reverse rating of around 50V. Should be OK in your app.
Some Micro relays have a built in diode.

Diode across the Coil, Pointy end always to + POS,,,, easy to renember :)
 

inglewoodpete

Senior Member
Dermot,
Do you have the make/model details of the relay? If there is a 500ohm, 5v relay available, I for 1 would like to know about it.

-Peter
 

westaust55

Moderator
IWP,

What specifical details do you need such as contact rating, no of contacts etc?

have a look at Jaycar

CAT. NO. SY4030 5 VOLT SPST DIL REED RELAY with 500 Ohm coil

also CAT. NO. SY4036

then there are solid state relays:
CAT. NO. SY4088
CAT. NO. SY4092
 
Last edited:

inglewoodpete

Senior Member
WA55: Thanks for the info. I hadn't realised there were 10mA, 5v relays out there. I don't have any specific need at the moment.
 

Ralpht

New Member
WA55 - Thanks from me as well.

Just went to my local Jacar and bought a couple. The only 2 they had actually.

After some tests, Yep - an IC can drive it OK so far.

Guess I'm old school, but I feel more comfortable if something a bit beefier is actually supplying the current for the relay - even though the requirements are only 10mA.
I still wouldn't risk a uProcessor or IC to drive one of these. Too much to loose when it hits the fan.......
 

hippy

Technical Support
Staff member
10mA is under half what a PICAXE can deliver so I wouldn't have too much concern. In-rush current could be an issue so worth studying the datasheet or testing first.
 

Ralpht

New Member
You're quite correct Hippy,

Initial tests with a Sample & Hold meter showed in-rush to be approx 80mA but I was a bit hurried as I had other things to do.

I drove it from an '08M using a simple "blinker" program turning the relay on for one sec then off for one sec repeatedly. I'll get more technical when I have more time.

I'll be checking out any datasheets I can get hold off and do more bench testing this weekend.

Purely for interest sake - can't think of a use to put them to at the moment --Ohh wait yes I can.

Bugger - another project to go on the drawing board..... too many projects not enough time ....
 

boriz

Senior Member
Bugger!

I’m gonna have real difficulties soldering these little things. Especially with my tremor.

 

westaust55

Moderator
Soldering SMD IC's with conventional iron

For the few (About 8) SMD type IC's I have had to solder to date my method has been:
1. tin the PCB pads with solder
2. tin the IC legs with solder
3. align and hold the IC in place with a finger and "tack" solder one leg.
4. Check it is still positioned correctly
5. run the soldering iron over all legs on one side (opposite to "tacked" leg)
6. run soldering iron over all legs on the other side
7 check for any solder bridges
8. Use multimeter to ensure electrical contact

I do have a very thin tip on my soldering iron, but it is nothing fancy.
 

demonicpicaxeguy

Senior Member
magnifying glass (nice big one)
solder paste (or just tin pads)
heatgun on low setting (not a joke)
compressed air (for getting rid of heat quickly)
clean ic pins and board
enough said
 
Top