Introduction

This multifunctional environmental sensor comprises SHTC3 temperature & humidity sensor, BMP280 atmospheric pressure sensor, VEML7700 light sensor, and LTR390 ultraviolet sensor (V1.0 : ML8511,V2.0 : LTR390-UV-01) into one and offers 5 kinds of environmental parameters. Professional sensor chip is selected for each kind of parameter measurement. The reasonable layout and heat conduction of main chip are carefully considered in the circuit design, which effectively guarantees the accuracy of the data

The product has an MCU processing chip onboard that converts the raw data of sensor into values with standard unit so you can directly use them. For example, ℃ and °F for temperature, % for humidity, Kpa for atmospheric pressure, lx for light illuminance, and mw/cm² for ultraviolet.

The environmental sensor supports two communication methods, UART and I2C. There are two versions: Gravity and Breakout, also complete Arduino and Python libraries are provided.

Exquisite and small, you can use it to make a home indoor and outdoor environmental monitoring system, or for your environmental monitoring topics. This DFRobot environmental sensor can greatly simplify wirings and codes of your project.

SEN0500(SEN0501)Design changes notification-EN .pdf

Features

  • Mini size, can be directly soldered onto your PCB
  • Switchable I2C and UART two output modes
  • Highly integrated module, can test a variety of data at the same time (temperature, humidity, atmospheric pressure, altitude, ultraviolet intensity, ambient light intensity)
  • Reasonable layout and high precision

Application

  • Home indoor and outdoor environment detection system
  • Environmental monitoring work

Version 1.0

Basic parameters

  • Working Voltage: 3.3VDC
  • Working Current: 35mA
  • Output Signal: I2C, UART
  • Working Temperature: -20~70℃
  • Size: 30mm × 20.5mm/1.18 × 0.81"

Atmospheric pressure sensor

Atmospheric pressure unit relationship: 1000pa = 10hpa = 1kpa

  • Sensor chip model: BMP280
  • Atmospheric pressure measurement range: 3000~1100 hPa
  • Relative accuracy of atmospheric pressure: ±0.12 hPa
  • Absolute atmospheric pressure accuracy: ±1 hPa

Temperature & Humidity Sensor

  • Sensor chip model: SHT-C3
  • Relative humidity accuracy: ±2%RH
  • Relative humidity resolution: 0.01%RH
  • Relative humidity measurement range: 0~100
  • Temperature accuracy: ±0.2℃
  • Temperature resolution: 0.01℃
  • Temperature measurement range: -40~125℃

Ultraviolet Sensor

  • Sensor chip model: ML8511
  • Ultraviolet sensitive wavelength UV-A (320-400nm), UV-B (280-320nm)
  • Ultraviolet output unit: mW/㎡

Ambient light sensor

  • Sensor chip model: VEML7700
  • Ambient light accuracy: 0.0036 lx/ct
  • Ambient light range: 0~120 klx

register table

Function Overview

Dimension

Dimension

Board Overview

Board Overview

Num Label Description
1 3V3 Power +
2 GND Power -
3 RXD UART receiving
4 TXD UART transmitting
3 SCL I2C Clock Line
4 SDA I2C Data Line
3 RST Reset Pin
4 NC Empty

Tutorial

Download the program to FireBeetle Board ESP32-E, open the serial monitor to check various environmental parameters.

Requirements

Read Sensor Data via I2C/UART

Connection for UART and I2C

Connection

UART on the left, I2C on the right.

  • Click to check more wiring diagrams

Switch Communication Mode

About UART/I2C mode switching:

  1. The default mode in the code is UART. Dial the switch to UART side to use it.
  2. For using I2C, dial the switch to I2C side and replace the 1 at the beginning of the code with 0, as shown below:

mode to MODE

Steps:

Note: Please use 3.3V maincontroller with this product(Arduino UNO is not recommended). Different motherboards correspond to different wiring pins (refer to “more wiring diagrams” above). In the Arduino IDE, they also correspond to different motherboard options and different ports (COM). The other steps are the same as FireBeetle Board ESP32-E.

  • Connect the module and FireBeetle Board ESP32-E according to the wiring method above.
  • Open the Arduino IDE and upload the following code to FireBeetle Board ESP32-E.
  • Open the serial port monitor of Arduino IDE, adjust the baud rate to 115200, and observe the serial port printing result.

