Automatic turn off


Closed Thread
Results 1 to 23 of 23
  1. #1
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43

    Thumbs down Automatic turn off

    I have made a nifty timer for my wife's new knee rehab exercises. She often forgets to turn it off, so I have programmed it to cry (beep slowly) if it has no activity for 1 min.

    But I think it would be better to rig an automatic turn off. I have tried with a transistor wired to both 5v plus and neg. so that a pin output to the base shoud keep it on for a defined term after a button starts the circuit. All attempts fail to turn it on or else to turn it off.

    The unit is battery operated, so I don't want to use a relay. I have the circuit down to about 6ma, and don't want to add 30ma or so.

    Any one have any ideas?

    Thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Solution

    Melanie:

    Thanks for the help.

    I want to eliminate a need for an "on-off" switch, only a push button on, and auto off after a period of inactivity. I will be using 9 volt batteries, therefore off needs to very close to 100% off. 9v batteries provide a rather wide range of voltages, depending on the type, alkaline, ni-cad., or nimh.

    Starting with the information you provided, I developed the attached schematic, which works fine. On the way, I thought I had it worked out with an 8v battery, but the off current went way up when I tried 9 volts.

    I figure the "off" current (according to Fluke) is between .1 and 1.4 uA, depending on the battery, which seems acceptable. Most of the "leak" is through the bias resistor.

    AMay
    Attached Images Attached Images  

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    If you want to save power you should get rid off the 78L05 and use a better one.

    You could also run your pic straight from 3 AA cells in series(4.5V), the pic consumes only a few uA at 32kHz. The AA cells should last a few years. 32kHz should be enough for beeping and counting time.

    Your project would then be reduced to.....

    1 Pic
    2 capacitors(for the crystal)
    1 32kHz crystal
    3 AA cells
    1 button
    1 beeper

    ..... if you accept a bigger timeerror you could get rid off the crystal and use the builtin oscillator of the pic. The 16F627/8 has a 37kHz(ish) oscillator, the more modern pics with nanowatt should be even better. Using one of theese would reduce the project even further....

    1 Pic
    3 AA cells
    1 button
    1 beeper

    ... it won't get much simpler than that.

    /Ingvar

  5. #5
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Better Voltage Regulator?

    Thanks, Ingvar. That is just the kind of help I need.

    I gave some effort to using AA cells, and decided that it was not practical. This device will be passed on to others who may not have a screwdriver, and would be hard pressed to replace the batteries. On the other hand, I can buy an enclosure with a separate hatch for a 9v battery that will be easy for anyone to change.

    I am using the internal oscillator in the chip, as the time is plenty close enough.

    You are right about the 78L05 using much of the power. As best I can figure, it uses about 3 ma of the 4.5 ma current. There is also a flashing led (so the user knows something is happening) and a buzzer, but they are on for such a short time their current does not matter much. But I don't know about a better voltage regulator. What do you suggest.

    Thanks for your help.

    AMay

  6. #6
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    For my last project I have used the LP2950. (TO-92 Plastic Package).

    * * *

    National Semiconductor Corporation

    The LP2950 and LP2951 are micropower voltage regulators
    with very low quiescent current (75 µA typ.) and very low
    dropout voltage (typ. 40 mV at light loads and 380 mV at
    100 mA). They are ideally suited for use in battery-powered
    systems. Furthermore, the quiescent current of the LP2950/
    LP2951 increases only slightly in dropout, prolonging battery
    life.

    http://www.national.com/pf/LP/LP2950.html
    http://cache.national.com/ds/LP/LP2950.pdf

    * * *

    For the LED, remember that a short flash will be
    enough because of the "persistence of vision" of
    the retina.

    * * *

    Luciano

  7. #7
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Voltage regulator

    Thanks Luciano. I'll try one.

    This is my first experience on this site.

    What a deal!!

    AMay

  8. #8
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Finished

    I have finished my timer project, and I think it came out pretty well. Pictures attached. As usual, a project starts out very simple, but when you find it necessary to accommodate humans, things get more complicated.

    First, I determined that the user needed to see some continuing action for reassurance that the unit was working, so I added a flashing led. Also, some means of resetting, or starting over, so you don't have to wait 'till the time runs out to begin again. This was done by the program.

    I found that the sonalert buzzer needed to be glued to the case, lined up with matching hole. I first tried putting it on the circuit board, but the sound was muffled too much. I used Goop glue, which seems to stick to everything.

    I liked the result so much, I made two. One to pass along with a 9 volt battery, and one to keep. The keeper has a 3.6 volt lithium battery with wire leads soldered to the board. I figure that the lithium battery will last over 1000 hours. The PIC uses about 1.7 ma, and the buzzer and led are not on very much of the time.

    The off current is not measurable by the equipment available to me. My Fluke meter reads .1- .2 ua, either in or out of the circuit when it is "off."

    I appreciate the help and advice I have received. Thanks to all those who offered suggestions.

    AMay

  9. #9


    Did you find this post helpful? Yes | No

    Smile Turn... off

    Hello,

    Where I connect the load in the circuit done by melanie.

    Thanks
    Attached Images Attached Images  

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The 'load' is connected between the Collector of Q1 and 0v.

  11. #11
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    I ended up using a SPST switch on mine....

    They sell these dirt cheap all over the place... with 20 MILLs and less to operate...

    I put the switch to make contact across the Terminals, and as soon as the contact is made, the PIC stuck 20 mills across the load to keep it on. The you can do whatever you want....and the PIC will turn it off 100 percent. run 3 1.5 volt batterys and presto...

    Attached is a image... Please do admire my artistic abilities...<chuckle>

    Dwayne
    Attached Images Attached Images  
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i hope one day i'll be able to do nice schematic like that. I really need to trash my P-Cad and use your software instead
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13


    Did you find this post helpful? Yes | No

    Smile Question

    Hello mister E

    I am using PICBASIC COMPILER 1,45 and the following one I cosay does not work, I want to me to ignite the LED in pin2 by 1 minute and as soon as another minute is extinguished and continue the sequence but does not work to me, some suggestion.

    I am using a PIC12F675.

    Thanks


    'code

    Symbol Mi = B0
    Symbol Se = B1

    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1

    Pin2 = 0 ' turn off lamp - off or 1 minute
    For Mi = 1 to 1 'minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1 ' test LED
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next

    Pin2 = 1 ' turn lamp on - on for 1 minute

    For Mi = 1 to 1 ' minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next

    GoTo TOP







    Quote Originally Posted by mister_e
    i hope one day i'll be able to do nice schematic like that. I really need to trash my P-Cad and use your software instead

  14. #14
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello leonardo,

    I think I understand what you are trying to do... Try this...This is assuming your previous code compiles... I do not have PB, I only have PBP.

    Dwayne

    Code:
    'code
    
    Symbol Mi = B0
    Symbol Se = B1
    
    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1
    
    Pin2 = 0 ' turn on lamp - 1 minute
    For Mi = 1 to 1 'minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1 ' test LED
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next
    
    Pin2 = 1 ' turn lamp on - on for 1 minute
    
    For Mi = 1 to 1 ' minutes
    For Se = 1 to 60 ' seconds
    Pin1 = 1
    Pause 500
    Pin1 = 0
    Pause 500
    Next
    Next
    
    GoTo TOP

    Try something like this:

    Code:
    'code
    
    Symbol Mi = B0
    Symbol Se = B1
    
    TOP:
    Dir2 = 1 ' make Pins 2 and 1 outputs
    Dir1 = 1
    
    Pin2 = 0 ' turn off lamp -  1 minute
    Pin1 = 1' Turn on Lamp 
    For Se = 1 to 60 ' seconds
    Pause 1000
    Next
    
    Pin2 = 1 ' turn lamp on - on for 1 minute
    Pin1=0 'turn Lamp off for 1 minute.
    
    For Se = 1 to 60 ' seconds
    Pause 1000
    Next
    
    GoTo TOP
    Last edited by Dwayne; - 21st September 2005 at 19:22.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  15. #15


    Did you find this post helpful? Yes | No

    Default

    Leonardo,

    See your other post in the General forum.

  16. #16
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Pin 0 & 1 are comparators by default

    You need to change their mode as part of your a setup

    Try:

    poke $19, $7 'to disable comparator mode for pins 0 & 1

    See the manual regarding these pins as comparators.

    When used as comparators, the 12f629/75 make a great op-amp. It is on or off, no slope, and the turn on can be "smart. I made an "on at dark" light switch that stays on only 4 hours.

    AMay

  17. #17
    TK5EP's Avatar
    TK5EP Guest


    Did you find this post helpful? Yes | No

    Default Where is your final solution ?

    Did not find your "final solution",
    Could you post it again ? It might interest other people too.

    Thanks,

    Quote Originally Posted by AMay
    I have finished my timer project, and I think it came out pretty well. Pictures attached.

    AMay

  18. #18
    Join Date
    Aug 2005
    Location
    Houston, TX
    Posts
    43


    Did you find this post helpful? Yes | No

    Default Final solution - Automatic turn off

    The attachment to my original message got lost it seems, so here it is.
    Attached Images Attached Images  

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by AMay
    The attachment to my original message got lost it seems, so here it is.
    In the past I tried with mosfets but the results were disapponting.

    Then I used an PNP transistor much like Melanies post. I think that circuit as was presented by Melanie is the best up to this moment.

    Ioannis

  20. #20
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Question on/off

    Hi

    Why not use a simple regulator with Enable pin ??? ( i.e LM 2941 ...)

    Alain
    Last edited by Acetronics2; - 6th February 2006 at 08:58.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  21. #21
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics
    Hi

    Why not use a simple regulator with Enable pin ??? ( i.e LM 2941 ...)

    Alain
    Because at least 300uA is needed when in OFF state!

    Still the previous circuit with an PNP like BC557 or BC856/7/8 is the #1.

    Ioannis

  22. #22
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink and, moreover saying "papa and mamma" ...

    Ioannis,

    this was an Example .... have a look to other brands too ( Micrel 29xxx ( 1µA ) ... etc, etc ).

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  23. #23
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Hi Alain. No offense :-)


    300 uA or even 1uA might on some cases be too much. With the BC857 that I mentioned I could not measure the leakage current with the Fluke 179 multimeter (as voltage across a R).

    Ioannis

    P.S. On the real circuit, note that the PCB has to be cleared from solder because the leak may be more than the electronics in some cases!

Similar Threads

  1. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  2. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  3. Help with PIC project
    By davekav in forum General
    Replies: 3
    Last Post: - 17th April 2008, 23:15
  4. Interface for 16f818
    By davekav in forum Serial
    Replies: 4
    Last Post: - 17th April 2008, 11:33
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts