AVR MCU based thermometer and hygrometer with e-ink display

@Torsten Römer Torsten Römer authored on 17 Jun 2023
GitHub committed on 17 Jun 2023
.github/ workflows use timer2 to wake up from power save mode (#11) 2 years ago
thermidity-avr set unused pins to defined level (enable pull-up) (#20) 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 measured power consumption with a supercap capacitor 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 220µA, hopefully giving an operating time of at least 7 months with 3 AAA batteries (1200 mAh).

The consumption of each component is about:

ComponentData SheetMeasured
ATmega328P¹4.2µA<17µA
ThermistorN/A24µA
HIH-5030²200µA211µA
V-DividerN/A2µA
23K6401µA-
Display³1µA-

¹VCC = 3V
²VCC = 3.3V
³VCC = 3V (deep sleep mode)

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 including SRAM.

When measuring temperature, humidity and battery voltage in ADC noise reduction mode, consumption should 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.