Sample Code

Function: Print all data obtained by the module

#include "DFRobot_EnvironmentalSensor.h"
#if defined(ARDUINO_AVR_UNO)||defined(ESP8266)
#include <SoftwareSerial.h>
#endif

#define MODESWITCH        /*UART:*/1 /*I2C: 0*/

#if MODESWITCH
#if defined(ARDUINO_AVR_UNO)||defined(ESP8266)
  SoftwareSerial mySerial(/*rx =*/4, /*tx =*/5);
  DFRobot_EnvironmentalSensor environment(/*addr =*/SEN050X_DEFAULT_DEVICE_ADDRESS, /*s =*/&mySerial);
#else
  DFRobot_EnvironmentalSensor environment(/*addr =*/SEN050X_DEFAULT_DEVICE_ADDRESS, /*s =*/&Serial1); 
#endif
#else
DFRobot_EnvironmentalSensor environment(/*addr = */SEN050X_DEFAULT_DEVICE_ADDRESS, /*pWire = */&Wire);
#endif
void setup()
{
#if MODESWITCH
 
#if defined(ARDUINO_AVR_UNO)||defined(ESP8266)
  mySerial.begin(9600);
#elif defined(ESP32)
  Serial1.begin(9600, SERIAL_8N1, /*rx =*/D3, /*tx =*/D2);
#else
  Serial1.begin(9600);
#endif
#endif
  Serial.begin(115200);

  while(environment.begin() != 0){
    Serial.println(" Sensor initialize failed!!");
    delay(1000);
  }
  Serial.println(" Sensor  initialize success!!");
}

void loop()
{

  Serial.println("-------------------------------");
  Serial.print("Temp: ");
  Serial.print(environment.getTemperature(TEMP_C));
  Serial.println(" ℃");
  Serial.print("Temp: ");
  Serial.print(environment.getTemperature(TEMP_F));
  Serial.println(" ℉");
  Serial.print("Humidity: ");
  Serial.print(environment.getHumidity());
  Serial.println(" %");
  Serial.print("Ultraviolet intensity: ");
  Serial.print(environment.getUltravioletIntensity());
  Serial.println(" mw/cm2");
  Serial.print("LuminousIntensity: ");
  Serial.print(environment.getLuminousIntensity());
  Serial.println(" lx");
  Serial.print("Atmospheric pressure: ");
  Serial.print(environment.getAtmospherePressure(HPA));
  Serial.println(" hpa");
  Serial.print("Elevation: ");
  Serial.print(environment.getElevation());
  Serial.println(" m");
  Serial.println("-------------------------------");
  delay(500);
}

Expected Results

The read data will be dipalyed on the serial monitor.

Result

Function Library Name Definition

  /**
   * @fn begin
   * @brief Init SEN0500/SEN0501 sensor
   * @return Return init status
   * @retval 0  Succeed
   * @retval -1 failed
   */
  int8_t begin(void);

  /**
   * @fn getTemperature
   * @brief Get SEN0500/SEN0501 temperature data
   * @param units Temperature data unit select
   * @n     TEMP_C ℃
   * @n     TEMP_F ℉ 
   * @return Return the obtained temperature data
   */
  float getTemperature(uint8_t unist);

  /**
   * @fn getHumidity
   * @brief Get SEN0500/SEN0501 humidity data 
   * @return Return the obtained humidity data
   */
  float getHumidity(void);

  /**
   * @fn getUltravioletIntensity
   * @brief Get SEN0500/SEN0501 UV intensity index data 
   * @return Return the obtained UV intensity index data
   */
  float getUltravioletIntensity(void);

  /**
   * @fn getLuminousIntensity
   * @brief Get SEN0500/SEN0501 luminous intensity data 
   * @return Return the obtained luminous intensity data
   */
  float getLuminousIntensity(void);

  /**
   * @fn getAtmospherePressure
   * @brief Get SEN0500/SEN0501 atmosphere pressure data 
   * @param units Atmosphere pressure data unit select
   * @n            HPA: Hectopascal
   * @n            KPA: Kilopascal
   * @return Return the obtained atmosphere pressure data
   */
  uint16_t getAtmospherePressure(uint8_t units);

  /**
   * @fn getElevation
   * @brief Get SEN0500/SEN0501 altitude data 
   * @return Return the obtained altitude data
   */
  float getElevation(void);

