Notifications
Clear all

External Power on/off control circuit.

126 Posts
5 Users
9 Likes
5,450 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@byron Do y'all know what a DS3231 is and does? All your requirements are met by it. All that is needed is to provide @davee 's magic circuit that the DS3231 will trigger at the programmed time that will power on the PICO. See pics for size. I would not worry about daylight saving time, it is being eliminated soon. That CR2032 battery powers that tiny board for 8 years. You set the time using a sample program called DS3231_set with a couple of trivial modifications. This only needs to be run once every 8 years or more accurately once each time the onboard battery is changed.

I just checked the cost on AliExpress, under $2 USD

IMG 7402
IMG 7401

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

Posted by: @will

@zander 

Not me, I'm outta here before the Daleks show up !

I know that one.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

@will,

    You can't leave if the Daleks are coming ... not with a name like Will ... don't you remember William Hartnell?

We will all be Ex-Term-Inated!


   
byron reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 

@davee 

I am Dyslexic of Borg ...

Your ass will be laminated !

Anything seems possible when you don't know what you're talking about.


   
byron reacted
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
Topic starter  

Posted by: @zander

Do y'all know what a DS3231 is and does? All your requirements are met by it

Sounds very promising.  Apart from setting the time I presume it can be set to tigger at periodic intervals.  

So we need a circuit that can buck/boost the batteries to something acceptable to the pico, can sense a DS3231 pin is signalling times up,  a latching mechanism to keep the power flowing to the pico and a way that the latching can be removed to power down the pico when it signals the time is nigh.  Or something like that.   I'm getting quite hopeful again.  

I'll peruse some info on DS3231.  I thought it was just something that had to be connected to a microprocessor that could then extract the clock time, but its seems it can do more 👍  


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@byron Yes it can be set to trigger by itself at various intervals, but this application has a minor twist. There will be a time of last hoot hard coded in the PICO and when the DS3231 wakes the PICO at that time (probably only need to check the hour) the PICO then tells the DS3231 to sleep for 18 hours.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 

Would something like this be suitable (where the switch is replaced with the RTC) ? Or would it suck up too much power ?

https://electronoobs.com/eng_circuitos_tut61.php

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@will The circuit needs a push button or sensor, so I guess the DS3231 alarm pin going HIGH can do that assuming the Q5 transistor is one that will work with that logic level but the grounds of the DS3231 and this add-on circuit will need to be connected. I think PapaJoe needs to chime back in, is all this affordable for the project with $0 budget and is battery life perhaps measured in years now all that important? Since we don't know how long the speaker battery life is, the volunteers may need to be on-site to change that battery sooner in any case. I am fairly certain @PapJoe0418 will remind us again of this project's cost limitations. I am also unsure of what effect desert temperatures will have on AA batteries.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
Topic starter  

Posted by: @zander

@byron Yes it can be set to trigger by itself at various intervals, but this application has a minor twist. There will be a time of last hoot hard coded in the PICO and when the DS3231 wakes the PICO at that time (probably only need to check the hour) the PICO then tells the DS3231 to sleep for 18 hours.

Ron, it may be applicable to the owl hooting, but this is a separate exercise on a separate topic to see what can be done for the powering a rpi pico with its dubious sleep current drawer.   I hope I can use them in place of my current esp8266 based Cricket to attach a few more sensors, but still get an extended battery life.  I don't expect to achieve 3 months, but a month would be good, and could possibly be a lot longer with a Lipo and the addition of solar charging.  But the use of just AAA or AA batteries is very useful. 

Somehow I've amassed about 15 of the little pico blighters, mainly for use with ili9341 screens, but I've got a surplus for sure and it would be useful if I could could use them with with an extended battery life via a useful sleeping ability.  If it turns out to be a winner we can feed it back to our owl hooter to give further options.

 

This post was modified 1 year ago by byron

   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
Topic starter  

Posted by: @will

Would something like this be suitable (where the switch is replaced with the RTC) ? Or would it suck up too much power ?

https://electronoobs.com/eng_circuitos_tut61.php

I had a quick look, it seems along the right lines, but without the added ability ability to adjust for the batteries being used.  Is it possible for a circuit to cater for giving it just one AA battery, (boosted) but also to be able to have 4 AA batteries used (bucked and boosted) to give a longer power life if required?  Will it suck up too much power? such questions are over my head right now. But thanks for the link.

 


   
ReplyQuote
(@papajoe0418)
Member
Joined: 1 year ago
Posts: 33
 

Sorry, I was mulling about outdoors, pinin' for the fjords.

Posted by: @byron

a latching mechanism to keep the power flowing to the pico and a way that the latching can be removed to power down the pico

I'm curious that no attention has been given to this comment by @byron re: latching. I don't know the answer but I sense that the RTC is not it. There are self latching relays, I know, so being a convoluted thinker, I wonder if the rpi Pico, having done its dirty deeds, could itself send the second signal to the relay to unlatch and, in effect, aid the Pico in an assisted suicide. 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@byron I hear you. I also have about a dozen PICO's, half with WiFi. I also have a couple PICO UPS boards some with a display but I haven't done much with them due to my health issues for the last siz months.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

Hi @byron, @zander, @will,

I obviously haven't done this myself (yet anyway) ... so I thought I would start with a simulation of the concept.

image

Of course, this not the same as the real thing, but hopefully is a start - no liability for mistakes, oversights, etc on my part.

Looking at the circuit diagram:

Right half

has a battery, nominally 3.7V .. essentially any voltage that is Pico friendly, as this is its power source.

To represent the Pico, there is a 30 Ohm resistor, assuming it is working very hard when switched, taking 100+ mAmps

The P channel Fet, labelled M, is the power switch ... equivalent to the contacts of a relay, (if you were using a relay to switch the power.)

The resistor R-current_measure, is a 1 microOhm resistor, only there as a cheap Spice trick to measure the current being drawn from the 3.7V battery (I know its not the official way of measuring current in Spice 😮 )... just assume its a bit of wire.

R1 the 100k resistor is designed to make sure the gate of M1 is at the same potential as the source, when no current is being driven from any circuitry to its left.

Note that the gate to M1, has a label, Control_in, which makes it easy to find the voltage on the Spice graphs, etc.

---------------

Left Half

This basically represents the RTC, or any other magic source of wake up pulse.

The RTC itself, in this concept sim, is the voltage source V_RTC output, which outputs

0 V for the first 2 ms,

  then  3V until 50 ms,

   after which it is back to 0V for the rest of the time (up to 100 ms)

This implies that the Pico will be powered for a period of 48 ms, starting 2ms in.

--

Note that I have shown an NMOS FET, labelled M-optional ... its job is to allow the PICO supply voltage to be different from the RTC supply voltage. My previous glancing at the DS3231 suggested its alarm output may have been 'toughened up' to allow it to be connected to a circuit with up to 5V. In which case, it might be possible to dispense with this transistor, and connect the RTC out directly to M1 gate. But please note I haven't read it properly, and this circuit is flexible if you decided to use a differnt wake up source, such as 3.3V logic or even an ESP32!!

------------

As I say, this is a concept circuit, not a proven one. The Pmos FET type was one in the LTspice simulator list, not necessarily available, the NMOS one is a totally fictional type, and I would advise adding decoupling capacitors to the Pico power input.

-----------

The small box on the far right shows the current drawn from the Pico 3.7V battery corresponding to the times of the two cursors at times of approximately 30ms and 88ms, in the graphs.

At 30mS, current is 123.31 mA  .. compare to 3.7 (v) / 30 (Ohms) = 123.33 mA, the value if the FET was zero Ohms. Of course the actual value of FET resistance will depend upon the chosen device .. it will be important to choose a device with a low Rds when the gate voltage is equal to the lowest volltage that Pico battery will fall to before being charged or replaced.

And at 88 ms, current is 51.3 nanoAmps .... that is not going to drain the battery in a hurry!

---------

As the power to the Pico is totally controlled by the RTC in this simple concept, implying the RTC will always supply power for long enough for the Pico to safely finish what it is doing, and not mind its power fading away without warning. 

You may be happy with this, if you can preset the 'power on' period at the RTC to a sensible value .. maybe 2 seconds ... or you may wish to have a more interactive approach, in which the Pico effectively reprograms the RTC when it is ready.

---------

The LTspice schematic file is attached, if you wish to play with it

... LTSpice is free from the Analog Devices website.

 

Let me know if it makes sense or if you have any questions.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@davee Sorry Dave, you have a fundamental error. This device is just supposed to turn on the power to the PICO, the PICO will take as long as it needs to do whatever and then send a signal to a device like this turning it off. @will posted a solution that we then modified in a chat about how to use the RTC alarm pin to turn on the PICO. That circuit also has a connection to the PICO that is the turn off signal. Just change the schematic Will provided and replace the push button with a MOSFET, gate going to the RTC alarm pin.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1122
Topic starter  

@davee @zander, @will, @papajoe0418

Thank loads for that circuit and the explanations.  It will take a little time to digest and I'm sure I will have some questions about it once I'm more familiar with how the circuit works.  I also need to have a look at the DS3231.  A google shows lots of different ones, so theres a bit of reading and deciding which one to buy.  (and thanks to @papajoe0418 for his thoughts regarding latching relays, I will probably have to have a look at those too - lots to read up on 😀 )

I did have a play with spice some years back when I was endeavouring to learn a bit about electronics. (still in the endeavouring phase 🙂).  At that time I had better luck in using a package called iCircuit on my mac.  I will either have another go with spice, your image looks to be better than I remember it, or try to translate it to iCircuit which may have the benefit of making me think hard about the circuit as I'm doing it.  iCircuit is probably a bit on the noddy side though.

In the meanwhile I do have a question.  Do you know of a suitable buck/booster board to buy that will allow for various battery loads to be used, which will maintain a suitably stable voltage when the battery pack's voltage diminishes over time.   Is it a case of getting different buck/boost boards suitable for the expected batteries to be used.  e.g one for when 2 AA batteries are being supplied and another if 4 AA' are used?  Do they provide the stable voltage required?   I think your circuit caters for the situation where the power that can be provided drops too low, but I need to study it much more to understand whats going on.

You've given me lots to chew on, its been very helpful. 👍 

 


   
ReplyQuote
Page 2 / 9