timer circuit using small µC... power supply question - Page 1
Forum section: electronics / beginners

author: JeanF
author_rank: Regular Contributor
timestamp: May 30, 2014, 12:05:54 pm
content: Hello,Here is the context. I have a laptop which doesn't have the "automatic power on" in its BIOS, and will be used without a battery. So I would like to make a small circuit to simulate a press on the power button to make it reboot after a power outage. (I have easy access to the motherboard PCB because I'm running the entire thing outside its original enclosure). The timer circuit would be plugged to the 19v DC jack on the motherboard, and when the 19v power supply comes back, it would activate a small relay in parallel with on/off SPST switch for a few hundreds of milliseconds.(for this purpose, I could maybe use an optocoupler or even a transistor but there is an issue, the on/off switch is pulling low a certain i/o line on the motherboard, but not to the same ground as the 19v input jack ground. So a relay is the quickest, easiest and least invasive method, besides maybe not the most elegant of all. But this is not the problem here, I can refine that later)I guess there are many ways to do that with R/C timers or maybe a 555, but to be able to easily change the delay I chose to use a microcontroller, they are so cheap now.I've made a successful attempt with a 8-pin PICAXE (again that was a quick&easy choice, in the end I will be able to do that in C on a ATtiny, but not yet) powered from the 19v by a 7805. The BASIC program was dead simple : set port C to output, make a pin high, pause 300ms, make pin low, end.However the 7805 needs around 5mA to regulate even when the µC is sleeping and draws close to nothing. I think it is not very elegant to waste 100mW like that 99% of the time, even if it's not a problem for the 5A PC power adapter, of course. So I wanted to be able to shut off the regulator by software. There are many circuits explained online to do just that, some using a regulator with a shutdown pin, some using a pair of NPN and PNP BJTs (or a N and a P mosfet) to cut the power upstream the regulator. But I found that all of these circuits use a push button to power on the µC, momentarily bypassing the soft switch to power the microcontroller, thus giving him time to tie a pin High to maintain power afterwards.I then came across this circuit :http://www.wengenroth.co/projects/auto-shutoff-circuit/, diagram below :I breadboarded the thing (again with a picaxe 08m2) and I was amazed, it works well ! I then put a relay (with a proper diode) between +Vbat and OUT, and bingo, I have a relay that switches on for a programmable amount of time and then the whole thing shuts off and doesn't draw any power. But of course the voltage between +Vbat and -Vbat must remain in a acceptable range for the µC.How could I modify the circuit to work from 19v ? Either by switching on and off its own regulator (e.g. a 78L05) or maybe with another trick, a dropper resistor or a zener, I don't know. I've been tinkering too many hours in a row and my mind is all foggy now, I'd greatly appreciate some fresh ideas or commentsThank you in advanceCheers,JF

author: madires
author_rank: Super Contributor
timestamp: May 30, 2014, 12:46:33 pm
content: You could use a LP2950 (LDO, up to 30V input, 75µA quiescent current) as voltage regulator. Another idea for optimization would be to remove the relay and to switch the power push button via a transistor (logic level MOSFET?). You just need to check if the power control line is pulled up or down and match the transistor based switch.

author: JeanF
author_rank: Regular Contributor
timestamp: May 30, 2014, 05:39:25 pm
content: thanks, good idea, I didn't know that LDOs could go this low in terms of quiescent current. This looks like it will be the final choice, but for the sake of learning, do you know an architecture which could allow a µC to power up automatically, then to shutdown its own linear reg by software ?i.e. similar to this one, but without the necessity to push the pushbutton to boot ?

author: Andreas
author_rank: Super Contributor
timestamp: May 30, 2014, 06:56:45 pm
content: Quote from: JeanF on May 30, 2014, 05:39:25 pmYou could replace the switch by a capacitor + a diode in reverse direction.Or even better place the capacitor in parallel to VT2. (C-E pins)And: there are voltage regulators which use much lower quiescent current:e.g. XC6216 from TOREX uses 5uA.with best regardsAndreas

author: JeanF
author_rank: Regular Contributor
timestamp: June 01, 2014, 08:53:11 pm
content: Thank you, I'll try that. And indeed impressive specs for that Torex part, too bad my usual distributor (the "private individual" branch of Radiospares, very nice with free shipping when ordering on weekends) doesn't have it. I got some LP2950 as suggested, TO-92 package will be easier to work with anyhow !