Version 2.0

Basic Parameters

  • Operating Voltage: 3.3V~5V
  • Operating Current: 35mA
  • Output Signals: I2C, UART
  • Operating Temperature: -20~70℃
  • Circuit Board Dimensions: 30mm × 20.5mm

Atmospheric Pressure Sensor Parameters

Pressure Unit Conversion: 1000Pa = 10hPa = 1kPa

  • Sensor Chip Model: BMP280
  • Atmospheric Pressure Measurement Range: 3000~1100 hPa
  • Relative Pressure Accuracy: ±0.12 hPa
  • Absolute Pressure Accuracy: ±1 hPa

Temperature and Humidity Sensor Parameters

  • Sensor Chip Model: SHT-C3
  • Relative Humidity Accuracy: ±2%RH
  • Relative Humidity Resolution: 0.01%RH
  • Relative Humidity Measurement Range: 0~100%RH
  • Temperature Accuracy: ±0.2℃
  • Temperature Resolution: 0.01℃
  • Temperature Measurement Range: -40~125℃

UV Sensor Parameters

  • Sensor Chip Model: LTR390-UV-01
  • UV Sensitive Wavelength: 280-430nm
  • Measurement Data Range: 13 Bit, 16 Bit, 17 Bit, 18 Bit, 19 Bit, 20 Bit
  • Measurement Rate: 25ms, 50ms, 100ms, 200ms, 500ms, 1000ms
  • Adjustable Gain Multiples: 1, 3, 6, 9, 18

Ambient Light Sensor Parameters

  • Sensor Chip Model: VEML7700
  • Ambient Light Accuracy: 0.0036 lx/ct
  • Ambient Light Measurement Range: 0~120 klx

Dimension drawing

Functional indication

Pinout Description

Label Name Function
1 VCC Positive power supply (3.3V~5V)
2 GND Ground
3 R (RXD) UART receive terminal
4 T (TXD) UART transmit terminal
5 C (SCL) I²C clock line (SCL)
6 D (SDA) I²C data line (SDA)
7 NC, NC, NC, NC No connection (reserved pins)

Arduino Tutorial

Upload the program to the FireBeetle Board ESP32-E and open the serial monitor to observe various environmental parameters.

Required Components

Reading Sensor Data via UART/I²C

Wiring Diagram

Usage Instructions

Regarding UART/I2C Mode:

  1. The default code operates in UART mode. Connect the wires according to the diagram above to the corresponding UART pins.
  2. To switch to I2C mode, connect the wires as shown in the diagram to the designated I2C pins and modify the code by replacing 1 with 0 at the beginning, as illustrated.

Procedure

  1. Connect the module to the FireBeetle Board ESP32-E using either of the wiring configurations shown above.
  2. Open the Arduino IDE and upload the provided code to the FireBeetle Board ESP32-E.
  3. Launch the Serial Monitor in the Arduino IDE, set the baud rate to 115200, and observe the printed output.

Sample Code
Function: Retrieves and prints all sensor data

#include "DFRobot_EnvironmentalSensor.h"

#if defined(ARDUINO_AVR_UNO) || defined(ESP8266)
#include <SoftwareSerial.h>
#endif

#define MODESWITCH        /*UART:*/1 /*I2C: 0*/

#if MODESWITCH
  #if defined(ARDUINO_AVR_UNO) || defined(ESP8266)
    SoftwareSerial mySerial(/*rx =*/4, /*tx =*/5);
    DFRobot_EnvironmentalSensor environment(/*addr =*/SEN050X_DEFAULT_DEVICE_ADDRESS, /*s =*/&mySerial);
  #else
    DFRobot_EnvironmentalSensor environment(/*addr =*/SEN050X_DEFAULT_DEVICE_ADDRESS, /*s =*/&Serial1);
  #endif
