Auto Switch off

ZOR

Senior Member
I am trying to make a battery disconnect when a time of inactivity is up. I was trying to find how I could have a 555 timer which has a default time of 3 minutes, but could be continually refreshed when a push button switch is pressed momentarily (taking trigger to low) and discharging timing capacitor back to start. I looked at a monostable circuit but could not find a way to refresh timing.

I could put the Picaxe to sleep, but prefer total switch off, as it's a a remote control. I do not have anything built yet or circuitry, just wanted the timer part solved. Thanks
 

ZOR

Senior Member
I think I have found a circuit. This version looks like it will short out the charging capacitor when re-triggered, so hopefully taking the timer back to zero. Will try

EDIT Does not work as I thought it would, it keeps re triggering!
 
Last edited:

SteveDee

Senior Member
I am trying to make a battery disconnect when a time of inactivity is up. I was trying to find how I could have a 555 timer which has a default time of 3 minutes, but could be continually refreshed when a push button switch is pressed momentarily (taking trigger to low)...
Not totally sure I understand your requirement, but I think you are looking for a re-triggerable 555 circuit. Check the circuit in my blog post: https://captainbodgit.blogspot.co.uk/2013/11/birdboxpicam-2014-2a-activity-based.html

However, you may also consider using a Picaxe 08M2 instead of the 555 timer to do the same thing: https://captainbodgit.blogspot.co.uk/2015/01/birdbox2015-picaxe-controller-details.html

Sorry if I'm a long way off target!
 

ZOR

Senior Member
Many thanks all. Sorry I forgot to put up the circuit I had just tried.

MONOSTABLE.jpg

I thought the start button would short out the capacitor and refresh the time up period, however when time is up it restarts again. I want it to finish.
 

ZOR

Senior Member
Many thanks Buzby. Does the stamp/Picaxe always have power on to initially make I/O high?

Interesting circuit, however I have a 9 volt battery supply going into a 5 volt regulator providing 75mA supply. Therefore I am looking to totally remove the battery during no use, but have a push button to kick into start. I can use the remote control buttons to keep the timer going before it shuts off. Remote buttons go to 0v when pressed.
 

techElder

Well-known member
ZOR, one way to use Buzby's circuit to meet your requirements is to connect the collector of the NPN transistor to another PICAXE input to reset the timeout timer.
 

Buzby

Senior Member
Many thanks Buzby. Does the stamp/Picaxe always have power on to initially make I/O high?
No. When the button is pressed it turns on the 2N3904, which then turns on the 2N3906, which then supplies power to the chip.
When the chip powers up the first thing the code does is set the IO pin high. This keeps the transistors switched on after the button is released.

When the chip is finished doing whatever it needs it sets the IO pin low, which turns the transistors off, which cuts the power to the chip.

Based on this, the PICAXE can use other IO pins to switch other supply rails as needed.
 

SteveDee

Senior Member
Many thanks all. Sorry I forgot to put up the circuit I had just tried.

View attachment 21370

I thought the start button would short out the capacitor and refresh the time up period, however when time is up it restarts again. I want it to finish.
You need to disconnect pin 2 from pins 6 & 7 and connect a diode between 2 and 6/7 as shown in my first link.
 

AllyCat

Senior Member
Hi,

I could put the Picaxe to sleep, but prefer total switch off, as it's a a remote control.
Sorry, but there have been several threads on this and similar topics and IMHO most prove to be "a complete waste of time" and effort. Just put the PICaxe to sleep (or nap) and wake it briefly to check if anything needs to be done. That's the way that virtually all Remote Control handsets work !

Certainly a "classic" 555 timer is not the solution (admitted there are now CMOS versions). A bipolar ic (maybe excellent in its day) that was designed almost 50 years ago. It contains 15 resistors and the primary purpose of a resistor is to consume power, not what you're trying to achieve. In practice, it puts 15k directly across the supply rail to ground, or about half the total power consumed by a PICaxe when it's awake, running at its default speed.

Add a couple of extra bipolar transistors if you must, but have you really looked into the "powet buget" of your application?

