This is general enough to be of use to several folks.
Anybody got a simple momentary keypad-switchable ON-OFF circuit for a
8051 (or similar)? Figure about 100 mA MAX, and will be battery operated (9-Volt).
Program will run for a minute or so, then the device should shutdown (under uPC control) until the next time it's needed. Probably do this about 20 times a day. Battery lifetime is important.
MINIMUM cost, and minimum parts count would be nice too! :)
The only thing I can think of is a FET controlling the input to a switch mode power supply / regulator. (But admittedly, I don't do much battery-only stuff, and my solar design are higher current and not easily adaptable for low cost.)
P channel enhanced high side switch. The remote signal will pull the gate low. Use one output from the uC as a open collector config that also connects to the gate. When the Uc boots, it shall pull this output low. when the uC wants to turn it self off, just lift this output to high. if you want to manually turn the device off, use another input that you simply pull low which will have the uC turn off the output line. etc.. that's just as basic run down. you can use a low voltage logic level P channel.
If battery lifetime is important, the MSP430 from TI is definitely the way to go. Since it has interrupts based on its I/O pins it is very easy to have the device to wake-up when a key is pressed. The MSP430 alone can consume less than 1mA while running. An MSP430 running at
6MHz will beat a 40MHz 8051 hands down when it comes to processing power.
--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
The key can switch it on and decoupled with 2 diodes the CPU can hold itself on. And an additional pull-down at the input: When the CPU releases the output, it turns off itself, with very low quiescent current.
I've used this part in a customer product and works great. Only drawback is that it is from Maxim, but at least the Maxim store has it in stock and the customer uses this part for some years without delivery problems.
But for minimum price a FET solution might be better. Part count might be better with the MAX4715.
--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
I think it's non-trivial. The micro will do undefined things as its supply voltage drops, and there are protection diode networks that can come into play. 8051s have those awful pseudo-bidirectional ports (sometimes).
The easiest solution, assuming a modern CMOS micro with sleep mode and "wake on port pin change" or "wake on interrupt" function is to power the micro continuously and shut down the internal clock oscillator. Usually you can leave port pins and so on in such a state as to draw microamps or better during sleep. There are potential safety issues with this approach, and you might need to hide a "hard" reset switch somewhere.
Best regards, Spehro Pefhany
--
"it\'s the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
What he said. :-) Seems to me that most modern parts should have sleep modes that draw negligible amounts of current, yet can wake up instantly on an input pin state change. IOW, use a PIC. ;-)
Think about the thyristor idea a second time. Start it by pressing a button parallel to the thyristor. Stop it by let the CMOS MCU going in sleep state. Reducing the current let the thyristor go open.
Of course, there are other possible solutions too.
Agreed, but in this particular design (data collection & storage), it's unlikely undefined startup conditions or flake-y power would actually cause a problem. The device just won't appear to operate...
But back to the issue: The device is battery powered (single 9-volt) and the 8051 is NOT the only thing consuming power. So while "sleep" mode and/or power down mode will work for that, it won't necessarily power down everything else. (LCD display, serial EEPROM, communciations circuits, etc..)
Additional note: You know, I really did want to use the LCD backlight, but at 160mA it does seem like you'd be replacing the 9V battery pretty often. Bummer.
And I did not mention it but the same circuit board will power both a wall-mount version AND a portable, handheld version. The former being powered by a wall transformer, so no problem there obviously. (I could just leave it running constantly).
But on the handheld unit, power conservation is really rather important. I was already thinking along the lines of switching P/S, etc...
Ideally, I'd just like to turn the device completely OFF, until the user presses a momentary keypad switch to turn it ON. Then let the
8051 device do it's thing and shut off.
I will look at the Thyrister and high-side suggestions. Also the MAX4715 idea. I am aware of several regulators that have an "enable" line, and that would of course solve the problem.
I was just wondering how everyone else does this, and as I suspected, there are lots of good ideas out there.
It might not shut off, and drain the batteries for you, or just annoy the user because they have to hit the key multiple times to get it to shut down. You may be able to design it so that a hardware supervisory circuit holds the micro in a defined /RESET state to low enough supply voltage (eg. 1V) that nothing bad can happen below that, if your on/off circuit is designed to work thusly.
You have control over those things if it's your circuit.
You could use AAs and maybe a SEPIC, but 160mA is still pretty thirsty. More $$ = a more efficient backlight.
I don't think that's necessarily ideal.
Would it? Only with some careful design.
Best regards, Spehro Pefhany
--
"it\'s the network..." "The Journey is the reward"
speff@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
You need a comparitor or something on the reset to keep the micro from running when the voltage is low.
The button has a direct method of turning on the P-MOSFET and can be read by the micro. Usually this involves two small N-MOSFETs or NPN transistors. One pulls down the gate of the P-MOSFET and the other goes to an IO pin.
There is also a flip-flop driving another NPN or small N-MOSFET. This flip-flop is set by an RC when the voltage rises because the button was pressed. This is what latches the power on. To switch off the power, the micro polls the power button to make sure it isn't pressed and clears the flip-flop.
My next idea woild be a OptoMOS relais in series to the voltage regulator/mcu. The LED driver side is controlled by an mcu output pin. To start the circuit just press one button parallel to the relais.
You should avoid using switchers since these use quite a lot of power even when disabled. Powering your device from a 3.6V battery makes much more sense; you won't need a regulator (especially when using the MSP430 I proposed before). The LCD backlight can be controlled by a pulsating current (perhaps a small inductor in series) rather than a switching regulator.
IMHO any solution with a switching regulator or an external power supply switch element is going to draw more power than a (sleeping) microcontroller which is directly powered from the battery.
--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
"mpm" schreef in bericht news: snipped-for-privacy@e4g2000hsg.googlegroups.com... On Dec 28, 11:19?pm, Spehro Pefhany wrote:
\\ \\Agreed, but in this particular design (data collection & storage), \\it's unlikely undefined startup conditions or flake-y power would \\actually cause a problem. The device just won't appear to operate... \\ \\But back to the issue: \\The device is battery powered (single 9-volt) and the 8051 is NOT the \\only thing consuming power. So while "sleep" mode and/or power down \\mode will work for that, it won't necessarily power down everything \\else. (LCD display, serial EEPROM, communciations circuits, etc..) \\ \\Additional note: You know, I really did want to use the LCD \\backlight, but at 160mA it does seem like you'd be replacing the 9V \\battery pretty often. Bummer. \\ \\And I did not mention it but the same circuit board will power both a \\wall-mount version AND a portable, handheld version. The former being \\powered by a wall transformer, so no problem there obviously. (I \\could just leave it running constantly). \\ \\But on the handheld unit, power conservation is really rather \\important. \\I was already thinking along the lines of switching P/S, etc... \\ \\Ideally, I'd just like to turn the device completely OFF, until the \\user presses a momentary keypad switch to turn it ON. Then let the \\8051 device do it's thing and shut off. \\ \\I will look at the Thyrister and high-side suggestions. Also the \\MAX4715 idea. \\I am aware of several regulators that have an "enable" line, and that \\would of course solve the problem. \\ \\I was just wondering how everyone else does this, and as I suspected, \\there are lots of good ideas out there. \\ \\-mpm \\
I don't like the idea of a processor switching itself off, but the principle looks not too difficult. The circuit below can be considered standard.
The LCD and rest of the circuit is 5V, so for minimum parts (and assembly effort), I don't see a compelling reason to use 3.6 volts. (?) Not to mention, I'd rather use a consumer battery (9V vs.
2-"AA"'s).
RE: switcher, I would also disable the P/S. The switching efficiency would only come into play when the device was actually "ON". Otherwise, there are also linear regulators with enables.
The software can take care of startup issues. There's really nothing connected that could do any harm. =2E..except of course, the uPC that will eventually TURN OFF the device.!!
It would take an exceptional series of "correct" glitches to overwrite the serial EEPROM, initiate communications, or clobber the LCD. In fact, I'll initialize the LCD before writing to it anyway (each and every start-up). Every "ON" event will be a cold start, and that's fine for this application. I don't need to store RAM, or anything like that.... -mpm
3V cells are very standard for use in photo cameras. And there are 3V LCD displays. In fact, 5V components may become obsolete in the near future. BTW, some MSP430 devices can drive LCD displays directly. Olimex
formatting link
has some boards that demonstrate that feature. This may be an additional cost saver. Bare LCD displays with pins can be bought from suppliers in China.
Look at the off state current (even better: power consumption) of a switcher and a linear regulator. It is huge.
--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
The circuit shown below is about as foolproof as it gets. The CD4093 is a quad NAND w/Schmitt trigger inputs and can run off nearly any voltage. This stays connected to the battery at all times, it draws no current when the circuit is powered done, other than leakage. The circuit is such that the switch can turn the power on and off at any time, regardless of the processor input. It can override an OFF by being held down, and it can turn the circuit off at any time. G1 and G2 in combination with the switch form a toggle FF that self-latches off. The microprocessor OFF input is not enabled while the latch is off. When the momentary is pressed, the FF transitions to turn the PFET on and enables the OFF input through the 1M and 0.1u delay to G3 input. This does not occur until approximately 100ms after the switch is released. So the user has the option of holding the switch down until the processor gives some indication that it is on or otherwise. The processor need only trigger OFF for a few hundred nanoseconds. G4 then asserts a '1' to G3 input. If the the capacitor has charged to '1' by that time, which is usually the case, G3 asserts a '0' on G2 input which forces G2 to '1', turning the PFET off and causing G1 to latch with G2, disabling the OFF input and locking the circuit into that state until the next switch press. View in a fixed-width font such as Courier.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.