home menu

Pure Internet: office---space

Transforming a spare Pi Zero 2 W and Waveshare Environment HAT into a sensor hub that records environmental data every 60 seconds to.

I had a spare Raspberry Pi Zero 2 W and a Waveshare Environment HAT sitting in a drawer. The Zero 2 W is overkill for reading sensors and writing to a database, but the 64-bit processor makes library support easier.

The Environment HAT carries the sensors:

  • TSL25911 Digital Ambient Light Sensor

    • I2C address: 0x29
    • Effective range: 0~88000 Lux
  • BME280 Temperature, Humidity, and Air Pressure Sensor

    • I2C address: 0x76
    • Temperature: -40~85°C (0.01°C resolution, ±1°C accuracy)
    • Humidity: 0~100%RH (0.008%RH resolution, ±3%RH accuracy, 1s response time, ≤2%RH delay)
    • Air Pressure: 300~1100hPa (0.18Pa resolution, ±1hPa accuracy)
  • ICM20948 9-DOF Motion Sensor

    • I2C address: 0x68
    • Accelerometer:
      • Resolution: 16-bit
      • Range: ±2, ±4, ±8, ±16g (configurable)
    • Gyroscope:
      • Resolution: 16-bit
      • Range: ±250, ±500, ±1000, ±2000°/sec (configurable)
    • Magnetometer:
      • Resolution: 16-bit
      • Range: ±4900µT
  • LTR390-UV-1 UV Sensor

    • I2C address: 0x53
    • Response wavelength: 280nm - 430nm
  • SGP40 VOC Sensor

    • I2C address: 0x60
    • Measuring range: 0 ~ 1,000 ppm ethanol equivalent
    • Limit condition: <0.05 ppm ethanol equivalent OR < 10% preset concentration point
    • Response time: <10s (tau 63%)
    • Start time: < 60s

A new entry every 60 seconds, give or take. The sensors occasionally stall, but the database aggregation absorbs most of it, and some error handling tries to reinitialize before rebooting.

The code is open source, split across office-space (a Vite + React frontend reading from Supabase) and office-space-db (the Python and systemd service running on the Pi).

collection
posts
rkey
1736536967495-pure-internet-office-space
record cid
bafkreifkrkqqfx5nc6fnjhy5jzubbvzieqi6wr3xptt47ntn3h743a4j74
record
https://content.farfield.systems/api/entries/1736536967495-pure-internet-office-space
created
updated