Author Topic: PIC driving impulse relay direct  (Read 2304 times)

0 Members and 1 Guest are viewing this topic.

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
PIC driving impulse relay direct
« on: March 24, 2017, 04:14:36 pm »
I know you are meant to use an H-bridge....

... but I have a very small latched relay with a single coil.  A short pulse drives it to latch, a short pulse in the other direction resets it.  It is a 5V relay and I have a 5V PIC.

Why shouldn't I just connect it to two output pins and ensure they are either ON/OFF or OFF/ON or OFF/OFF or inputs?

(I plan to add two zeners in series across the coil for protection)

Opinion?
 

Offline Neilm

  • Super Contributor
  • ***
  • Posts: 1546
  • Country: gb
Re: PIC driving impulse relay direct
« Reply #1 on: March 24, 2017, 04:30:49 pm »
Can your PIC supply enough current to reliably change the relay? You are correct to assume that you don't need an H-bridge. I have used buffer chips for exactly this application before now.
Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
Tesla referral code https://ts.la/neil53539
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7725
  • Country: ca
Re: PIC driving impulse relay direct
« Reply #2 on: March 24, 2017, 05:38:32 pm »
It would help if you supply the relay data sheet and which PIC.  Some of the 8 bit PICs can drive as much as +/-50ma per IO, but, you are limited by the maximum current handling of the VCC & GND pin if you want to drive multiple relays simultaneously + your voltage difference between 2 IOs (bi-polarity 1 coil latched telecom relay) might be as low as 3.3v with a 5v supply with a 25ma current consumption.  This means, maybe, you can use a single coil 3.3v telecom bidirectional latched relay under careful conditions.  Maybe a 5v one if you have the other side of the relay coil connected to VCC since the pic sinks current better & you would need a relay with a set coil and a reset coil.  BUT, you must take care of how the coil switch bounce wont burn you IOs, this will need to be done by switching the IO and waiting for coil discharge before going tri-state if you will be attempting such a thing.

Without knowing your circuit and number of relays, I cant say more than this.
« Last Edit: March 24, 2017, 05:42:42 pm by BrianHG »
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: PIC driving impulse relay direct
« Reply #3 on: March 24, 2017, 05:42:09 pm »
I've done that on arduino projects. The small single coil 5V relay I had drew around 10 ma, so like an LED for load. Be sure you allow enough pulse length + some to insure operation, you can pulse too fast and miss a movement.


 

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: PIC driving impulse relay direct
« Reply #4 on: March 24, 2017, 10:29:06 pm »
Relay series datasheet

http://www.alliedelec.com/m/d/9f2d634857b83037a61813fa3828e6ae.pdf

I'm planning to use v23078-c1101-b301 since I have some of those.

I only plan to drive one relay via the PIC.  Changes will be very infrequent. (i.e. on the order of <1/day)

The datasheet rates it around 360 ohms requiring 3v75   It says 70mW rated coil power... not sure what that means.

Now 5V across 360 ohms = 14mA

Not sure about my PIC choice... probably something from the junk box.... e.g. PIC16F87X... which claims 25mA per pin and max 200mA.

So I think in theory it might work.




 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7725
  • Country: ca
Re: PIC driving impulse relay direct
« Reply #5 on: March 24, 2017, 10:43:09 pm »
It should work.
Make sure you have a good low-esr 100uf or more cap right at the PIC's VCC&GND.
Never release the IOs right after driving the relay into tristate...  If you must use tristate, not recommended, make them both GND and wait a few ms before doing so that there is no inductive charge in the relay coil.

Also, just take a look at some newer cheaper 8 bit pics, I recently remember looking at their drive current and they are now +/-50ma per pin, something like 350ma max total IO current.

Last, if you have 2 additional free IO on the same bank, you can always double the drive capability to your relay...
 
The following users thanked this post: NivagSwerdna

Offline NivagSwerdnaTopic starter

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: PIC driving impulse relay direct
« Reply #6 on: March 25, 2017, 11:38:48 am »
Thanks.  I will try it out and see what happens.

So no issue with the bi-directional nature then... at one point sinking from one and sourcing to the other... and then later the other way around.  ?
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: PIC driving impulse relay direct
« Reply #7 on: March 25, 2017, 01:03:08 pm »
Thanks.  I will try it out and see what happens.

So no issue with the bi-directional nature then... at one point sinking from one and sourcing to the other... and then later the other way around.  ?

 No issue
 
The following users thanked this post: NivagSwerdna

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12852
Re: PIC driving impulse relay direct
« Reply #8 on: March 25, 2017, 02:33:00 pm »
Description of a successful commercial implementation of multiple latching relays using a PIC18, paralleling outputs for enough coil drive and using the outputs to short the coil to allow the current to decay before going tristate:
http://www.microchip.com/forums/m788787.aspx
Some followup:
http://www.microchip.com/forums/m821598.aspx
 
The following users thanked this post: NivagSwerdna


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf