Hey guys, I'm new here and also rather new to electronics.
I've been trying to find a way to make a momentary push button (push and hold in to keep on, release to turn off) act like a regular on/off switch (push to turn on, push again to turn off). This pushbutton is meant to control a simple LED.
My original idea was to use the following circuit:
My project however is being powered by two 1.5v button cell batteries, and the inverters would still draw power even when 'off'.
I am looking for a solution that will make my LED turn on when the momentary pushbutton is pressed, and turn off if pressed again, and doesn’t consume power while off. A Microcontroller was recommended, but I don't know what exactly I should be looking for. My project is very tiny, making use of a tactile switch no taller then 0.55mm and the LED is 0.8mm in height.
What type of Microcontroller should I be looking for?
Presuming there is a microcontroller out there that meets my needs, what other components are necessary?
I appreciate your help and if any more information is needed just let me know.
As well as using a very low power microcontroller, as Nabla69 (the man of many names) suggested, you could use any old microcontroller, and have it power itself off when it sees the button pushed.
You would have the button do double-duty:
1) It would provide power to the microcontroller, and
2) It would provide an input to the microcontroller that the firmware could sense.
The microcontroller firmware would have to be able to control a switch that powers both it and the LED. A simple MosFet would do.
The firmware would act like so:
0) The power is off, and the firmware does nothing (one would hope).
1) User pushes the button, which powers-up the microcontroller and LED.
2) The microcontroller turns the switch ON, in order to hold itself and the LED on.
3) The microcontroller senses the button, and waits for it to be released.
4) The user releases the button, but the switch keeps everything powered.
5) The microcontroller senses the button, and waits for it to be pressed again.
6) User pushes the button, which is then sensed by the microcontroller.
7) The microcontroller turns the switch OFF, to allow itself to be powered OFF.
8) The user releases the button, causing the power to be removed from everything.
You are now back to step 0.
Alban applied rocco edit request.
Message Edited by Alban on 2007-02-14 09:00 AM
Hi
i have reflected the case and since this may be interesting for other people, have decided to draw a schematic for this case. The HCS08QD4 has 6 GPIO's so why not create a tutorial project?
-> Here it is (sorry the hardware is not tested yet, but the PCB is ready!):
In the attachment you can find the schematics and the layout, as well as a brief description of this project. (again sorry; the BOM has to be done also).
Now i will write the program (in C). I think i do first the simple ON/OFF action. The second part will be to drive a LED depending on how long the pushbutton is pressed (ON, OFF, BLINKING) and as a third part i will do dimming of a LED using the PWM of TIM1.
Saluti Joerg
OK
Here the updated description of the tutorial. AND the software (part1 and part2).
Saluti Joerg