Simple on/off microcontroller?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple on/off microcontroller?

7,908 Views
Bluenose
Contributor I

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.

 

Labels (1)
0 Kudos
7 Replies

1,563 Views
Nabla69
Contributor V
Hello,

A MicroController {MCU} is clever and does what the software tells it to do.
The advantage with small MCUs is that their stand-by consumption is very very low.
You will never be able to find a semiconductor that does not consume current at all.

The type of MCU you are looking for is very low end, very low power.
I see two perfect candidate: MC9S08QG family and MC9RS08KA2.
Both are very small and with limited features.

Still they are perfect and will allow you some variations in the future. For instance if you want the LED to blink when you press the switch three times.

I advise you to follow one of the numerous online course that Freescale offer on their website. These courses are free and will introduce you to the world of 8-bit MCUs, the device you need for your application.

Good Luck!

Alfredo.
0 Kudos

1,563 Views
rocco
Senior Contributor II

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

0 Kudos

1,563 Views
Bluenose
Contributor I
That sounds very promising Rocco. I'm going to have to do a lot of  research on Microcontrollers so expect me back here from time to time with a few more questions!
 
Thanks guys.
0 Kudos

1,562 Views
joerg
Contributor II
Hi Bluenose
I have done a project like rooco described for a controller that turns on a generator by pushing on a switch (remote control) and the whole device is switched OFF pushing the STOP switch. It uses a HC08QT micro (a HCSQD4 would work also) and needs some transistors to control the power of the MPU. If you are interested i can send you the schematics and a example for the software (it is written for the CW (asm) and uses the EBS08 a OS).

Saluti Joerg
0 Kudos

1,563 Views
Bluenose
Contributor I
Hey Joerg, I just sent you a PM
Thanks!
0 Kudos

1,563 Views
joerg
Contributor II

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

hcs08-qd4tut-01.pdf

Message Edited by t.dowe on 2009-10-20 01:34 PM
0 Kudos

1,563 Views
joerg
Contributor II

OK
Here the updated description of the tutorial. AND the software (part1 and part2).

Saluti Joerg

hcs08-qd4tut.pdf

EBS08C_QD4_51_TUT1.zip

EBS08C_QD4_51_TUT2.zip

Message Edited by t.dowe on 2009-10-20 01:33 PM
0 Kudos