This is a placeholder topic for “Makerverse Nano Power Timer HAT for Raspberry Pi Pico” comments.
Periodically cycles power to your battery-powered projects
Read moreThis is a placeholder topic for “Makerverse Nano Power Timer HAT for Raspberry Pi Pico” comments.
Periodically cycles power to your battery-powered projects
Read moreHow can I read the battery voltage from the connected LiPo battery to deduce battery %?
Thanks!
Hi Manny,
Since the battery voltage can exceed the highest value possible on the Pico’s ADCs (4.2V > 3.3V), you’ll need a voltage divider, and to hook into the VSYS pin (this one is connected to the battery through a reverse-polarity-protection circuit).
You could use a small protoboard to assemble the voltage divider circuit and hook up to the right pins on the Pico:
Keep in mind that the voltage divider would be on all the time, and using a bit of current, so I’d pick high resistance values for the resistors involved.
Let me know if you have any followup questions
How would I add solar charging to the, Makerverse Nano Power Timer HAT for Raspberry Pi Pico?
Hey Pete,
Solar power is easiest with a dedicated manager added onto this one most likely. Using something like the Sunflower Power Manager and wire it up to the input tracks on the power timer as you would need to make sure no power is running through the Pico itself so that it isn’t powering it constantly.
Id recommend using a Solar power Manager as solar projects get crazy complex without them.
Cheers,
Blayden
Hi,
Observation I figured I’d share for others.
Power Cycling the device does NOT reset the timer. I haven’t bothered looking at the Schematic but I’m guessing there is a capacitor in there which keeps the clock powered up for a few seconds.
Just something that was frustrating me until I realized why while testing.
Hi Cameron
Copied from the text on the product
A reset button for the Pico allows you to restart your program on the fly, and a Timer Reset button so you don’t have to wait a full interval (useful for experimenting on the bench)
and
and apply power to the battery connector. The timer will run continuously, consuming a (really tiny!) 35nA, before turning your project on after the set interval. Once your project has completed whatever it needs to do
It looks like the battery will keep the clock going.
Cheers Bob
Sorry, my observation wasn’t clear.
I had out my project in a case where I couldn’t reach the reset anymore (because it needed to be weather proof)
I had assumed that unplugging the battery and plugging it back in would reset the timer for field debugging, turns out that the device holds enough power inside for this to not work and I actually needed to disassemble and reach the reset.
Not a problem now thatI know , but I like sharing my observations for future google-ers
Hi Cameron
I may have mis interpreted as well.
Good idea as long as enough people read this. Could save a lot of hair pulling.
If you really need these often they are probably a simple make switch and you could extend the contacts to a weather proof button mounted on the case
Best of luck finding one of those.
Cheers Bob
It’s in the GitHub repo: CE-Makerverse-Nano-Power-Timer-HAT-for-Raspberry-Pi-Pico/Documents/schematic.pdf
It’s a SPST switch for the enable pin to ground.
Hi Jeff
I think I went down that path before and got this. And still get it.
"Error rendering embedded code
Invalid PDF"
I might be able to get it via the PCB folder and getting “pub.kicad.sch” file into the appropriate place in my computer. But I don’t have an immediate interest in this product so won’t bother
I still think if they want to sell this thing access to the schematic should be a bit easier.
Cheers Bob
It works just fine. Are you sure you are looking in the documents folder and not in the PCB folder?
Hi Jeff
I was looking for the PDF in the documents folder.
I found a KiCad schematic (.sch) file in the PCB folder but did not bother trying to transfer to the relevant part of my computer (Mac).
To date all other PDFs I have tried load and open OK. Not too worried about this odd one as I have no interest re purchase at this time…
Cheers Bob
I did an import of the kiCad file and looks like its the same as the pdf version.
Was there anything specific you where looking for ?
Michael
I would expect it to.
No, I was just going to have a look at it. But when I tried the PDF version I got the error message I posted above. Not really interested enough to go searching for something that could have been provided a lot easier. I did find the KiCad file in the PCB folder ut did not bother about it.
Cheers Bob
Hey @Cameron165290,
Thanks for bringing this to our attention. I have made a note of this and the product page should be updated shortly with a note about this to prevent future users from running into the same problem.
I’ve been playing with the Makerverse Nano Power Timer HAT for Raspberry Pi Pico, but it is only recently that I’ve put it to use in an outside temperature sensor.
My project runs of a 3.7 V Lipo and is using the PICO W to measure the temp using the Piicodev TMP-117. The data is then sent to a MQTT broker and then used in various ways…
My problem was that sometimes my program would hang and the DONE trigger was never set by software.
I used Google GEMINI to fix my program with Try / Except blocks. I still had some hangs…
I realised tht I could use the PICO’s PIO to trigger Pin 22 (DONE) just like a WatchDog timer.
This was an interesting journey in jointly writing PIO code with Google GEMINI as my Mentor. Yes, I still had to debug the AI generated code and learnt quite a bit about PIO along the way.
My final reset project is included should it be useful to others.
PIO_delay.py
# PIO_delay.py
import time
import rp2
from machine import Pin
DEBUG_PIO_DELAY = False
frequency = 125_000_000 # System clock frequency (used by time functions)
# --- delay PIO Program (as defined above) ---
@rp2.asm_pio(set_init=rp2.PIO.OUT_LOW)
def delayed_trigger():
pull() # pull delay value for OSR
mov(x, osr) # use the move OSR to X to transfer a 32 bit value
label("wait_delay") # Loop label
nop() # 1 cycle No OP
jmp(x_dec, "wait_delay") # Decrement X and jump to 'wait_delay' if X is non zero
set(pins, 1) # End of timer. Set trigger pin to HIGH
# Program ends here
# -------------------------------------------------
def enable_PIO_delay(delay_seconds=100, trigger_pin=Pin(22, Pin.OUT)):
#set pin low
trigger_pin.low()
# Get the PIO instance and load the program
# Use a PIO frequency that works for the delay calculation
sm = rp2.StateMachine(0, delayed_trigger, freq=100000, set_base=trigger_pin)
# Calculate the required delay value
delay_value_for_pio = int(delay_seconds * 50000)
if DEBUG_PIO_DELAY:
print(f'Required delay {delay_seconds} seconds, calculated delay value {delay_value_for_pio}')
print(f'Trigger Pin is {trigger_pin}')
# Put the single delay value into the PIO's TX FIFO
# The PIO will pull this value when it starts
sm.put(delay_value_for_pio)
# Run the state machine
sm.active(1)
# test code
if __name__ == '__main__':
default_parameters = False
default_pin = True
if default_parameters:
print('Testing with the defaults : enable_PIO_delay(delay_seconds=100, trigger_pin=Pin(22, Pin.OUT))')
enable_PIO_delay()
elif default_pin:
print('Testing with alternate parameters : enable_PIO_delay(delay_seconds=300)')
enable_PIO_delay(delay_seconds=300)
else:
print('Testing with alternate parameters : enable_PIO_delay(trigger_pin=Pin(21, Pin.OUT))')
enable_PIO_delay(trigger_pin=Pin(21, Pin.OUT))
sample program calling enable_PIO_delay
from machine import Pin
from PIO_delay import enable_PIO_delay
# test code
if __name__ == '__main__':
default_parameters = True
default_pin = True
if default_parameters:
print('Testing with the defaults : enable_PIO_delay(delay_seconds=100, trigger_pin=Pin(22, Pin.OUT))')
enable_PIO_delay()
elif default_pin:
print('Testing with alternate parameters : enable_PIO_delay(delay_seconds=300)')
enable_PIO_delay(delay_seconds=300)
else:
print('Testing with alternate parameters : enable_PIO_delay(trigger_pin=Pin(21, Pin.OUT))')
enable_PIO_delay(trigger_pin=Pin(21, Pin.OUT))
while True:
# normal code in loop here
pass
I’ve tried this on just a plain PICO with a LED on Pin 22 and also on my Outside Temperature Sensor sitting on the NANO Timer Hat. On the outside sensor there is no software setting on Pin 22. Works quite well as a backup reset if the the pico software hangs.
Hey @Peter152717,
Awesome! I’m sure this will be brilliant information for the next person who runs into this issue.
Thanks for sharing that with us!
The reason I had to come up with an alternative watchdog timer is that using the RP2 Micropyhton WatcgDog has a 8331 ms limit between feeding the dog. Eight seconds wasn’t enough.
I discovered that my problem was with the sleep function could hang on the PICO W. Something about the sleep and wifi being the problem.
It took me quite some time to work all of this out, so I just have to share.