PDA

View Full Version : Automatic turn off



AMay
- 2nd August 2005, 22:41
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

Melanie
- 2nd August 2005, 23:02
http://www.picbasic.co.uk/forum/showthread.php?t=57

AMay
- 9th August 2005, 19:56
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

Ingvar
- 10th August 2005, 15:45
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

AMay
- 13th August 2005, 00:28
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

Luciano
- 13th August 2005, 10:56
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

AMay
- 13th August 2005, 17:47
Thanks Luciano. I'll try one.

This is my first experience on this site.

What a deal!!

AMay

AMay
- 13th September 2005, 20:49
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

Leonardo
- 19th September 2005, 19:58
Hello,

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

Thanks

Melanie
- 20th September 2005, 15:32
The 'load' is connected between the Collector of Q1 and 0v.

Dwayne
- 20th September 2005, 20:21
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

mister_e
- 21st September 2005, 05:40
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 :)

Leonardo
- 21st September 2005, 19:43
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








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 :)

Dwayne
- 21st September 2005, 20:18
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

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

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

CocaColaKid
- 21st September 2005, 20:21
Leonardo,

See your other post in the General forum.

AMay
- 22nd September 2005, 05:52
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

TK5EP
- 5th October 2005, 12:37
Did not find your "final solution",
Could you post it again ? It might interest other people too.

Thanks,


I have finished my timer project, and I think it came out pretty well. Pictures attached.

AMay

AMay
- 4th February 2006, 07:32
The attachment to my original message got lost it seems, so here it is.

Ioannis
- 6th February 2006, 07:51
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

Acetronics2
- 6th February 2006, 09:49
Hi

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

Alain

Ioannis
- 6th February 2006, 10:11
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

Acetronics2
- 6th February 2006, 10:45
Ioannis,

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

Alain

Ioannis
- 6th February 2006, 13:31
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!