Environment Sensor HAT

From Waveshare Wiki
Jump to: navigation, search
Environment Sensor HAT
Environment Sensor HAT

I2C
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

{{{name6}}}

Introduction

This environment sensors module gives Raspberry Pi the ability to collect environmental data like temperature & humidity, air pressure, ambient light intensity, VOC, IR ray, UV ray, etc. It can also be used to build a robot that can detect motion and orientation.

Features

  • 40PIN GPIO, Compatible with all the Raspberry Pi Boards.
  • Onboard TSL25911FN digital ambient light sensor, for measuring IR and visible light.
  • Onboard BME280 sensor, for measuring temperature, humidity, and air pressure.
  • Onboard ICM20948 motion sensor, accelerometer, gyroscope, and magnetometer.
  • Onboard LTR390-UV-1 sensor, for measuring UV rays.
  • Onboard SGP40 sensor, for detecting ambient VOC.
  • I2C bus allows reading and displaying data by just using two wires.
  • Comes with online development resources and a user manual (python examples).

Specifications

TSL25911 digital ambient light sensor
I2C address 0x29
Effective range 0~88000Lux
BME280 Temperature, Humidity, and Air pressure sensor
I2C address 0x76
Temperature detection -40~85°C (0x01°C resolution, ±1°C accuracy)
Humidity detection 0~100%RG (0.008%RH resolution, ±3%RH accuracy, 1s response time, ≤2%RH delay)
Air pressure detection 300~1100hPa (0x18Pa resolution, ±1hPa accuracy)
ICM20948 Motion Sensor
(9-DOF: 3-Axis accelerometer, 3-axis gyroscrope, 3-axis magne tometer)
I2C address 0x68
Accelerometer resolution 16-bit
Accelerometer range (configurable) ±2, ±4, ±8, ±16g
Gyroscope resolution 16-bit
Gyroscope range (configurable) ±250, ±500, ±1000, ±2000°/sec
Magnetometer resolution 16-bit
Magnetometer 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 (the larger one should prevail)
Response time <10 s (tau 63%)
Start time < 60s
On-chip humidity compensation support

Hardware Connection

Environment-Sensor-HAT-4.jpg Environment-Sensor-HAT-5.jpg

What's On Board

Environment-Sensor-HAT-details-intro.jpg


  1. Raspherry Pi 40PIN
    For connecting to Raspberry Pi easily
  2. TSL25911FN
    Digital ambient light sensor, for measuring IR and visible light
  3. LTR390-UV-1
    UV sensor
  4. SGP40
    VOC sensor
  5. ICM20948
    3-axis accelerometer, 3-axis gyroscrope, 3-axis magnetometer
  6. BME280
    Measuring temperature, humidity, and air pressure sensor
  7. Voltage level translator
    5V to 1.8V
  8. Voltage regulator
    5V to 3.3V/1.8V

Pinout

Environment-Sensor-HAT-details-inter.jpg

Outline Dimensions

Environment-Sensor-HAT-details-size.jpg

How to use

Install the library

C

#Open the Raspberry Pi terminal and run the following commands: 
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install

#For more details, you can refer to the official website: https://github.com/gpiozero/lg

Python

sudo apt-get install python3-smbus
sudo -H apt-get install python3-pil
sudo apt-get install i2c-tools

Download the demo

Enter the following commands to install the demo:

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

Check the effect

Enter the following commands:

C

cd c
make clean
make -j 8
sudo ./main

python

cd python
sudo python test.py

Then the values related to the current environment will be printed.

Sensor

Here we introduce the use of each sensor:

Ambient light Sensor

TSL2591 is a light-intensity digital converter based on IIC bus communication. The sensor combines a broadband photodiode (visible light and infrared light) and an infrared-responsive photodiode on a single CMOS integrated circuit that can provide a low-beam adaptive response within an effective 16-bit dynamic range (16-bit resolution). Two integrating ADCs convert the photodiode current into a digital output. This digital output can be fed to the microprocessor, where an empirical formula is used to derive the illuminance (ambient light level) in lux to approximate the human eye response.
The sensor address is: 0x29
【Note】:

  • 1. The interrupt is turned on by default, if you don't need it, you can comment out the corresponding code;
  • 2. The range of the default routine is small, if the light changes greatly, please increase the range;
  • 3. It is different from the light intensity readers on the market which have the lenses;

If you need to run this sensor separately, please enter the following command:

sudo python TSL2591.py

Environment-Sensor-for-Jetson-Nano-7.png

This is a demonstration effect, the actual directory should according to your directory.

Temperature and Humidity Sensor

