Close

Hardware -- User interface

A project log for Heartbeat Logger

A portable device that logs a snippet of your heart at the push of a button.

Ole Andreas UtstumoOle Andreas Utstumo 02/15/2016 at 22:130 Comments

Let’s establish how the device need to communicate with the user. The user must be able to

The device needs to provide user feedback:

The user interaction can be done with one push button. By putting the microcontroller to sleep instead of shutting off power completely, the device can be turned on by triggering a pin change interrupt by pushing the button. The device can for example turn on and off with logging enabled by having the push button pressed for one second, and turn on and off the device with both logging and streaming by having the button pressed for three seconds.

Sleep modes of the Xmega AU series taken from the datasheet

In power down mode, the Xmega32A4U consumes as little as 0.1µA and can be awoken by triggering an asynchronous port interrupt as seen in the figure above. The button must be connected according to page 57 in the device datasheet. Soft switching sets strict requirements to the current consumption of all components tied to Vcc, as these will be draining current constantly even as the device is "off". Therefore, the voltage regulator has ultra low quiescent current, and the power for the AFE and the SD card are both controlled by the microcontroller. In the prototype, I forgot to put the SD card on an individual power rail, so it would drain 7mA continuously from the regulator even though the device was "switched off".

LEDs and debounced push button in the design file

The LEDs are powered by the microcontroller pins through a current limiting resistor. The push button is debounced electrically using a low pass filter to make programming easier. The LP filter corner frequency is

fk = 1/(2*pi*R19*C6) = 4.8 Hz

Discussions