11 ms·
> UNOs are notoriously power-hungry... Maybe with some advanced deep-sleep-cycle, but I'd love to know more about this. The naive Arduino code has two basic fu
by LeifCarrotson 8y ago
> UNOs are notoriously power-hungry... Maybe with some advanced deep-sleep-cycle, but I'd love to know more about this.
The naive Arduino code has two basic functions setup() and loop(). Putting your main code in loop results in a busy wait that spins up 100% of the CPU all the time. It's also running all the peripherals all the time.
You want to use "avr/sleep.h" and "avr/power.h" to put the processor to sleep with peripherals off (except the one which will wake up the processor). See http://www.gammon.com.au/power http://www.gammon.com.au/power for a nice tutorial. Opening these headers and their source in the avr-gcc libraries and comparing to the documentation on the processor is a good exercise in getting right down to the metal of how the processor manages power.
You also want to get rid of the ancient 7805 regulator; many clones use a better LDO voltage regulator to alleviate the problems with high standby current.