PIC driving impulse relay direct - Page 1
Forum section: electronics / general

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 24, 2017, 04:14:36 pm
content: 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?

author: Neilm
author_rank: Super Contributor
timestamp: March 24, 2017, 04:30:49 pm
content: 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.

author: BrianHG
author_rank: Super Contributor
timestamp: March 24, 2017, 05:38:32 pm
content: 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.

author: retrolefty
author_rank: Super Contributor
timestamp: March 24, 2017, 05:42:09 pm
content: 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.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 24, 2017, 10:29:06 pm
content: Relay series datasheethttp://www.alliedelec.com/m/d/9f2d634857b83037a61813fa3828e6ae.pdfI'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 = 14mANot 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.

author: BrianHG
author_rank: Super Contributor
timestamp: March 24, 2017, 10:43:09 pm
content: 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...

author: NivagSwerdna
author_rank: Super Contributor
timestamp: March 25, 2017, 11:38:48 am
content: 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. ?

author: retrolefty
author_rank: Super Contributor
timestamp: March 25, 2017, 01:03:08 pm
content: Quote from: NivagSwerdna on March 25, 2017, 11:38:48 amNo issue

author: Ian.M
author_rank: Super Contributor
timestamp: March 25, 2017, 02:33:00 pm
content: 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.aspxSome followup:http://www.microchip.com/forums/m821598.aspx