Cheers, Alan.
 

ZOR

Senior Member
Thanks SteveDee, I missed that first time round, but that works fine. Thanks also Buzby, will try when I get transistors. Thanks erco I will look at latching relays.

Thanks Alan, I have a regulator tacked on the battery output. I have been looking for a timed circuit where with inactivity everything gets disconnected from the battery. but will stay on while buttons are pressed and maintain the default cutoff time.

Thanks others for coming in.

Regards
 

darb1972

Senior Member
This is an interesting thread, but I'm with Alan on this one. Why add the additional components if not really needed? This will only result in more power consumption. You will never really get the power consumption to zero, but you can get it really low. As Alan suggests, why not use the sleep command? If you are using an X2 you can then wake the PICaxe up with a hardware interrupt or hard reset (this could be button/s). You could then keep the PICaxe active for a certain period of time before putting it back to sleep.

Page 239, Manual 2;

On X2 parts ‘sleep 0’ puts the microcontroller into permanent sleep - it does not wake every 2.1 seconds. The microcontroller is only woken by a hardware interrupt (e.g. hint pin change) or hard-reset. The chip will not respond to new program downloads when in permanent sleep.


lbenson has an interesting project that is still running 9 years on, and I don't believe it even uses the sleep mode http://www.picaxeforum.co.uk/showthread.php?8353-Low-Power-Battery-Backup-Reference-Design&highlight=anniversary

Just goes to show you what might be expected from a well designed project if power conservation is a priority.
 

ZOR

Senior Member
Thanks. The Piicaxe might be happily sleeping, but a regulator which I mentioned earlier will be sucking the battery dry. In my arrangement everything will go off until I press a separate push button.

The remote will be used so infrequently (control position of CCTV camera

Thanks again
 

darb1972

Senior Member
Hello ZOR

If the PICaxe is asleep, what else is the regulator supplying that will "suck" the battery dry? Have you got a schematic? What about a really low powered regulator dedicated for the PICaxe and a logic switched regulator (controlled by the PICaxe upon wake-up) for the remainder of the system? Really need to see a schematic.

Also, you said that the circuit is being used to control the position of a CCTV camera. Can the circuit simply work off the supply (12V?) to the CCTV camera and simply regulate this instead? Even if cabling to your circuit is an issue, provided the coax ran to/past the circuit you could feed DC via the coax (provided you "block" the DC at the signal end/s) which is the same method as powering a mast head amplifier and/or LNB with Antenna and Satellite systems. Basically power over coax. Even if the camera is IP and powered via the CATx cable (power over ethernet) you could "pick" a rail off this.
 

SteveDee

Senior Member
I would avoid relays as they draw mA, so a silicon solution would be preferable.

If your push-button switch could be double pole, I think one pair to switch power onto circuit (which could then latch itself) while the other resets the timer. This arrangement could be zero-power when off.
 

ZOR

Senior Member
Thanks SteveDee, point taken, I am going down erco's suggestion, latching relay (one shot) Regards
 

SteveDee

Senior Member
Sorry, I've got interested in this now.

Here are the bones of an idea.


PowerControl.png

Pressing the button for the first time turns on the mosfet, powers the Picaxe, and the Picaxe sets its output high for x mins.

Subsequence button presses pulls the input low and the Picaxe extends its output 'high' period.

When the Picaxe times-out, the output falls and the mosfet turns off. Standby current is whatever the mosfet 'leaks'.
 

ZOR

Senior Member
That idea looks good, thanks. I wish I knew more about mosfets, and mosfet types. Is the leading transistor there to supply low voltage logic input. I see most mosfets expect high voltage inputs. Real guess from no knowing anything other than what bit I read somewhere.
 

AllyCat

Senior Member
Hi,

It's looks to me as if there is a probable (excessively high voltage) "Phantom Power" issue into the PICaxe input (via the Vgs resistor and diode), using that last circuit. Or the "input only" pin might be pulled up to the "bulk programming" voltage (as it doesn't have a protection diode to Vdd). :confused:

