Email Address:

Lost your password?

This is the legacy website; please use the new website.

VersaTimer/Switch With Self-Latching Relay

Use it as a micropower switch, programmable timer and/or 12V battery protector

By John Clarke

Main Features

• Very low current drain
• Electrically isolated control input
• Low battery protection
• 60A (or 80A) 250VAC SPST relay or 2A 30VDC DPDT relay
• Relay options include input follow, alternate or momentary
• Adjustable input switching sense
• High, low or high and low switching with momentary action
• Adjustable relay drive pulse duration
• Timer periods from seconds to 5 hours

Main Uses

(1) Standalone timer
(2) Low battery power switch or battery isolator
(3) Low power relay control from DC or pulse signal

This project was first conceived to update the DC Relay Switch from our November 2006 issue. That project would operate a high-current relay in response to any DC or pulse signal and it also employed an optocoupler to provide full isolation between the control signal and the circuit being switched.

The current through the relay coil depends on the particular relay. For 12V relays, the coil current can be as low as 12mA for a 500mA reed relay, 30mA for a 3A relay and more than 100mA for a 30A relay. This coil current must be continuously applied to keep the relay contacts closed.

The solution: use a latching relay. This type of relay only draws a brief pulse of current when its relay contacts are changed from the closed or open condition. At all other times, it draws no current at all.

So how does a latching relay work? Well, instead of just using a moving armature (to operate the contacts) together with a coil wound on a steel core (an electromagnet), a latching relay has a couple of bar magnets and these hold the relay contacts in one position (eg, closed) or the other (eg, open). The electromagnet effectively toggles the relay contacts from one position to the other just as you do when you operate a light switch in your home. However, in the light switch example, the switch is held in the open or closed position by spring action. By contrast, the latching relay uses magnets to do the same job.

But while latching relays are good (ie, they don’t draw current continuously), they are much more difficult to drive than conventional relays. The circuitry required to drive them is more complicated as we shall see.

Multiple functions

Click for larger image
The circuit is housed in a standard IP65 case (115 x 90 x 55mm). Two versions can be built – one to switch the mains (as shown here) and one to switch voltages up to 30V DC @ 2A.
As indicated, this "VersaTimer/Switch" circuit drives a latching relay. It also provides a useful timer function which can provide latched or momentary operation and can switch power on for a predetermined period or switch it off after a predetermined period. Or it can switch on and off alternately, according to your settings.

To top it off, it also provides a battery protection feature, preventing the battery from being too heavily discharged. This is important in circuits which run from lead-acid and particularly sealed lead-acid (SLA or gel) batteries.

All these features are provided by a small PIC microcontroller. Now before you fall about laughing or reel back in dismay, stay with us while we give you the reasons for using a micro rather than a bunch of transistors and maybe a logic IC or two. Well that says it all really because a bunch of transistors and logic ICs would end up being a lot more complicated and provide less functions than our circuit. Nor would a discrete version have the low power consumption of this circuit.

Latching relays use either one or two coils to drive the relay into each state. For a single coil type, you need a pulse of current to switch from one state to the other and then a pulse in the opposite direction to change state again.

A double-coil latching relay requires a pulse of current in one coil to provide the set (on) position for the contacts and then another pulse of the same polarity to be applied to the second coil to produce the (off) reset condition for the contacts. There is more discussion on latching and non-latching relays in a separate panel at the end of this article.

The VersaTimer/Switch has been designed to suit both types of latching relay, ie, single or double-coil. The double-coil relay has DPDT 2A contacts and the single coil relay has SPST 60A (or 80A) contacts.

The drive circuitry is also suited to other latching relays that may not necessarily fit onto the PCB for the VersaTimer/Switch. Because latching relays have differing pulse length requirements when switching relay states, the pulse duration can be adjusted to suit the relay specifications.


Supply voltage    ........ 12V nominal
Relay type    ........ 12V latching
Relay drive pulse    ........ 1-500ms adjustable
Pulse current at 12V    ........ 15mA (@25ms) for SY-4060, 85mA (@60ms) for JMX-94F-A-Z
Low battery threshold    ........ <11.5V (adjustable)
Low battery upper threshold (switch back on)    ........ >12V
Battery voltage monitoring    ........ 6ms every 10s
Timer function    ........ 0-50s (200ms minimum, ~200ms steps), 0-5m (8.4s minimum and 36 x 8.4s steps) or 0-5h (2.38m minimum and 127 x 2.38m steps)
Isolation    ........ 2500VAC between coil and contacts for 60A and 80A relays
Trigger input isolation    ........ up to 50V maximum recommended
Quiescent current    ........ 17µA maximum, 13.3µA measured at 12V; add 10.6µA when RB2 is low and add 0.6µA during any timing period
Low battery quiescent current    ........ 17µA
Maximum trigger voltage    ........ 35V with 10kΩ 0.25W resistor for R1
Minimum input voltage    ........ 3.25V for R1 = 10kΩ (alternative R1 for lower voltages: 1.5kΩ for 1.5V, 3kΩ for 2V, 6.2kΩ for 3V)
Minimum input trigger current at In+ and In-    ........ 225µA
Maximum input trigger current    ........ 60mA

Isolated triggering

For most uses, a trigger signal is required for the VersaTimer/Switch. This trigger signal can be 0V for one relay position and 5V for the alternative relay position. For example, the trigger can be obtained from a circuit that drives a LED or from any other suitable voltage signal.

In addition, the input trigger signal is optically isolated and can operate from a floating potential.

Triggering can also be from a momentary pushbutton switch or toggle switch, depending on the application.

When used as a replacement for a non-latching relay, the VersaTimer/Switch responds to follow the input signal. So when the input signal is off, the relay is set to one state (for example, with its contacts open) and when the trigger signal is on (ie, trigger voltage is present) the relay is switched to its alternative state with its contacts closed. You can select which relay state occurs with which input signal.

Low voltage monitoring

This function is independent of the input triggering function. In addition, the typical current drawn by the VersaTimer/Switch is very low at around 13.3µA.

Timer function

The VersaTimer/Switch can be set to switch on or off with a trigger signal for a period from seconds through to five hours. It can be triggered from a high to low signal (eg, 5V to 0V), a low to high signal (eg, 0V to 5V) or from both voltage edges.

Click for larger image
Fig.1: a PIC16F88-I/P microcontroller (IC1) is used to control the latching relay via switching transistors Q1-Q6 (or Q3 & Q4 only if a double-coil relay is used). IC1 also monitors the trigger input via optocoupler IC2 (ie, at its RB2 port), while other ports monitor the trimpot and link settings to set the edge triggering and relay modes, the timer and the power-up defaults. Optocoupler IC3 is included as a power saving measure – it turns on only when IC1’s RA0 port goes high and applies voltage to VR1 so that the PIC microcontroller can monitor the input supply rail.

Share this Article: 

Privacy Policy  |  Advertise  |  Contact Us

Copyright © 1996-2021 Silicon Chip Publications Pty Ltd All Rights Reserved