ESP32C3-Based Environmental and Health Monitoring System with BME280 and MAX30102 Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes a BME/BMP280 sensor, two resistors, an XIAO ESP32C3 microcontroller, and a MAX30102 Heart Rate and Oxygen Sensor. The circuit is designed to interface these components using I2C communication, with the microcontroller controlling the sensors and reading data from them.
Component List
BME/BMP280
- Description: A combined digital humidity, pressure, and temperature sensor.
- Pins: GND, SCL, SDA, VIN
Resistor (1)
- Description: A resistor with a resistance of 4700 Ohms.
- Pins: pin1, pin2
- Properties:
- Resistance: 4700 Ohms
XIAO ESP32C3
- Description: A microcontroller based on the ESP32-C3 chip.
- Pins: GPIO2/A0/D0, GPIO3/A1/D1, GPIO4/A2/D2, GPIO5/A3/D3, GPIO6/SDA/D4, GPIO7/SCL/D5, GPIO21/Tx/D6, 5V, GND, 3V3, GPIO10/MOSI/D10, GPIO9/MISO/D9, GPIO8/SCK/D8, GPIO20/Rx/D7
Resistor (2)
- Description: A resistor with a resistance of 4700 Ohms.
- Pins: pin1, pin2
- Properties:
- Resistance: 4700 Ohms
MAX30102 Heart Rate and Oxygen Sensor
- Description: A sensor for measuring heart rate and blood oxygen levels.
- Pins: VIN, SCL, SDA, INT, IRQ, RD, GND
Wiring Details
BME/BMP280
- GND: Connected to GND of XIAO ESP32C3 and MAX30102 Heart Rate and Oxygen Sensor.
- SCL: Connected to GPIO7/SCL/D5 of XIAO ESP32C3 and SCL of MAX30102 Heart Rate and Oxygen Sensor.
- SDA: Connected to GPIO6/SDA/D4 of XIAO ESP32C3 and SDA of MAX30102 Heart Rate and Oxygen Sensor.
- VIN: Connected to 3V3 of XIAO ESP32C3, pin1 of Resistor (1), VIN of MAX30102 Heart Rate and Oxygen Sensor, and pin2 of Resistor (2).
Resistor (1)
- pin1: Connected to 3V3 of XIAO ESP32C3 and VIN of BME/BMP280.
- pin2: Connected to GPIO6/SDA/D4 of XIAO ESP32C3, SDA of BME/BMP280, and SDA of MAX30102 Heart Rate and Oxygen Sensor.
XIAO ESP32C3
- GND: Connected to GND of BME/BMP280 and MAX30102 Heart Rate and Oxygen Sensor.
- 3V3: Connected to VIN of BME/BMP280, pin1 of Resistor (1), VIN of MAX30102 Heart Rate and Oxygen Sensor, and pin2 of Resistor (2).
- GPIO6/SDA/D4: Connected to pin2 of Resistor (1), SDA of BME/BMP280, and SDA of MAX30102 Heart Rate and Oxygen Sensor.
- GPIO7/SCL/D5: Connected to pin1 of Resistor (2), SCL of BME/BMP280, and SCL of MAX30102 Heart Rate and Oxygen Sensor.
Resistor (2)
- pin1: Connected to GPIO7/SCL/D5 of XIAO ESP32C3, SCL of BME/BMP280, and SCL of MAX30102 Heart Rate and Oxygen Sensor.
- pin2: Connected to 3V3 of XIAO ESP32C3, pin1 of Resistor (1), VIN of BME/BMP280, and VIN of MAX30102 Heart Rate and Oxygen Sensor.
MAX30102 Heart Rate and Oxygen Sensor
- GND: Connected to GND of XIAO ESP32C3 and BME/BMP280.
- SCL: Connected to GPIO7/SCL/D5 of XIAO ESP32C3 and SCL of BME/BMP280.
- SDA: Connected to GPIO6/SDA/D4 of XIAO ESP32C3 and SDA of BME/BMP280.
- VIN: Connected to 3V3 of XIAO ESP32C3, pin1 of Resistor (1), VIN of BME/BMP280, and pin2 of Resistor (2).
Code Documentation
XIAO ESP32C3 Code
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
Serial.print("Test: ");
}
- File Name: sketch.ino
- Description: This code initializes the built-in LED on the XIAO ESP32C3 as an output and sets up a serial communication at 9600 baud rate. The loop function toggles the LED on and off every second and prints "Test:" to the serial monitor.