#else
  DFRobot_EnvironmentalSensor environment(/*addr =*/SEN050X_DEFAULT_DEVICE_ADDRESS, /*pWire =*/&Wire);
#endif

void setup() {
  #if MODESWITCH
    // Initialize MCU communication serial port
    #if defined(ARDUINO_AVR_UNO) || defined(ESP8266)
      mySerial.begin(9600);
    #elif defined(ESP32)
      Serial1.begin(9600, SERIAL_8N1, /*rx =*/D3, /*tx =*/D2);
    #else
      Serial1.begin(9600);
    #endif
  #endif

  Serial.begin(115200);
  while (environment.begin() != 0) {
    Serial.println("Sensor initialization failed!");
    delay(1000);
  }
  Serial.println("Sensor initialized successfully!");
}

void loop() {
  // Print sensor data
  Serial.println("-------------------------------");
  Serial.print("Temperature: ");
  Serial.print(environment.getTemperature(TEMP_C));
  Serial.println(" °C");
  Serial.print("Temperature: ");
  Serial.print(environment.getTemperature(TEMP_F));
  Serial.println(" °F");
  Serial.print("Humidity: ");
  Serial.print(environment.getHumidity());
  Serial.println(" %");
  Serial.print("UV Intensity: ");
  Serial.print(environment.getUltravioletIntensity());
  Serial.println(" mW/cm²");
  Serial.print("Lux: ");
  Serial.print(environment.getLuminousIntensity());
  Serial.println(" lx");
  Serial.print("Pressure: ");
  Serial.print(environment.getAtmospherePressure(HPA));
  Serial.println(" hPa");
  Serial.print("Altitude: ");
  Serial.print(environment.getElevation());
  Serial.println(" m");
  Serial.println("-------------------------------");
  delay(500);
}

Expected Output

The Serial Monitor will display the following formatted data, containing all readings from the sensor module:

Library Function Definitions

/**
 * @fn begin
 * @brief Initializes the SEN0500/SEN0501 environmental sensor
 * @return Initialization status
 * @retval 0  Success
 * @retval -1 Failure
 */
int8_t begin(void);

/**
 * @fn getTemperature
 * @brief Retrieves temperature data from SEN0500/SEN0501
 * @param units Temperature unit selection
 * @n     TEMP_C  Celsius (°C)
 * @n     TEMP_F  Fahrenheit (°F)
 * @return Measured temperature value
 */
float getTemperature(uint8_t units);

/**
 * @fn getHumidity
 * @brief Retrieves relative humidity data from SEN0500/SEN0501
 * @return Measured humidity percentage (%)
 */
float getHumidity(void);

/**
 * @fn getUltravioletIntensity
 * @brief Retrieves UV intensity data from SEN0500/SEN0501
 * @return Measured ultraviolet intensity (mW/cm²)
 */
float getUltravioletIntensity(void);

/**
 * @fn getLuminousIntensity
 * @brief Retrieves ambient light intensity data from SEN0500/SEN0501
 * @return Measured illuminance (lux)
 */
float getLuminousIntensity(void);

/**
 * @fn getAtmospherePressure
 * @brief Retrieves atmospheric pressure data from SEN0500/SEN0501
 * @param units Pressure unit selection
 * @n     HPA  Hectopascal (hPa)
 * @n     KPA  Kilopascal (kPa)
 * @return Measured atmospheric pressure
 */
uint16_t getAtmospherePressure(uint8_t units);

/**
 * @fn getElevation
 * @brief Retrieves altitude/elevation data from SEN0500/SEN0501
 * @return Measured elevation (meters above sea level)
 */
float getElevation(void);

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

SEN0500_V1.0_Schematic.pdf

SEN0500_V1.0_2D_DXF.rar

SEN0500_V1.0_2D_PDF.pdf

SEN0500_V1.0_3D_STP.rar

SEN0500_V1.0_KiCad.rar

SEN0500_V2.0_Schematic.pdf

SEN0500_V2.0_2D_DXF.rar

SEN0500_V2.0_2D_PDF.pdf

SEN0500_V2.0_3D_STP.rar