The BME280 can perceive environmental temperature, humidity, and atmospheric pressure, which is low power consumption, high precision, and has high stability, and is suitable for environmental monitoring, weather forecasting, altitude monitoring, and IoT applications.
The sensor address is: 0x76.
Measurement range:

  • Temperature range: 40~85°C (resolution 0.01°C, error ±1°C)
  • Humidity range: 0~100%RH (resolution 0.008%RH, ±3% RH)
  • Pressure range: 300~1100 hPa (resolution 0.18Pa, error ±1 hPa)

【Note】:

  • 1. The measurement range should not exceed the range, otherwise, the measurement may be inaccurate;
  • 2. The measured air pressure is atmospheric pressure, which will fluctuate up and down at standard atmospheric pressure (1.013x 10^5 = 1013hPa);
  • 3. The measured temperature may be affected by the heat dissipation of the Raspberry Pi. In this case, you can add a fan to avoid this situation during use;
  • 4. The higher the temperature, the lower the air pressure, because the higher the temperature, the heat and expansion of the air near the ground will increase, resulting in a drop in air density and a drop in air pressure. On the contrary, the air pressure will rise;
  • 5. The atmospheric pressure decreases with the increase in altitude, but there is no proportional relationship. The higher the altitude, the slower the decrease;
  • 6. The relationship between atmospheric pressure and altitude is the altitude increases, the atmospheric pressure decreases. In the theoretical situation, within the range of 3000M, for every 12M increase, the atmospheric pressure decreases by 1mmHg, about 133Pa;

If you need to run this sensor separately, please enter the following command:

sudo python BME280.py

Environment-Sensor-for-Jetson-Nano-8.png

This is a demonstration effect, the actual directory should according to your directory.

9-AXIS Sensor

ICM20948 is a multi-chip module with a 9-axis motion tracking function, 3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer, and a built-in digital motion processing engine, which can reduce complex fusion calculation data and reduce the load on the processor.
The sensor address is: 0x68.
Accelerometer:

  • Resolution: 16 bits
  • Range (optional): ±2, ±4, ±8, ±16g
  • Working current: 68.9uA

Gyro features: Resolution: 16 bits

  • Range (optional): ±250, ±500, ±1000, ±2000°/sec
  • Working current: 1.23mA

Magnetometer:

  • Resolution: 16 bits
  • Range: ±4900µT
  • Working current: 90uA

【Note】:

  • 1. Roll, Pitch, and Yaw are Euler angles. It is a three-dimensional vector whose value represents the rotation angle of the object around the three axes of the coordinate system (x, y, z axis);
  • 2. Roll, Pitch, and Yaw are pitch angle, yaw angle, and rotation angle respectively;
  • 3. Acceleration is acceleration (LSB can be converted to g);
  • 4. Gyroscope is gyroscope angular velocity (LSB can be converted to °/sec);
  • 5. Magnetic is the electronic compass inclination (°);

If you need to run this sensor separately, please enter the following command:

sudo python ICM20948.py

Environment-Sensor-for-Jetson-Nano-9.png

This is a demonstration effect, the actual directory should according to your directory.

UV sensor

The LTR390-UV-01 is a multifunctional optical measurement module for measuring ultraviolet light. The sensor supports measuring ambient light intensity.
I2C Address: 0x53

There are several considerations when using this sensor:
1. The principle is a calculation between one sensitive to diodes, one sensitive to normal light, and one sensitive to ultraviolet light;
2. The value given is the original ADC data. If you want to calibrate, you can refer to the formula in the manual and calibrate it in combination with the actual light intensity value and UV;
3. The value varies according to the gain setting and needs to be set according to the actual application environment;
4. The manual does not explain the detection range. The actual measurement has a better effect in sunlight or the best effect is to use an ULTRAVIOLET pen within 50cm;

If you need to run this sensor separately, just execute:

sudo python LTR390.py

VOC Sensor

SGP40 is a digital VOC (volatile organic compound) sensor newly launched by Sensirion, which can be easily integrated into air treatment equipment and air quality monitors. It has a temperature-controlled mini-heating plate and a humidity-compensated indoor air quality signal. Provide a complete sensor system on a single chip.
The sensor address is 0x59.
【Note】

  • 1. The output of the Python demo is the algorithm value that hasn't been processed by VOC. Sensirion has its own C algorithm, which is more accurate after conversion;
  • 2. The sensor needs to be stabilized within 1 minute because the interior is slowly heating;
  • 3. It can feedback to SGP40 by measuring the current temperature and humidity so that the accuracy will be higher;
  • 4. The measuring range of the sensor is 0 to 1,000 ppm ethanol equivalent;

If you need to run this sensor separately, please enter the following command:

sudo python SGP40.py

Resources

Document

Demo

Resources

Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)