feedback of a latching solenoid

Discussion in 'The Projects Forum' started by Tomasz22, Jan 6, 2009.

  1. Tomasz22

    Thread Starter New Member

    Dec 21, 2008
    Im designing a digital circuit which controls a latching solenoid. I have attached the final section of the circuit (sorry for the hand drawing). There is a signal coming from the control box, such that a "1" means the solenoid should be latched and a "0" means the solenoid should be unlatched. The way this works is the relay is energized when the MOSFET is turned on, which then pulses the supply to the solenoid and makes it latch. (Pulse again to make it unlatch).
    I have used and XOR gate to xor the control signal with the feedback. Feedback is needed so not to unlatch the solenoid when it should be latched.. and vice versa.
    The XOR gate is CMOS with Vdd=12V, the control signal is 12V high, and 0V low.
    The solenoid/relay/MOSFET has a separate supply to the XOR/Control circuit, but their grounds/commons are linked(i.e. the same point).
    This circuit works correctly when tested without feedback.
    I have indicated where i tried to take the feedback from, but it does not work.. it forces the solenoid to oscillate between latched/unlatched states. Where can i take the feedback from? or what extra circuitry is needed?

    Thanks in advance
    • 1.png
      File size:
      1.8 MB
  2. SgtWookie


    Jul 17, 2007
    You're probably suffering from "contact bounce".

    Although switch & relay contacts may seem to make/break instantaneously to you and I, in reality the contacts bounce and slide along for a seeming eternity for electronic components.

    One way to fight the "contact bounce" is to use an RC time constant to slowly build up or discharge your control voltage feedback line. There's another hazard in this; you should be using devices with Schmitt-trigger inputs to avoid them oscillating when the signal level is indeterminate (ie: somewhere between Vdd and Vss or Vcc and GND).

    See the attached PDF, "Debouncing - a guide"

    If you're using 4000-series CMOS, the 4093 quad Schmitt-trigger NAND gate is extremely handy to have around. You could use two of the gates in series with their inputs tied together to create a non-inverting Schmitt trigger.
    Keep in mind that ALL UNUSED INPUTS for 4000 Series CMOS IC's MUST BE TIED TO Vdd or Vss. If you do not account for ALL of the inputs, you will have very difficult to fix problems, as the IC will oscillate at random frequencies and draw excessive current.
    You should also use 0.1uF (100nF) bypass capacitors (ceramic is fine) between Vdd and Vss on EACH IC.

    Another problem you may be facing is the lack of EMF surpression aka "flywheel" diodes on the coils of the relay. Ideally, these should be fast switching or Schottky type diodes. This takes care of the big voltage spike when the current to the coil is turned off; the cathode goes towards the V+ supply.
  3. eblc1388

    AAC Fanatic!

    Nov 28, 2008
    Hi, Tomasz22,

    If you want to cut off the drive to a latching relay, then you need to know the correct moment to do so.

    A latching relay needs to complete its mechanical travel stroke before it will latch. Unfortunately in your case, the stroke has not completed when the output contact closes. If you cutoff your drive at this point, the relay mechanism just won't latch.

    On a particular type of latch/reset relay I know of, the cutoff contact is of special design and only opens at about 95% of the complete armature mechanical travel stroke. This contact is designated for this purpose and using other normally closed contacts on the relay will not work. The relay simply will not latch and just buzzed.

    Coming back to your case, you can delay the sensing of the closure by connecting a RC network to the feedback signal. Also I don't see a back emf diode fitted to your MOSFET relay drive and you should add that too.
  4. Alberto

    Active Member

    Nov 7, 2008
    The point for the feed back is ok, what is wrong is the type of logic you are using. A XOR gate will yield zero when both inputs are high. So as soon as you give the switch-on command on one input of your XOR logic gate the feed back will null the command, which will reset the relay, which in turn remove the feedback, hence the switch-on command will be re-applied. Here the oscillation you have reported.

    Remove the XOR gate and use the feedback in an another way. I did not understand the need for the feedback.

  5. Tomasz22

    Thread Starter New Member

    Dec 21, 2008
    Thanks for your replies.

    I worked out why it was not working.
    here it is:
    The latching solenoid needs a pulse to latch (12V pulse). During the pulse the solenoid is in a "holding" position and when the pulse finishes it latches. (same for the unlatching situation). Now the point im taking the feedback from is 12V during the "holding" time but for a very short period of time (just after the pulse finishes) the voltage drops to 0V then goes back up to 12V.

    This is where im getting the oscillations from. Any ideas on how to deal with the sudden drop in voltage?, because the XOR gate sees this as a low and this is my problem.
  6. Tomasz22

    Thread Starter New Member

    Dec 21, 2008
    To be more accurate, the latching solenoid is experiencing bouncing. To solve this i used a cmos debouncer.