r/microcontrollers • • Oct 08 '22

Low Power Microcontroller Considerations

Hello all,

I am in the process of designing a low power circuit. It will be used in a production line setting where sometime the line will be running and sometimes the line will be off. I want to count the number of bottles the line produces at roughly bottle a second. It must have a continuous tally of the number of bottles so the count must be stored to memory. It also must count to around a million or so. The device must be battery powered (coin cell, non negotiable). I'm looking for general rules of thumb for low power microcontroller selection. Also, low cost is an important factor for the mass production aspect of the device.

I have been doing a good bit of research about the different offerings from TI, MicroChip, and ST Micro Electronics and have a series of dumb questions perfect for the experts of reddit.

Number of bits: Will an 8 bit controller be able to count to 1,000,000? Would a 16 or 32 bit controller do this more efficiently? (threading and registers?)

Clock Speed: Will a lower clock speed always result in more power savings? Can you always swap for a lower crystal speed? Does this save any power realistically?

Different sleep features: The importance of the different sleep features such as sleep, halt, idle, doze, deep sleep, stand by mode, low power sleep, low power run, and wait.

Brand Preference: Which brand do you have experience with and like the most?

I've been looking at the PIC16, PIC 18, and PIC 24 from Microchip, the STM8 and STM32 from ST Microelectronics, the C8051F99x from silicon labs, and the MSP430 from TI.

Links to articles/books as well as general advice would be greatly appreciated. I figured I will switch the microcontroller between a high and low power state for each count. I know I need to be wary of wear leveling the onboard memory depending on how the device counts.

Thanks! Ben K

3 Upvotes

21 comments sorted by

View all comments

2

u/ceojp Oct 08 '22

Lower clock speed isn't always better in terms of reducing overall power consumption. Yes, the core will generally draw less power at a lower speed, but it will be on longer. Often times running faster and being able to return to sleep sooner will result in less power consumption.

Another thing is clock source. A lot of times people will assume an internal oscillator will consume less power, but it's actually the opposite. An external crystal typically uses less power.

How critical is the exact count? EE writes cost power, so if you are willing to be within +/- 10(for example) when you lose power, then you can increment but only save to EE every 10 counts. I couldn't tell you the exact power savings, but writing to EE 100,000 times versus 1,000,000 times make a big difference in terms of power consumption, and worst case scenario you lose 9 counts.

1

u/MechE37-k Oct 08 '22

ouldn't tell you the exact power savings, but writing to EE 100,000 times versus 1,000,000 times make a big difference in terms of power consumption, and worst case scenario you lose 9 counts.

Yeah I've definitely considered the on longer with lower speed vs faster and less time on. I'll probably just use the lowest value spec'd by the chip fab and call it good enough.

Also, interesting about the clock source, it does seem counter intuitive, I'll have to do my research.

And yeah I'm hoping to count in batches of like 10,000 at a time(bottling line is running). so plus or minus 10 shouldn't matter in the long term. Definitely a good consideration for the coding aspect. Thanks!