CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

operate pic with one push button

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
omenda
Guest







operate pic with one push button
PostPosted: Tue Dec 08, 2009 1:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 1:48 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 2:35 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 2:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 3:14 pm     Reply with quote

Here is a previous thread on the topic:
http://www.ccsinfo.com/forum/viewtopic.php?t=27580

You can find other circuits with Google. Example:
http://elm-chan.org/works/mp3/report_e.html
Example of search string:
Quote:
push button auto power off circuit -patent
John P



Joined: 17 Sep 2003
Posts: 331

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 3:59 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 11:40 pm     Reply with quote

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?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group