Lazy man's cheat sheet for driving latching relays

JTEX

Well-known member
The Cheat: use an ATtiny chip to drive latching relays directly!

Yes, it works, it can put out enough juice, I use it every day, just as seen below. No, you don't even need protection diodes across the relay coils. The chip has them built-in. Some ATtiny chips are available in DIP packages, if you don't want to do SMD.

Here's an example from my current project, where I have to drive 3 latching relays and 3 LEDs, triggered by 3 momentary switches. The idle current consumption (with the right programming, putting the chip to sleep almost all the time) is 300 microamps at 5V, plus maybe 1mA total for the 3 LEDS when they're all on (they're very efficient). The relays only draw any juice at all for about 10 milliseconds, the time it takes them to latch. I used an ATtiny167 because I needed many IO pins, but if you have just one relay, you can use an ATtiny85.

Screenshot 2023-03-28 164703.png

Screenshot 2023-03-28 165429.png

The downside is that (just like I had to...), you'll have to teach yourself how to program said ATtiny chip (use the Arduino IDE), and you'll need to put together a thing called an ISP programmer (In-System Programming). You can easily make one from an Arduino Uno or compatible board. It can program the chip via a 6-pin header after it's already on the board, all wired up with relays and all!

I'm way too lazy to write a longer-form tutorial, but I hope this is enough to maybe spark an idea for someone.
 
I finally started taking a shot at this myself.
I got this AVR programmer shield for an Arduino UNO and some ATtiny85s. Spent a day working at it and I can't get the boot loader to burn. The shield is working enough to power the LEDs on it, giving me a red error indicator when I try to burn the bootloader.

s-l1600.jpg
 
Would you be willing to elaborate a little on the reed switches? Are you using custom fab actuators?
 
Last edited:
I finally started taking a shot at this myself.
I got this AVR programmer shield for an Arduino UNO and some ATtiny85s. Spent a day working at it and I can't get the boot loader to burn. The shield is working enough to power the LEDs on it, giving me a red error indicator when I try to burn the bootloader.

s-l1600.jpg
I wish I could help, but I don't have this particular shield, nor did I use attiny85. I can tell you that I had to modify my shield because it wasn't made for attiny167, so the ISP pins were not in the right place for it.
 
Last edited:
I wish I could help, but I don't have this particular shield, nor did I use attiny85. I can tell you that I had to modify my shield became it wasn't made for attiny167, so the ISP pins were not in the right place for it.
No sweat. If anything, I need to find some simple instructional videos on the basics.
 
Nice! There has been some discussion of this over at FSB previously
Before I forget, here's something I ran into that I hadn't thought of, while trying to get this sort of circuit to draw as little battery juice as possible (since it just sits around doing nothing 99.99% of the time).

If you use a 7805 to drop the 9V down to 5 for the ATtiny (like they did in the FSB discussion quoted above), keep in mind that it draws around 3mA with no load, which is WAY more than the whole rest of the circuit at idle. This threw a big wrench in my power budget. Forget the 7805, it's an old dog not suitable for low power. You'll need a low quiescent current (microamps) voltage regulator. There are many to choose from. I settled on an AP7375.
 
This is awesome stuff. I start looking into relays and suddenly I am surrounded by relay options!
Great tip about the 7805, pity I submitted my Mouser order this morning! 🫠
 
Before I forget, here's something I ran into that I hadn't thought of, while trying to get this sort of circuit to draw as little battery juice as possible (since it just sits around doing nothing 99.99% of the time).

If you use a 7805 to drop the 9V down to 5 for the ATtiny (like they did in the FSB discussion quoted above), keep in mind that it draws around 3mA with no load, which is WAY more than the whole rest of the circuit at idle. This threw a big wrench in my power budget. Forget the 7805, it's an old dog not suitable for low power. You'll need a low quiescent current (microamps) voltage regulator. There are many to choose from. I settled on an AP7375.
Duly noted, great tip. I'm seeing that the AP7375 is an SMD part, are there any in TO-92 or similar packages that would drop-in replace a 78L05? Does e.g. Tayda sell any such devices?
 
Last edited:
Nice, thank you. Yeah I agree, for me Digi-Key is the only feasible option of those as I am not in the US. Last time I looked into Mouser or Newark the shipping was way too much.
 
Yes, I make my own. I made a thread about that, I can't figure out how to quote it on my phone, but I'm sure you'll find it.

I hope you're not doing this at any sort of scale!
 
Back
Top