Difference between revisions of "Pico-Environment-Sensor"

From Waveshare Wiki
Jump to: navigation, search
m (Text replacement - "{{#urlget:amazon|default}}=display" to "{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display")
Line 3: Line 3:
 
{{Infobox item
 
{{Infobox item
 
|name=Pico Environment Sensor
 
|name=Pico Environment Sensor
|img=[[File:Pico-Environment-Sensor-1.jpg|300px|link=https://www.waveshare.com/pico-environment-sensor.htm|Pico Environment Sensor]]
+
|img=[[File:Pico-Environment-Sensor-1.jpg|300px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=https://www.waveshare.com/pico-environment-sensor.htm}}|Pico Environment Sensor]]
 
|category=
 
|category=
 
|brand=Waveshare
 
|brand=Waveshare

Revision as of 06:25, 16 May 2022

Pico Environment Sensor
Pico Environment Sensor
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Overview

The Pico-Environment-Sensor gives Raspberry Pi Pico the ability to collect environmental data like temperature & humidity, air pressure, ambient light intensity, VOC, UV rays, etc. It can also be used to build a robot that can detect motion and orientation.

Features

  • Standard Raspberry Pi Pico header, supports Raspberry Pi Pico series.
  • 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 retrieving data by just using two wires.

Specifications

TSL25911FN DIGITAL AMBIENT LIGHT SENSOR
I2C address 0 x 29
Effective range 0~88000 Lux
BME280 TEMPERATURE, HUMIDITY, AND AIR PRESSURE SENSOR
I2C address 0 x 76
Temperature detection -40 ~ 85℃ (0.01℃ resolution, ±1℃ accuracy)
Humidity detection 0~100%RH (0.008%RH resolution, ±3%RH accuracy, 1s response time, ≤2%RH delay)
Air presure detection 300~1100hPa (0.18Pa resolution, ±1hPa accuracy)
ICM20948 MOTION SENSOR
(9-DOF: 3-AXIS ACCELEROMETER, 3-AXIS GYROSCROPE, 3-AXIS MAGNETOMETER)
I2C address 0 x 68
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 0 x 53
Response wavelength 280nm - 430nm
SGP40 VOC Sensor
I2C address 0 x 59
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 < 60 s
On-chip humidity compensation support

How to Connect

As shown below: directly connect to the GPIO headers of the Jetson Nano.
Pico-Environment-Sensor-spec09.jpg

Onboard Resource

Pico-Environment-Sensor-resource.png

Sensor

Ambient Light Sensor

The TSL2591 is an optical intensity digitizer based on IIC bus communication. The sensor combines a broadband photodiode (visible and IR light) and an IR-responsive photodiode on a single CMOS integrated circuit capable of providing near-light adaptive response over an effective 16-bit dynamic range (16-bit resolution). Two integral ADCs convert the photodiode current to a digital output representing the irradiance measured on each channel. This digital output can be fed to a microprocessor, which uses an empirical formula to derive an illuminance (ambient light level) in lux to approximate the human eye response.
The sensor address is 0X29.
The following points need to be noted when using this sensor:

  1. The default is turned on the interrupt, if you do not need to comment out the corresponding code;
  2. The default range of the demo is limited, if the light suddenly changes a lot, please increase the range;
  3. There is a difference with the light intensity reader on the market, those are added to the lens.

Temperature, Humidity, and Ari Pressure Sensor

BME280 is for temperature, humidity, and air pressure sensors with the characteristics of low power consumption, high accuracy, and stability. It is suitable for environmental monitoring, weather prediction, altitude monitoring, and Internet of Things application scenarios.
Sensor address: 0 x 76.
Measuring range:
Temperature range: 40~85°C (resolution is 0.01°C, error ±1°C).
Humidity range: 0~100%RH (resolution is 0.008%RH, error ±3% RH)
Pressure range: 300~1100 hPa (resolution is 0.18Pa, error ±1 hPa)
Note:

  1. The measuring range should not exceed the measuring range, or it may be inaccurate.
  2. The pressure measured is atmospheric pressure, which normally fluctuates around the standard atmospheric pressure (1.013x 10^5 = 1013hPa).
  3. The measured temperature may be biased to the temperature above the jetson nano. If possible, fans can be added to avoid this situation during use.
  4. The higher the air temperature is, the lower the air pressure is. Because the higher the air temperature is, the air near the ground will expand and rise due to heat, resulting in a decrease in air density and air pressure. Instead, the pressure rises.
  5. Atmospheric pressure decreases with altitude, but there is no proportional relationship. The higher the altitude, the slower the decrease.
  6. The relationship between atmospheric pressure and altitude is as follows: as altitude increases, atmospheric pressure decreases. Theoretically, within the range of 3000M, atmospheric pressure decreases by 1mmHg, or about 133Pa, for every 12M increase.


9-axis Sensor

MPU9250 is a multi-chip module with 9-axis motion tracking, 3-axis acceleration, 3-axis gyroscope, and 3-axis magnetometer, and a built-in digital motion processing engine to reduce complex fusion algorithm data and reduce the load on the processor.
Sensor address: 0x68
Parameters:
Accelerometer characteristics:

  • Resolution: 16-bit
  • Measurement range (Optional): ±2, ±4, ±8, ±16g
  • Operating current: 450uA

Gyroscope characteristics:

  • Resolution: 16 bit
  • Measurement range (Optional): ±250, ±500, ±1000, ±2000°/sec
  • Operating current: 3.2mA

Magnetometer characteristics:

  • Resolution: 16 bit
  • Measurement range: ±4900µT
  • Operating current: 280uA

Note:

  1. Acceleration (LSB, convert to g)
  2. Gyroscope angle velocity (LSB, convert to °/second)
  3. Magnetic electronic compass angle (°)

UV Sensor

The LTR390-UV-01 is a multifunctional optical measurement module with a focus on measuring ultraviolet light. The sensor supports the measured ambient light intensity.
The sensor address is: 0X53
The use of this sensor requires attention to the following points.

  1. The principle of operation is actually a pair of diodes, one sensitive to normal light and one sensitive to ultraviolet light, and the result is obtained by the calculation of both.
  2. The value readout is the original ADC data, if you want to calibrate can refer to the manual formula and combine it with the actual light intensity value, UV for correction.
  3. The data can be set differently by gain, which needs to be set according to the actual application environment.
  4. The manual does not specify the detection range, the actual measurement in the sun has a better effect or the best effect with a UV pen in 50cm thought.

VOC Sensor

SGP40 Sensirion's new digital VOC (Volatile Organic Compounds) sensor, easily integrated into air handling devices and air quality monitors, features a temperature-controlled miniature heating plate and a humidity-compensated indoor air quality signal that provides a complete sensor system on a single chip.
The sensor address is: 0X59
The following points need to be noted when using this sensor.

  1. The default Python demo outputs the VOC-processed algorithm value.
  2. The sensor work needs to be stabilized within 1 minute, as the internal is slowly heating up.
  3. Can be fed back to the SGP40 by measuring the current temperature and humidity so that the accuracy of the output will be higher.
  4. The sensor measurement range of 0 to 1,000 ppm ethanol equivalent.

C

C/C++ Development Environment Installation

Windows

  • Click here to download the demo, unzip it and enter the folder of Pico-Environment-Sensor-code\c.
  • After entering Pico-Environment-Sensor-code\c, you can open the project with vs code.

1.28inch Touch LCD pico.jpg

  • Choose the Compiler.

1.28inch Touch LCD pico2.jpg

  • Start to compile.

1.28inch Touch LCD pico3.jpg

  • Finish.

1.28inch Touch LCD pico4.jpg

  • Copy the Pico_Environment_Sensor.uf2 in build to Pico, and then it can automatically run the demo.

1.28inch Touch LCD pico5.jpg

In Raspberry Pi

  • Open the Raspberry Pi and run:
sudo apt-get install p7zip-full
cd ~
sudo wget https://files.waveshare.com/upload/f/f9/Pico-Environment-Sensor-code.7z
7zr x Pico-Environment-Sensor-code.7z -r -o./Pico-Environment-Sensor-code
cd ~/Pico-Environment-Sensor-code
cd c/build/

Demo Use

  • Please operate the following tutorial on Raspberry Pi, due to the multi-platform and portable nature of CMake, it can also be compiled successfully on a PC, but the operation is slightly different and requires your own judgment.
  • To perform the compilation, make sure that in the c directory:
cd ~/Pico-Environment-Sensor-code/c/

Create and enter the build directory, and add the SDK: ../../pico-sdk is the directory of your SDK. There is a build in our sample application, just enter it directly.

cd build
export PICO_SDK_PATH=../../pico-sdk
(Note: Be sure to write the right path to your own SDK)

Execute cmake to automatically generate the Makefile file:

cmake ..

Execute make to generate the executable file, you may wait for a long time as it is the first time to be compiled.

make -j9

After compiling, the uf2 file will be generated. Press the button on the Pico board, Pico can connect to the USB port of the Raspberry Pi via a Micro USB cable, and then release the buttons. After connecting, Raspberry Pi will automatically identify a movable disk (RPI-RP2), and copy main.uf2 in the build file to the recognizable movable disk (RPI-RP2).

cp Pico_Environment_Sensor.uf2 /media/pi/RPI-RP2/

Python

Windows

  1. Download the demo.
  2. Press and hold the BOOTSET button on the Pico board, connect the Pico to the USB port of the computer via the Micro USB cable and release the button when the computer recognizes a removable disk (RPI-RP2).
  3. Copy the pico_micropython_20221125.uf2 file from the UF2 directory to the recognized removable disk (RPI-RP2).
  4. Open the Thonny IDE (note: use the latest version of Thonny, otherwise there is no support package for Pico, the current latest version for Windows is v3.3.3).
  5. Click Tools -> Settings -> Interpreter, and select Pico and the corresponding port as shown in the picture.

Pico-lcd-0.96-img-config.png

6. After connecting to Pico, save all the downloaded code to Pico, then run test.py, Thonny will print the sensor data as follows:
(1) Find the path of your downloaded program in the Thonny IDE.
(2) Upload all the Python to Pico.
(3) After uploading, open test.py for module testing.
(4) No save and the output value is normal, then the function is OK.

Raspberry Pi

  • Demo download:
sudo apt-get install p7zip-full
cd ~
sudo wget  https://files.waveshare.com/upload/f/f9/Pico-Environment-Sensor-code.7z
7z x Pico-Environment-Sensor-code.7z -o./Pico-Environment-Sensor-code
cd ~/Pico-Environment-Sensor-code

1. The process of flashing the firmware is the same as on Windows, you can choose to copy the pico_micropython_20210121.uf2 file into pico on your PC or Raspberry Pi.
2. Open the Thonny IDE in Raspberry Pi Mountain (click Raspberry logo -> Programming -> Thonny Python IDE), you can check the version information in Help -> About Thonny.
To make sure your version has the Pico support package, also you can click on Tools -> Options... -> Interpreter to select MicroPico. -> Interpreter to select MicroPython (Raspberry Pi Pico and ttyACM0 port).
As shown in the image:
Pico-lcd-0.96-img-config2.png
If your current Thonny version has no Pico support package, you should enter the following commands to update Thonny IDE:

sudo apt upgrade thonny

3. Click File -> Open... -> test.py, and run the script.

Support

If you require technical support, please go to the Support page and open a ticket.