Auto Power Off for MCU
Posted: Sun Apr 12, 2020 8:57 pm
An Easter (and (sadly) covid-19 project...
This started as a project for work - I need to record various info (time, temp etc) on a user input.
I wanted battery power - which meant an auto shut off.
So - to demonstrate - I created a thermometer (currently o.o.s. everywhere) - press the button, top left. This connects to a Zero Power switch (NanoTech) - though several YouTube videos display a way how to do similar using a thyristor and a (smaller) handful of discrete components.
This passes the power to a LM7805 voltage regulator which powers the Arduino - in this case a Nano (although my ultimate aim is an ATTiny85 with i2c eeprom and RTC)
The Arduino here powers a DS18B20 sensor using pin D2 as power (gnd is next door for convenience) and D8 as data (there is a 4k7 resistor between them) D6 is connected to the power swicth with a pull up resistor (570kOhm) to give a weak pull-up. Pulling this pin low turns the power (and thus the board) off. Because of the time the Arduino takes to 'boot' up - pulling the pin high takes too long to hold the power on - hence the pull-up to latch the power on after the momentary button press.
Here the temperature (and a 60s countdown) is displayed on an i2c OLED display (thanks to medelec for the conversion code - but why does the one wire component only give raw data ?)
The Arduino is powered for 60s (to give the temperature time to stablise) before shutting off - to be powered by a pp3 or 6 x aa batteries (in the photo it is wired to a bench power supply)
I am tempted to create the smallest component - a PwrPin property and a PowerOff macro!
Martin
This started as a project for work - I need to record various info (time, temp etc) on a user input.
I wanted battery power - which meant an auto shut off.
So - to demonstrate - I created a thermometer (currently o.o.s. everywhere) - press the button, top left. This connects to a Zero Power switch (NanoTech) - though several YouTube videos display a way how to do similar using a thyristor and a (smaller) handful of discrete components.
This passes the power to a LM7805 voltage regulator which powers the Arduino - in this case a Nano (although my ultimate aim is an ATTiny85 with i2c eeprom and RTC)
The Arduino here powers a DS18B20 sensor using pin D2 as power (gnd is next door for convenience) and D8 as data (there is a 4k7 resistor between them) D6 is connected to the power swicth with a pull up resistor (570kOhm) to give a weak pull-up. Pulling this pin low turns the power (and thus the board) off. Because of the time the Arduino takes to 'boot' up - pulling the pin high takes too long to hold the power on - hence the pull-up to latch the power on after the momentary button press.
Here the temperature (and a 60s countdown) is displayed on an i2c OLED display (thanks to medelec for the conversion code - but why does the one wire component only give raw data ?)
The Arduino is powered for 60s (to give the temperature time to stablise) before shutting off - to be powered by a pp3 or 6 x aa batteries (in the photo it is wired to a bench power supply)
I am tempted to create the smallest component - a PwrPin property and a PowerOff macro!
Martin