AVR MCU based thermometer and hygrometer with e-ink display

@Torsten Römer Torsten Römer authored on 28 Jun 2023
GitHub committed on 28 Jun 2023
.github/ workflows use timer2 to wake up from power save mode (#11) 2 years ago
thermidity-avr optimizations on battery usage (#21) 2 years ago
thermidity-freecad add FreeCAD subproject for frame 2 years ago
thermidity-kicad update README and schematic + PCB 2 years ago
.gitignore move KiCad project 2 years ago
LICENSE move LICENSE and README.md 2 years ago
README.md more infos about power consumption 2 years ago
README.md

Thermidity

make

AVR MCU based battery powered thermometer and hygrometer with e-ink display (work in progress).
Focus is on stable, accurate measurements and low power consumption. And of course on a nice, simple display.

The project is based on avrink and uses the following components:

  • MCU AVR ATmega328P
  • Thermistor NTC 100kΩ 0.1°C
  • Humidity Sensor HIH-5030
  • E-Ink display Adafruit Monochrome 2.13" 250x122
    • Driver SSD1680
    • SRAM 23K640
    • SD Card Reader (not used)

Accuracy

AD conversion is done with 16x oversampling, yielding 12-bit virtual resolution with the 10-bit ADC, provided the signal contains some noise.

Each time measurements were taken, a moving average is updated which is used to calculate and display temperature, humidity and battery voltage.

A precision thermistor and precision low-voltage humidity sensor are used:

ComponentAccuracy
Thermistor¹±0.1°C
HIH-5030±3%RH

¹Series resistor 0.1% tolerance

Power Consumption

Estimated average power consumption is about 125µA when measuring every 32 seconds and updating the display once in about 5 minutes, hopefully giving an operating time of about a year with 3 AAA batteries (1100 mAh).

The consumption of each component at 3.8V and 22°C is about:

ComponentData SheetMeasured
ATmega328P¹4.2µA4.5µA
ThermistorN/A24µA
HIH-5030²200µA211µA
V-DividerN/A2µA
Display³N/A14µA

¹VCC = 3V, power-down sleep mode
²VCC = 3.3V
³Display in deep sleep mode + SRAM + SD Card Reader + Bus Transceiver

Between taking measurements, the MCU is set to power-down sleep mode with the watchdog used as wake-up source. Additionally, the thermistor and humidity sensor are powered off and between display updates, the display is set to deep sleep mode. Power consumption (measured) then is about 19µA at 3.8V for MCU and display.

When measuring temperature, humidity and battery voltage in ADC noise reduction mode, consumption seems to be somewhere around 2mA for 6ms, plus a brief MCU awake period for updating the moving average with measured values. Before measuring, the sensors are powered on and given 100ms to settle, consuming about 240µA.

When updating the display, consumption is at around 6mA for about 3 seconds. Before that, the MCU has to calculate and format the average measurements and buffer the frame in SRAM.

When no measurement has changed, the display is not updated to extend its lifetime and to save power.

The clock of unused modules TWI, all three timers and USART is switched off to reduce power consumption.