WSAL20471 – Environment Sensor HAT/en
Erscheinungsbild
Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.
Summary
The Waveshare Environment Sensor HAT adds five onboard sensors to a Raspberry Pi: ambient light (TSL25911), temperature/humidity/pressure (BME280), 9-axis motion (ICM20948), UV light (LTR390-UV-1), and VOC (SGP40). All sensors are connected via a shared I2C bus, requiring only two signal wires. The module plugs into the 40-pin GPIO header of common Raspberry Pi boards.
Related products at JW Tech
Technical overview
- Connection: 40-pin GPIO header; compatible with common Raspberry Pi boards. The I2C bus connects all five sensors over just two wires.
- TSL25911 ambient light sensor: I2C address 0x29, effective range 0–88,000 lux; measures visible and infrared light using a broadband photodiode plus an IR photodiode on a single CMOS chip with a 16-bit dynamic range.
- BME280: I2C address 0x76. Temperature −40 to +85 °C (resolution 0.01 °C, accuracy ±1 °C); humidity 0–100 %RH (resolution 0.008 %RH, accuracy ±3 %RH, response time ~1 s); pressure 300–1100 hPa (resolution 0.18 hPa, accuracy ±1 hPa).
- ICM20948 9-axis sensor: I2C address 0x68. Accelerometer, gyroscope, and magnetometer are each 16-bit. Accelerometer range selectable: ±2/±4/±8/±16 g; gyroscope: ±250/±500/±1000/±2000 °/s; magnetometer: ±4900 µT.
- LTR390-UV-1 UV sensor: I2C address 0x53, sensitivity band 280–430 nm. Readings are raw ADC values; calibration uses formulas from the manual depending on the gain setting.
- SGP40 VOC sensor: I2C address 0x60 per the spec table (the text section mistakenly says 0x59). Measurement range 0–1,000 ppm ethanol equivalent; response time <10 s (tau 63%), start-up time <60 s; the chip supports humidity compensation.
- HAT power: onboard regulators convert 5 V to 3.3 V or 1.8 V; a level shifter converts 5 V logic to 1.8 V for the sensors.
- Python environment setup: 'sudo apt-get install python3-smbus', 'sudo -H apt-get install python3-pil', and 'sudo apt-get install i2c-tools'. For C demos: download the 'lg' driver archive, extract it, then run 'make install'.
- Obtain demo code: 'sudo apt-get install p7zip-full', then download and extract the provided .7z archive and change into its directory. Run commands: for C 'cd c && make clean && make -j 8 && sudo ./main'; for Python 'cd python && sudo python test.py'. Individual sensors can be launched separately, e.g. 'sudo python TSL2591.py', 'sudo python BME280.py', 'sudo python ICM20948.py', 'sudo python LTR390.py', 'sudo python SGP40.py'.
Commands and examples – verify before use:
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
sudo apt-get install python3-smbus
sudo -H apt-get install python3-pil
sudo apt-get install i2c-tools
sudo apt-get install p7zip-full
wget https://files.waveshare.com/upload/b/ba/Environment_Sensor_HAT_Code.7z
7z x Environment_Sensor_HAT_Code.7z -r -o./Environment_Sensor_HAT_Code
cd Environment_Sensor_HAT_Code
cd c
make clean
make -j 8
sudo ./main
cd python
sudo python test.py
sudo python TSL2591.py
sudo python BME280.py
sudo python ICM20948.py
Notes and version constraints
- SGP40 I2C address: the specification table lists 0x60, but the individual sensor section states 0x59. Verify the correct address on the device before use.
- Temperature readings may be skewed by heat dissipation from the Raspberry Pi; add cooling (e.g., a fan) if needed.
- The UV sensor returns raw ADC values; without calibration according to the manual, the values cannot be directly interpreted as a physical quantity.
- The VOC sensor requires up to 60 s start-up time before stable measurements are possible; the Python demo shows unprocessed raw values that must be processed via the Sensirion C algorithm.
- All launch examples are demonstration paths; actual file names and directories may differ depending on your local setup.
- Compatibility: The HAT is stated to work with all common Raspberry Pi models; any board-specific limitations should be checked before integration.
Source and revision record
- Environment Sensor HAT - Waveshare Wiki
- Source revision: 89822
- Captured: 2026-09-02T03:54:00+00:00
- SHA-256:
0333e174980fa4c685847b3139367eb18fa80e1aba31f00d103cf229c83d725b