PyRaspBeta

← All practice problems

Raspberry Pi practice problem · Displays

Temperature dashboard

HardBudget $35Python · gpiozero

A DS18B20 on GPIO4 feeds three displays at once:

  • a TM1637 (CLK GPIO23, DIO GPIO24, 3.3 V): the temperature in whole degrees and C, right-aligned ( 21C)
  • a 16×2 LCD (0x27, SDA/SCL, 5 V): line 1 Lo {lo:.1f} Hi {hi:.1f} (two spaces between) — the lowest and highest readings since start; line 2 Now {t:.1f}C
  • a NeoPixel stick (DIN GPIO18, 5 V): all eight pixels blue (0, 0, 255) below 18 °C, green (0, 255, 0) from 18 to 25 °C, red (255, 0, 0) above 25 °C

Each reading takes 0.75 s. The test: 21 °C, 15 °C at 3 s, 28 °C at 6 s, 20 °C at 9 s.

More in Displays