PIC relays control


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    65

    Default PIC relays control

    Hi All

    I'm starting a little projet with a PIC chip, since I discovered that PIC Basic can make it easy for me

    I have some programming skills, but I'm very poor at selecting components, so may someone more aware of the electronical side help me?

    I'm want to use a 16F84A or 16F628A (i have both actually), and If possible i want to drive some low power relays directly from the chip!?

    Panasonic and Omron makes 5V, 20mAh, 250ohm relays that are close to the output power of the PIC pins, but anyone ever made it work?

    I'd like a single coil latching relay, maybe the TN2-K-5V of Panason..

    Next thing is how to drive it safely, knowing that I should add zener diodes somewhere to dampen the coil release.
    Being a single coil latching relay, I will need two pins and so, current will flow both direction.
    I would prefer a relay that changes state everytime it get a pulse, so driven by only 1 pin, but I haven't seen that anywhere.


    k, enought on the relays, it's already scary long

    ttl

    Dom

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Flipper,

    Where are you? In the states you can get these (below) .. they work great using one output pin but they do not latch. I used them in testing equipment years ago and they were perfect. No zener needed, just a flyback diode across the coil. I drove mine direct from a PIC output at 5 volts since the coil resistance is 250 ohm.

    http://www.radioshack.com/sm-compact...i-2062478.html
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Apr 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default WOw finally some place I can help!

    Ok here is the deal,


    You MUST use a diode across the coil of ANY relay (unless its got one built in) Its for the back EMF (colapsing magnetic field) of the coil when you un-energize it.

    If your looking for a latching type of switch depending on what your doing you have lots of options. relays with NO and NC contacts (probly your best bet), scr's, Triacs etc..

    If your worried about not being able to drive the coil from the PIC. You can just use a FET. The input impedence of the gate of a FET is really high and takes almost no current to turn on. Just make sure to use a series resistor in the gate circuit in case the FET ever fails (If the fet ever shorted gate to whatever it could hurt the PIC)

    Oh, one other thing to consider is what your switching. If your switching AC with lots of current you will need a snubber circuit to reduce the arching on the relay contacts. I just went through this on my predesesor's motor control circuit at my work. His "new" design would fuse the contacts together about the thrid or forth time the motor started.

    Well that is my two cents (probly all its worth) hope it helped. If you want to post a schematic of what your doing I would be more then happy to look it over.

    Best!
    Bill12780
    Last edited by bill12780; - 27th July 2007 at 07:51.

  4. #4
    Join Date
    Jul 2006
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Bill, do you have a schematic or part number for this control circuit with snubber by chance?

  5. #5
    Join Date
    Jul 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    hi folks

    i'm happy to know that it's at least possible to do

    Radio Shack has become CircuitCity around here, and they don't carry much of electronics anymore...
    I will probably make an order at Digikey.

    I'm looking to drive two 12v (DC) HelmetCam, who drink 130mAh approx. each.
    (but it runs very hot... I wonder how it can only be taking 130...)
    At first I wanted to have some kind of soft power switching, because that whole thing is plugged into a camcorder, but this sounds very complex to me so I will use Zener diode in the circuit to prevent overvoltage peak.
    KIS system

    I need Latching because I won't be switching too often, and the circuit can run for more 6-7hours non-stop.

    thanks all!



    Dom

  6. #6
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Default As I see it:

    Hi Dom,

    As I see it:
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1883&stc=1&d=118558263 1" />
    You would need a 5V relay to drive it directly.
    The PIC 25mA limit would drive 200 or more coil Ohms.
    Not:
    Mono-stable Relay, normal relay that stays energized while a voltage is on the coil.
    But:
    Magnetically Latching, or Mechanical Latching Relays
    Bi-stable Relay, “Latching “, usually means a pulse turns it on, a second pulse turns it off.
    Single Coil Latching (1 coil latching), usually means the second pulse goes to same connection.
    A single PIC I/O could give a pulse to turn it on, then later a second pulse would turn it off.

    Dual Coil Latching (2 coil latching), usually means a pulse on coil A turns it on, a pulse on coil B turns it off.
    This would require 2 I/O pins for control.

    Here is a hook-up if you want to use a 12V relay.
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1884&stc=1&d=118558290 6" />

    You could also use a SCR that would latch with an impulse from a PIC I/O pin. It would be more difficult to un-latch.
    -Adam-
    Attached Images Attached Images   
    Ohm it's not just a good idea... it's the LAW !

  7. #7
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Post a snubber

    Hi ohararp,
    Quote Originally Posted by ohararp View Post
    Bill, do you have a schematic or part number for this control circuit with snubber by chance?
    Here is a simplified example of a snubber for AC.
    And a “fly-back” diode for DC. Note polarity.
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1885&stc=1&d=118558358 0" />

    -Adam-
    Attached Images Attached Images  
    Ohm it's not just a good idea... it's the LAW !

  8. #8
    Join Date
    Apr 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default A little confusion here.

    OK...

    The snuber I spoke of actually is acrossed the "contacts" of the relay. You only need this if your driving an inductive load or a really high current circuit. Like say a large motor or amplifier.

    the "flyback" diode is used across the "coil" of the relay (reversed biased) to stop the colapsing field in the relay coil...Not in the load. (Although if your load was a DC inductance I supose it would work there too...)

    You can use a Zener to clamp the voltage if your concerned about spikes. But if your power supply is well regulated you should not have any problems swithing 130 mills. Just make sure you have good decoupling.

    You could use a SCR like was mentioned. You will need to remove the source voltage to get the scr to "unlatch" or turn off. This might be a good option but would require more engineering. (transistor to remove the voltage from the Anode long enough for the SCR to turn off and slow enough that it does not trigger itself)

    For the kind of current your looking at. I would use a n-channel FET. I dont really have any easy way of making a schematic for you but I will try and explain.

    Take the HIGH from the pic and run it through a series resistor that will limit the current to about half the Imax of the PIC (about a 100 ohm should give you about 12mA off the top of my head) hook the resistor to the gate of the FET put the load (your camera) in the source circuit and ground the drain.

    Oh...And this is assuming that your cameras run on DC. If your switching AC then you will need a triac.

    By using a FET you will reduce your overall Current drain. It takes alot less current to keep a FET on then it will to hold a realy.

    If you look you can find a latching Relay. I personally have never used them so am not to familar with them. But I would bet they are more expensive then using a standard realy or FET.

    If you would like I will look at my schematics tommorow at work and get the actual values I used for my snubber. I think it was .01uf and 10K if I remember right but don't hold me to that.

    Hope I have helped....

    Bill12780

Similar Threads

  1. SMS control for Relays
    By charudatt in forum Code Examples
    Replies: 15
    Last Post: - 2nd May 2009, 00:08
  2. Replies: 5
    Last Post: - 12th September 2007, 15:59
  3. Motor Control PLC with a PIC
    By sougata in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 2nd November 2006, 07:59
  4. Pic Control With Software
    By Agent36 in forum General
    Replies: 5
    Last Post: - 18th October 2006, 18:18
  5. Need help on pic to pic flow control (simple problem I think)
    By khufumen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 00:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts