I am not sure if this is entirely relevant, but anyway.
I have made a simple push button ON, OFF using a std CMOS chip, and a P-mosfet. The cct consumes only a few uA. I use it on a LiPo battery in a RC model. The principle is basically a CMOS latch with a toggle action. CCT is not very compex.
I don't know what kind of time, space, or cost constraints you are under, but here is one possible solution for you.
Use a PIC 10F2XX to read, poll, and debounce your push button. Output to the one of the GPIO lines on your main Microcontroller.
For 35 cents, the 10F might be your best bet. And it comes in a SMT package, so it will not take up much space. You will still have some IO pins left for future use in some other aspect of your project.
The one catch, you'll have to know how to program PIC 10F2XX series Microcontrollers.
Hope this helps.
Catwell
You are suggesting to add another micro controller?
I used a simple ocsillator, that is controlled by a push button switch. The oscillator is triggered to start charging by the push button switch. This sets the first part of the toggle action. If the switch is held on, then the cct output oscillates at about say 0.3Hz, so As long as the push button is only momentarily pushed, then the cct will toggle on or off, with each press. There is inbuilt on and off debounce with the timing capacitor. The key is that the logic level signal that the push button activates from is changed after each operation. This gives a toggle action. This cct only consumes the current of a std CMOS digital IC inverter type chip, with all inputs held at a set logic state, and only has additional current needed to charge, or discharge an 0.2uF cap for each press of the push button, and the leakage current of the capacitor. I doubt a micro controller can match the nA possible with this simple cct.
The thing about this cct, is that it is never asleep. The cct is always waiting for the next press of the button, to toggle the output again.
I have found that on my RC model, the cct consumes about 10mAh per year from the 7.2V battery. This is less than most LiPo self discharge specs.
Gordon.
PS: performance is degraded by humidity. As you would expect, PCB layout and environmental encapsulation are important to achieve very low power consumption, in an OFF state, to maintain high resistance dielectric insulation properties.
Gordon,
I still believe adding the second uC is a decsent option. Mainly due to needing no support components, but more so due to its future expandability.
It is more part of the button(s) than the main system.
Here are some key features:
# 2 channels 8-bit ADC
# 25 mA source/sink current I/O
# Low power (100nA) sleep current
# One 8-bit timer (TMR0)
# Watchdog timer (WDT)
I also believe its footprint is smaller than the solution you ended up going with. But, I am glad you have it figured out regardless. It is a very good, and simple, solution.
Catwell
Hi catwell,
I use moicrocontrollers for many things, but not as a toggle switch controller.
A microcontroller may have specs for 100uA in sleep mode, but this consumption increases significantly every time the microcontroller has to wake up and check to see if a button has been, or is pressed. I gather from the original question that there is already a reasonable micro in the mix. If someone can make an astable oscillator from a few inverting logic gates, then they can make this simple toggle switch. QS cmos devices are available now, so this switch could be made on a PCB about the size of an SOIC8 micro. The push button user interface will likely be the bigggest component. I have not been asked to provide a cct layout, so I assume the original poster has it now sorted.
Gordon.
There is a very cool IC that can be used to perform the astable oscilator action, the NE555. Take a look it is a very usefull IC! The datasheet is in the link http://www.datasheetcatalog.org/datasheet/philips/NE_SA_SE555_C_2.pdf
I hope it was a usefull post!
You would need to provide a mechanical ON/OFF switch with a 555 cct. These IC's have been around for ever, and they have a lot of internal circuitry that is consuming power all of the time they are powered. There are CMOS versions now with lower consumption, but only an order of magnitude or so. There are many manufactures, and some are better than others in the "low power" department. The whole point of this thread was to replace a mechanical ON/OFF switch, with a single momentary push switch. I figured the cct should consume as close to zero current as possible, when in the OFF state. If nA consumption is not required, then there is a whole cupboard of options, of which a 555 would be in.
This thread has run its course for me, so as there is no request for specifics I will leave it as is.
Gordon.
There are small microproc. that have a very small current in poweroff mode.
I've recently use the attiny44, in a battery envirmnet.
In sleep mode the full circuit has about few microamp. of power current , I think less than 1 microamp for the processor.
The attiny can stay in p0wer-off forever without polling, it is awakened by a change in the status of an input pin that generate an interrupt.
(atmel declare in powerdown mode 0.1 microamp)
regards
franco vecchi
Hi Marvin,
I have just recalculated the current consumed by my cct. It works out at 0.0000003mA. No mattter what micro controller options are suggested, I doubt they can achieve a working cct consumption figure this low. This is 0.0003 microAmps.
Gordon.
Use a pushbutton switch with one side gounded. Drive the gate of a P channel mosfet with the other side through a resistor and diode (weak pullup between resistor and diode), use a pullup to Vin on the gate. Run the output of the switch through another resistor, then a diode, puller resistor and zener (to limit to 3.3v) and to a GPIO. Run a second GPIO to a NPN transister with the emitter connected to the gate of the P channel mosfet.
When the system is off, the only power consumption is leakage through the P channel mosfet. When the button is pressed, the mosfet is turned on, and the microproressor immediately turns on the npn transistor, keeping the mosfet gate low (active) when the pushbutton is released.
The microcontroller can sense the state of the pushbutton switch (sample before the diode, the pullup will keep the input high unless the button is pressed, the high level is Vin, so you will probably need a series resistor followed by a zener to limit the high level voltage). Once the microcontroller sees the switch go inactive after poweron, it can look for a 2s low pulse on the switch and disable the npn transistor on the mosfet. When the switch is released, neither the switch or npn are pulling the mosfet gate low so the system turns off.
If there is a shutdown sequence for any system components, on detecting the 2s low pulse on the switch the controller can initiate shutdown and release the gate / npn transistor when shutdown is completed.
Dean