Relay directly?

jledger

New Member
I'm attempting to create an easy demonstration of the PICAXE, so I'm looking for as "straight forward" as possible.

I picked up a Reed Relay with the following specs:

Voltage 5VDC
Coil Resistance 250ohms
Contact rating 0.5 at 125VAC
Nominal Current 20mA

As I understand, the outputs of the PICAXE can handle anything directly up to 20mA. (Picaxe Beginners Check List: part2) Is it possible for simplicity's sake to connect this directly to the output pins using a 220ohm resistor for controlling other switched devices without frying my 18X?

Thanks
Jeff


 

womai

Senior Member
That should be possible, provided you take a few standard precautions:

- put in a reverse-biased diode across the relay coil to shunt out self-inductance spikes of the relay coil (they could fry your Picaxe output). See the Picaxe interfacing docs for details.

- note that while a single output is spec'd up to 20mA, the whole port (8 outputs) can only drive 100mA total (so be careful about the loading of the other 7 pins).

- If you want to be on the safe side, hook the relay to TWO outputs in parallel. That will halve the load on each of them. Make sure you switch them on and off exactly simultaneously (let pins = ....), not with "high pin1" "high pin2" which would mean about 1ms delay.

Wolfgang
 

ldnz

New Member
Have a look at picaxe_manual3, there is an example of a relay interfacing circuit. You may be able to get away without the transistor, but you will definitly need the back emf suppression diode or you will damage the picaxe when the relay opens.

Hope that helps,
Ben
 

jledger

New Member
I've had some success tonight understanding the following: http://www.picaxe.orcon.net.nz/npnamp.gif using an LED as my target. It appears that my NPN200's work fine for this application.

Can someone answer if my 1N914 / 1N4148 Switching diodes are enough protection for my project, or should I go shopping again?

Thanks,
Jeff
 

Michael 2727

Senior Member
Firstly if the coil in your reed relay ia as
you say 250 Ohm, at 5V it will only draw 20mA
If you add any extra resistance to this circuit
it will draw less than 20mA which may cause the
reed not to work due to a lack of power.
You <b>must </b> include a Diode if using
any coil device e.g. Relay, Motor, Solenoid.
You may get away with a 1N4148 but they are
not designed for this purpose as they have
a low PIV voltage and low current rating.
PIV = 75V from memory and 100mA current rated.
Back EMF voltages from a coil/motor/sol can easily develope 10 times the input voltage
or even more when the power is removed depending on the coil and other factors.
Better to use a 1N4001, 1N4004 or even 1N4007 if that's all you have available.
<b>Rule # 1 </b>
If you draw more than 20mA from <b>any </b> picaxe
output for whatever reason you may destroy
that output.

Edited by - Michael 2727 on 16/05/2006 08:03:16
 

Michael 2727

Senior Member
To give an example of this -
Get an old Coil type Buzzer that will run
on 3 to 6V.(DON'T USE A HIGHER VOLTAGE)
Connect it up and while running/buzzing touch
both sides of the contact points at once.
In the average person you will not usually
start to feel voltages through your skin until it reaches above 40 to 50 Volts.
Or you have very thin or wet skin.
This is Back EMF voltage at work and remember
it was only generated using 3 Volts.
If you are lucky enough to have an Oscilliscope, hook it up and see what you get.
Don't try this wearing a pacemaker or any other
similar devices if you have one.
 

Coyoteboy

Senior Member
We used to make fun electrocution circuits at school by taking relays and wiring the coil through the breaking pins to get a good oscillation going - could get a nasty zap off a 9v battery :)
 

bobrayner

Member
Be a little careful here. Some modern &quot;DIP&quot; style relays have the flywheel diode built in. If so it will probably have &quot;+ and -&quot; marked on the case or spec sheet and reverse connecting it will destroy the device.
Unfortunately with a relatively low resistance coil in parallel there is no easy way to measure the presence or not of a diode. reference to the spec sheet and/or case markings is the only way. If in doubt, observe any polarity markings and fit a diode anyway. It will do no harm.
cheers BobR
 

jledger

New Member
Thanks to the advice I have two reed relays running off 2N222 NPN transistors connected to the outputs using 1.5K resistors. Because I have a box of these transistors, I decided to attempt the project without the diodes to see if I could damage one. I've put an hour of switching into the circuit without problems, *yet* -- So these relays &quot;might&quot; have something in them to protect them. (clueless)

Kudo's again to the great group of people who travel this forum! I've actually furthered my electronics knowledge as a result.

Jeff
 

bobrayner

Member
The diode doesn't protect the relay it protects any semiconductor driver devices. The 2N2222 (4 &quot;2&quot;s)is a good choice for this application as it is a very fast switching device.
cheers BobR
 
Top