Pages Menu
TwitterRssFacebook
Categories Menu

Posted by on Dec 17, 2014 in Atmel AVR, Guest Articles, Microcontrollers | 6 comments

Guest Article: The Analog Voltmeter Clock

Guest Article: The Analog Voltmeter Clock

Today’s guest post is by Sam Feller, creator of the Model AWK-105 Analog Voltmeter Clock, live now on Kickstarter¬†(until Jan 14, 2015). The Clock is based around an ATtiny microcontroller and gets into some serious power optimization to run off an AA battery.

splash kickstarter

Power Saving on the ATtiny

One of the big design goals for the Analog Voltmeter Clock project was to have a stand alone desk clock that could run off battery power. The two analog meters themselves draw an average of 100uA, so trying to stretch to 6-12 months off a single AA battery (approx 2300mAh) meant being as efficient as possible with the AVR ATtiny44 that controls the device.

Working Prototype Circuit Board

Working Prototype Circuit Board

Low Hanging Fruit

The low hanging fruit of power saving is to keep the CPU in sleep mode as much as possible. The ATtiny has the ability to run timer registers in hardware while the CPU is off. Taking advantage of this, one set of registers is actually able to generate PWM signals to drive the clock display meters while the CPU is sleeping! The other timer register generates interrupts to wake the CPU every second to run the logic that counts the time and adjusts the displays. Then the CPU goes back to sleep until the next interrupt.

Lower and Slower

knobsThe next place to look for simple power savings was the supply voltage and clock frequency of the chip. We use a boost converter to get a consistent 2.0V supply voltage from the battery (which is subject to drop as it discharge), and we turned off the internal clock, which comes from the factory at a default 8Mhz in favor of an external clock oscillator at 32.768 Khz. Running at lower voltages and speeds is more power efficient.

Reading the Notes

reading clockAt this point, we had to start reading through the design notes (that book length .pdf document) from Atmel to look for more ways to save power. We started turning off any peripherals that weren’t in use… the UART, the AtoD converter, all of it was turned off by flipping bits in register settings.

Being a Little Clever

full deskThe two control knobs of the Clock were implemented with a quadrature encoder (for relative motion inputs to adjust the time) and a potentiometer (for absolute motion inputs to pick between time keeping and calibration modes). The quadrature encoder can generate interrupts, which is great in terms of power efficiency, but the potentiometer needs to be polled.

To save power, the top voltage rail of the potentiometer resister divider network is actually powered by a pin from the microcontroller. The pin is turned on when the timer generated interrupts wakeup the CPU and turned off before it goes back to sleep. Furthermore, the AtoD converter that reads the voltage from the potentiometer is actually turned on and off as well! This was the best compromise to stay power efficient while keeping the potentiometer control knob that we liked.

Firmware

Firmware

Blog, Git and Website

If you want some more technical details and information, check out my blog and view the code at my git repository. Swinging by my website would be a cool idea too!

Conclusion and Thanks!

One of the great things about Arduino is how simple it can make programming a microcontroller by hiding a lot of the low level logic. When you’re ready to get more advanced and want to start designing embedded devices for power constrained environments, knowing the basic techniques and having a handy-dandy print out of the the design notes to get to the low level registers is a must.

Many thanks to maxEmbedded for having me as a guest writer and for writing some fantastic tutorials that helped me get started.

Sam Feller
The Awkward Engineer

6 Comments

  1. Any comments or questions should now, go to my email, if anyone would like to know more!

    Cheers!
    -Sam

    • Thank you Sam!

    • Love the idea!

  2. Nice Blog! We are also in the same field, We provide Ukraine’s best embedded system developers.

    • Thanks Sirinsoftware!

      We are currently based in India. We are also having one initiative at ASU, Arizona :D

Leave a Reply

%d bloggers like this: