Arduino: Energy Saving
This is a useful and short script, which makes the Arduino use less power. Besides the code, there are some other tricks that prevent a waste of energy.
For a more detailed description visit my website:
I used some basic tricks in the code to save energy:
- Disable all unused devices (e.g. turn off LED's).
- Set all unused pins to "INPUT".
- Turn off ADC (analog to digital conversion) if it is not in use.
- Set Arduino to sleep mode (focus of this code) In this script I want to wake up the Arduino by a button interrupt.
Aditional software tricks are:
- Reduce clock speed
- Turn off brown-out enable in software
- If you have any questions about the interrupt, please visit: https://www.arduino.cc/en/Reference/Interrupts
- If you cannot use pin 2 or pin 3 on your Arduino, please visit: http://playground.arduino.cc/Main/PcInt
This project is licensed under the GNU GPLv3 open source license. Thus anybody is allowed to copy and modify the source code, provided all changes are open source too and the author is in knowledge of all done changes. This can happen either via eMail or directly on GitHub, in other words at this repository.
I am not responsible for anything in conjunction with this project, including bugs, failure, fire, harm of equipment and harm of persons. Reasonably foreseeable misapplication:
- Bug in the code
- Failure of used parts due to a bug in the code or a wrong wiring diagram, including a wrong design.
- Fire due to a wrong wiring diagram, including a wrong design.
- Harm of equipment, meaning third party parts (cameras, flashes, etc.) due to a bug in the code or a wrong wiring diagram, including a wrong design.
- Harm of persons due to any failure of the system, a wrong wiring diagram or a wrong behaviour.
It is your own responsibility to use these contents. Be careful, this project includes lethal electrical voltage. Put yourself in knowledge about the risks before you start with this project.