- Now using the Badger OS functions to implement sleep & wake up
- https://github.com/pimoroni/badger2040/blob/main/docs/reference.md#button-presses
- https://github.com/pimoroni/badger2040/blob/main/docs/reference.md#real-time-clock
- Hopefully this will lower battery consumption when halted
- Wake method (O = Other, B = Button, R = RTC timer trigger) is displayed on top line along with WiFi (C = Connected) status
- As always has a load of debug messages that can be toggled on or off
- Reads humidity and temperature based on parameters using the BME280
- Currenty every 30 mins
- Most parameters are ajustable in paramters.json file
- Logs readings to MariaDB using a simple REST interface
- Humidity
- Temperature
- Power source (USB or Battery)
- Power Level in Volts
- Parameters for 'Full', 'Empty' and Change Battery'
- See images for graphs created using logged data
- Sends emails for:
- Out of bounds humidity readings
- Battery level and change warnings
- uses the umail class by https://github.com/shawwwn
- At end of run puts device in to deep power saving sleep until retriggered by button or the RTC
- now using Badger OS functions (pcf85063a) to implement RTC wake up
- Now implements badger2040.sleep_for(minutes) rather than Pico machine.deepsleep
The netmanClass.py contains a simple WiFI connection class and methods for reading power source and levels. They are contained within the Wifi class as power source and power levels use some common GPIO functions.
The code contains a lot of DEBUG print statments to REPL that can be enabled / disabled at start of code.
- Processor Pimoroni Badger 2040 W
- I2C Sensor Pimoroni BME280 Breakout - Temperature, Pressure, Humidity Sensor
- Battery Pack Battery Holder 3xAA with Cover and Switch - JST Connector
- Micropython pimoroni-badger2040w-v1.19.16-micropython-with-examples.uf2
- Case Badger2040 Enclosure 3d Printed Case
- Web HTML graphing Apex Charts with PHP and Javascript
- Micropython eMail Alerts umail class by https://github.com/shawwwn
A picture:
Graphing output on web, red is out of bounds alert: