View previous topic :: View next topic |
Author |
Message |
omenda Guest
|
operate pic with one push button |
Posted: Tue Dec 08, 2009 1:37 am |
|
|
hi
I need to build a small system that when I push a button the pic starts to do my program and when he finish he stop operate without drawing current.
I push a button he operates for 40 seconds and stop. Without draw current.
If the button is interrupt so the pic will have Vcc all time and draw current.
So how can I make the pic work for a while every time a button is pushed?
And otherwise my system is off without current? Like stable multivibrator.
Thanks. |
|
|
Leef_me
Joined: 14 Mar 2006 Posts: 45
|
|
Posted: Tue Dec 08, 2009 1:48 am |
|
|
The voice playback chips in some greeting cards. And other items are designed in a similar way. Perhaps some garage door remotess.
When a button is pushed, it applies power to the PIC. The pic turns on an electronic switch (typically a transistor) to continue the power flow.
The button is no longer needed to be pressed.
When the PIC is finished, it turns off the transistor, effectively disconnecting it's own power.
I do not have any links. |
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Tue Dec 08, 2009 2:35 pm |
|
|
Here's a diagram from a hand-held device that I just built. It appears to work, but I make no guarantees.
The idea is that there's the positive side of a battery attached where it says "batttery" with the negative side to ground. Normally, Q3 is off and Q2's gate is held to the battery voltage via R13, but when the user's hand makes contact between pins 4 and 5 (5 is gnd) of the connector, more current sinks to gnd than R13 can pass, so Q2 turns on. This supplies current to the load. When the user puts the device down, power will go off unless the processor has sent the "Processor control of battery" line high, turning on Q3. If this has happened, the processor can keep power on as long as necessary.
Until I built this I wasn't sure that it would operate properly when the processor shut down (would it turn back on again?) but it seems fine.
It has the additional feature that the same contacts that turn the device on can be used to recharge the battery. In this case current flows from pin 4 of the connector to the battery via D2, then back through gnd to the charging circuit.
|
|
|
Leef_me
Joined: 14 Mar 2006 Posts: 45
|
|
Posted: Tue Dec 08, 2009 2:54 pm |
|
|
Hi John P.
Pretty neat circuit, and I can follow your description of how it works.
To ALL, may I suggest caution?
If power is applied via pin 4 & 5 to recharge the circuit, and Q3 is turned on at the same time, this will likely kill Q3.
I know your circuit isn't designed to be used that way, but "murphy's law" says someone will try to use it that way.
Leef_me |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
John P
Joined: 17 Sep 2003 Posts: 331
|
|
Posted: Tue Dec 08, 2009 3:59 pm |
|
|
Ah, but--the charging supply, which I haven't built yet, is current limited. Furthermore, Q3 has a 10K resistor on its base, and even if one assumed a pretty high gain, I claim that it limits the base current enough so the collector current can't go very high. Anyway, that's my story and I'm sticking to it! But maybe I should check it carefully just to be sure. |
|
|
hayee
Joined: 05 Sep 2007 Posts: 252
|
|
Posted: Tue Dec 08, 2009 11:40 pm |
|
|
I have a circuit for my PIC16f84A which works fine. You may be use this circuit by doing little changes according to your requirements. But I am unable to upload circuit diagram. Can anybody tell me how to upload the image? |
|
|
|