Certainly the power consumed by the reference and control circuits in a regulator ic is often overlooked (significantly more than drained by the 555 timer). So I can see why the circuit proposed by buzby has appeal (it's what I would use in such a situation). Or, ultra low drain regulator ics do exist.

But first I would be asking: Does the PICaxe need a regulator and/or why is the battery voltage higher than a PICaxe can tolerate? If there is some other circuitry that needs a higher voltage, then does that normally drain only nanoamps from the battery? And what is the "self-discharge" (internal leakage) current of the battery that has been chosen?

Cheers, Alan.
 

SteveDee

Senior Member
Hi,
...but first I would be asking: Does the PICaxe need a regulator and/or why is the battery voltage higher than a PICaxe can tolerate? If there is some other circuitry that needs a higher voltage, then does that normally drain only nanoamps from the battery? And what is the "self-discharge" (internal leakage) current of the battery that has been chosen?

Cheers, Alan.
Yes, unless I've missed something, I don't think we have a lot of detail on the users requirements, so my bare-bones sketch gives an idea of how it might work as a controlled power supply to other (unknown) electronics. It is certainly not a working circuit, but with some refinement I'm sure it could be made to work.
 

lbenson

Senior Member
If a picaxe (08M) at 32kHz can run for 9+ years on the same 3 AA batteries, blinking an LED something in excess of 40 million times, and monitoring an input approximately once a second (as in darb1972's link), the question truly is, what batteries are being used and what else does this circuit need to be doing?

Turning off power to the picaxe is not necessarily the thing which will prolong the life of the battery the most.
 

SteveDee

Senior Member
... Is the leading transistor there to supply low voltage logic input. ..
Hi ZOR, the transistor connected to the Picaxe output turns on the mosfet (i.e. causes it to conduct) by lowering the gate voltage to 0V. This would allow us to also turn on the mosfet by connecting the gate directly to 0V via a switch, since the transistor is not damaged in any way by doing this.

The diode is there so that the Picaxe input can rise to some voltage approaching 5V, while the transistors collector voltage is very low (maybe only a few hundred mV or so). i.e. the diode is blocking the flow of current from the Picaxe input resistor back to the transistor collector.

In some ways, FETs/MOSFETs behave in a similar way to thermionic valves (which makes my early years at college worth while!).

I just scratched out this circuit over lunch, so it is far from complete. As Alan says, the 5V reg may not be necessary, and you may need protection for the Picaxe input (possibly a second diode). Also you would certainly need a base resistor for the transistor to limit base/emitter voltage.

Anyway, I hope this is of interest, even if not applicable.

PowerControl2.png
 

ZOR

Senior Member
The battery is a PP3, the regulator output drives a HC-12, drawing 75-80 mA.

I am more than happy to use the 555 despite it's age, with the earlier thread fix and a latching relay. So many thanks I am happy.
 

AllyCat

Senior Member
Hi,

Hmm, I think we really need to see a circuit diagram for that. If the 555 is connected on the "switched" side, it can't do anything that the PICaxe can't do by itself. If it's connected directly to the battery, then are you "happy" that you're hanging 15k continuously across the battery terminals, which Ohms law tells us will drain aound 600uA (by chance almost exactly what a running PICaxe uses) and will drain the battery in a few weeks at best.

But IMHO a "PP3" is probably completely inappropriate for a HC12 anyway. The data sheet says:

"Power supply input, DC3.2V-5.5V, with load capacity not less than 200mA. Note: if the module is working in the transmitting state for an extended time, it is suggested that a 1N4007 diode be connected in series if the supply voltage is greater than 4.5V, so as to avoid overheating the onboard LDO regulator".

A "normal" PP3 is really intended to deliver only a few tens of mA, and most rechargeable technologies have poor "shelf life" (internal leakage). 3 x AAA cells (primary or rechargeable) or a single rechargeable Lithium (3.2 or 3.7 volts) are likely to be far more satisfactory. Certainly some 434 MHz transmitters (and particularly receivers) do need a regulated 5 volts for acceptable "range", but the HC12's ouput power capability is enormously above the Legal UK level, so a 3.3 to 4.5 volt supply should be completely satisfactory.

Cheers, Alan.
 

erco

Senior Member
@ZOR: How long are the "on" times? Are they likely to be ~3 minutes? How many times a day? How much current is being drawn when on? How long will your PP3 last, ideally?

You could use an SCR instead of a latching relay for complete OFF isolation. Simple to latch with a pushbutton to the gate, then use the Picaxe to turn off 3 mins after no activity. A Picaxe pin could directly drive a 20 mA reed relay (NO contacts) to briefly short the SCR's AK pins together to turn off the SCR. Alternatively, if you have a relay with NC contacts put that in series with the SCR and briefly trigger that to break the current to turn off the SCR.
 
Last edited:

darb1972

Senior Member
You could use an SCR instead of a latching relay for complete OFF isolation. Simple to latch with a pushbutton to the gate, then use the Picaxe to turn off 3 mins after no activity. A Picaxe pin could directly drive a 20 mA reed relay (NO contacts) to briefly short the SCR's AK pins together to turn off the SCR.
If you do go this way, I recently used several of these reed relays;

http://au.element14.com/hamlin/he3321a0400/contact-configuration-spst-no/dp/1608136#

Driven directly off a PICaxe (with added diode protection) and with a 500 Ohm coil, it is only 10mA to activate. One issue to consider is that this particular reed relay isn't shielded so avoid close contact with any magnetic fields. I did some tests with two of the reed relays stacked hard against one another (not normally recommended) but fortunately an activated reed relay doesn't seem to activate the adjacent non energised relay. In other words, the magnetic field created by one reed relay coil doesn't seem to cause adjacent relays to false trigger, at least with this particular model.
 

AllyCat

Senior Member
Hi,

The battery is a PP3, the regulator output drives a HC-12, drawing 75-80 mA.
Sorry (again), but when was the last time that you saw a "Remote Control" containing a relay, or even a PP3 battery? The last PP3 I recall in a TV RC used Ultrasonics, around 40 years ago.

Internal Details for the HC12 are a little scant, but it appears to have an internal LDO regulator at about 3 volts for the whole chip (including the power output stage) and not just for the logic core (which PICaxe uses). In that case, any supply voltage above 3.3 volts will just produce wasted heat, either in the HC 12 itself or any external regulator (unless of SMPS type). Nearly all PICaxes work fine around 3 volts, of course.

The HC-12 "standby" current (AT+SLEEP command) is unusually high at "about 22uA", probably because it has a continuously running micro, but that still represents almost 5 years from an AAA battery (900 mAhr), or in excess of ten years from AA cells (> 2 Ahr). It's already been established above that a PICaxe can run for ten years from AA cells, even without "sleeping". So, just connect the HC-12 and the PICaxe directly to a suitable battery (around 3.5. to 4.5 volts) and do all the "power control" with software.

If you really want more than 5 - 10 years of battery life (and have checked for ALL the possible "hidden" causes of power drain), then add a single Logic-Level FET (or perhaps even a bipolar), controlled directly by a PICaxe pin, to break the power feed to the HC-12.

Cheers, Alan.
 

AllyCat

Senior Member
Hi,

I did some tests with two of the reed relays stacked hard against one another (not normally recommended) but fortunately an activated reed relay doesn't seem to activate the adjacent non energised relay. In other words, the magnetic field created by one reed relay coil doesn't seem to cause adjacent relays to false trigger, at least with this particular model.
Yes, the magnetic field strength inside a "solenoid" (long thin coil) is much higher than outside.

BUT, the test you should do is to energise both relays and then switch off one of them. The "must release" voltage is only 0.5 volts, so only 10% of the nominal operating magnetic field strength. Many reed relay coils do have an external shield to reduce crosstalk (and improve their own sensitivity), but the data sheet for that device appears to have "moved".

Cheers, Alan.
 

darb1972

Senior Member
Hello Alan

Thanks for the tips. I will carry out that test. I looked all through the data sheet and application notes on the manufacturer's web site for parameters on segregation of devices but found zip. I wrote to the manufacturer with the same questions but also failed to receive an answer.

I thought my initial test was sufficient but as you point out, there might be a latching issue. I have used two of these in a recent design and failing to obtain any data on segregation I spaced my units about 30mm apart. Based on my test (components stacked together) I thought my design would be ok but I'll now have to double check things based on your suggestions.

As always, thanks for your valued input Alan.

Regards
Brad
 

AllyCat

Senior Member
Hi Brad,

Well, I did find the data sheet and the fact that they offer an external screen as an "optional extra" may suggest that there is the possibility of interaction between adjacent relays. But there's a world of difference between designing a one-off hobby project and something for mass production.

FWIW, I almost "cut my teeth" on reed relays when they were first being designed into the latest (then) telephone exchanges, to replace the "open frame" relays and uniselectors, etc.. One of the "Old School" GPO (General Post Office, now BT) engineers asked what "routine maintenance" they'd need, to which the reply from our engineer was "Well, you can blow the dust off with an air line every 10 years or so if you wish, (but it will make *** all difference)".

Apologies to the OP for taking this thread Off Topic; I'd still like to see what the final design looks like.

Cheers, Alan.
 

darb1972

Senior Member
Before I get too far into my reply, I also apologise for taking this a bit "off topic", but then again, there is some relevance as erco suggested a reed relay as part of one solution, and, reed relay segregation (if using more than one) in addition to shielding and external EM and magnetic influences could play a part in design. It's certainly worth discussion.

Now that the Sun has risen in my part of the world I'll carry out that test and report back.

As for the technical term "but it will make *** all difference", I also hear that in my part of the world too, which demonstrates that we all think along the same lines when it comes to troubleshooting issues or carrying out routine maintenance. :eek: :p
 
Last edited:

darb1972

Senior Member
Hi Alan

I have carried out the test as described earlier. The reed relays all behaved correctly and there was no residual latching (thankfully). The relays were put under test while adjacent to (hard against) one another.

Fortunately there is no need for shielding and although I've segregated the relays in my design, one might get away with stacking them next to one another (although I wouldn't recommend it).

Anyway, that information might be useful to someone.

Thanks again Alan.

Regards
Brad Hawkins
 

premelec

Senior Member
It occurred to me recently using a "Battery Bank" unit which has a lithium battery and step up to 5 volts that these can be used for auto off... They start when a certain load is added and then turn off if the load is removed for 10 seconds or so - they require a certain current to _stay_ on. A common PICAXE circuit doesn't draw enough current to keep the unit on... you can keep it on by occasionally pulsing the PICAXE current higher and when you stop doing that it will turn off... The circuitry is integrated into the "Battery Bank" and can be obtained in some units without a battery installed for very little money... The actual keep alive current must be determined empirically as would high current pulse width value [seems very short].
 

erco

Senior Member
premelec: Thanks for that observation, that's an awesome idea. I'm starting a project now and was about to build a mosfet switch & blah blah, but you just saved me a bunch of time!

Edit: I spoke too soon. The circuit in my cheapie ($1) 18650 powerbank draws 3 mA even with no load attached, it's always putting out 5V. That would self-discharge my 600 mAH battery in ~8 days even without any use. Back to the mosfet and a Picaxe pin!
 
Last edited:

premelec

Senior Member
@erco - I'll have to check that - I bought some of the yellow cheapies and I don't think they've discharged that much - maybe only when they have a load plugged in and are looking for current draw... It's the 'off' current when their light quits - are you using an averaging meter [d'arsonval] or peak reading digital device? I haven't used a scope on 'em - just assumed it was programed to look for a load with short pulse... However the MOSFETs work fine...

I just checked a box of units I charged over a year ago and have been stored; most were about 4 volts - though one of dubious ancestry [says 4000 MaHr!] was 1.65 volts. These had nothing connected to output circuits - so further investigation looks appropriate... I also have a 4000 MaHr rectangular battery bank [from Walgreens a couple of years ago] which stays up on storage...
 
Last edited:
Top