Low-power alternative to Arduino, for simple project

I have a really plain Arduino project: ultra-sonic sensor HC-SR04 returns distance which is then used as sleep time during a LED-wave effect. So it's a simple distance <-> LED-wave velocity relation. The closer you walk towards the device, the faster the LEDs. That's all.

The current being drawn when not running LED-wave and just checking 5 times per second if the distance is lower than 2 meters: 15 mA. This value is in my opinion huge.

I then heard about ESP-8266. It can fully replace Arduino. However the power levels are still not good enough. Browsed more, read about Teensy and others, and they all draw power like a crazy – it appears like this if only a person thinks about using batteries for a moment.

I think that professionals know the solution. Hobbysts are stuck in very fun Arduino world.

Can someone reveal the truth? There must be an answer as e.g. computer mice can run months on two AA. Or, for example, a shopped motion-detection-triggered lamp nicely worked for 7 days before I got bored with it and have put it into drawer. The lamp was giving actual light, not LED blinks, and didn't drain the three AAA batteries it used.

What can I use for my plain project? Need ping functionality for HC-SR04, 8 pins for LEDs and that's all. How to do this correctly and have battery lasting for months?

• Read up on the sleep modes of the ATmega328. If you sleep most of the time, and only wake up to check distance, you will save quite a lot of power. I think you will find that ultimately, the LED current will swamp all other power consumption. – uint128_t Dec 18 '16 at 21:08
• "... ESP-8266 ... the power levels are still not good enough." - If by "still not good enough" you mean "about 10 times worse" :P – marcelm Dec 18 '16 at 22:12

The Arduino has regulators and USB-Serial chips that are not Sleep friendly.

If you look at the Datasheet for the ATMega328 (section 32.2.2) however you will see that Sleep states exist down to around 4-8 uA (wake on WDT) for the MCU.

Consider simply building your own Arduino clone (if that's the programming environment you want to use) that has only the ATMega328 (or other AVR such as the ATMega8L) on it. You could run from 3 AAA batteries without a regulator at all providing you don't need to support higher voltage LEDs. There are many resources that show how to program an Arduino bootloader environment into a standalone AVR MCU. You could start here and here.

The chip used in the Arduino Uno (Atmega328P) can certainly do low-power.

See my page about power savings for more details.

My base expectation is that if you don't need a timer (eg. to do something periodically) you can get down to 100 nA of current, and still wake on an interrupt, such as a switch press.

If you need to wake from time to time (using the watchdog timer) your current usage will be around 6.5 µA. This is way lower than the 15 mA you quote.

If you use an Arduino board then the on-board LED, the USB interface chip, and the voltage regulator will be the main power culprits. Plus, not going into sleep mode doesn't help.

I made a temperature and humidity logger, see picture below, which has been running now for a couple of years taking a reading every 15 minutes and logging it to an SD card. That runs from 3 x AA batteries.

It is designed to sleep most of the time. The "peripherals power mosfet" shown is used to "power off" the on-board devices when not needed.

• What a great blog on power consumption settings for the AVR's, you must be seriously "at one" with the datasheet. – Jack Creasey Dec 19 '16 at 19:39

I think I've found the answer: Texas Instruments' MCUs. For example this one: MSP430FR6989 has current – at 1 MHz with 0% cache hit ratio – 0.375 mA. For Low Power Mode 0 (LPM0): 0.120 mA, for LPM1: 0.065 mA. Remaining LPMs are having current 0.001-0.009 mA. If software will query HC-SR04 twice a second – i.e. will sleep in a LPM for 500 ms after each complete action set – then I think I will obtain the desired effect of months on batteries.

• For what it's worth, at 1MHz and 3V, the atmega328P (the MCU on the Arduino) exhibits power consumption in the same ballpark. Probably ditto for comparable PICs. It's a more about the clock speed and the voltage than it is about the particular chip (although there are definitely differences there, too). – marcelm Dec 18 '16 at 23:28
• @marcelm: 16 MHz like Arduino Uno and worst scenario (0% cache hit), then the current is 2.675 mA. I've measured my circuit and it draws 15 mA, although it's a complete board and HC-SR04 is attached.. I wonder about LPM0, the weakest power saving mode, if it actually allows to normally run code and device. – Itzie Dec 18 '16 at 23:53
• @Itze. The HC-SR04 is at minimum 1.5 - 2 mA when idle, so you'd have to switch it off completely to get to really low current. As commented before almost any MCU will have sleep states. However when you are active (ie measuring distance with the HC-SR04) you could be awake for as much as 40 mS (max distance). This will mean 40 mS awake and 160 mS asleep (at 5 per second repetition rate), that means the best you can achieve is about a 70% current average saving from idle state by going to sleep. – Jack Creasey Dec 19 '16 at 0:15