This circuit integrates a variety of components including microcontrollers, sensors, a motor, a relay, and a display. The primary microcontroller is an ESP32-S3, which interfaces with a DHT22 temperature and humidity sensor, an Adafruit INA260 current and voltage sensor, an HC-SR04 ultrasonic sensor, an SGP41 VOC and NOx sensor, and a 0.96" OLED display. The circuit also includes an Arduino UNO, which is connected to a rotary encoder. A DC Mini Metal Gear Motor and a 12V relay are controlled by the ESP32-S3. Power management is handled by a step-down buck converter, which steps down the voltage from a 12V battery. The circuit also includes an SD card module for data logging.
3v3
connected to SD card module 3V3
.GND
connected to common ground.GPIO16
connected to DHT22 Out
.GPIO18
connected to SCL line shared with Adafruit INA260 and SGP41 sensor.GPIO9
connected to Arduino UNO D1
.GPIO10
connected to 12V relay IN
.GPIO11
connected to 0.96" OLED SCK
.GPIO40
connected to SD card module CS
.GPIO39
connected to SD card module MOSI
.GPIO37
connected to HC-SR04 TRIG
.GPIO36
connected to HC-SR04 ECHO
.GPIO35
connected to SD card module CLK
.GPIO0
connected to SD card module MISO
.GPIO21
connected to 0.96" OLED SDA
.GPIO19
connected to SDA line shared with Adafruit INA260 and SGP41 sensor.GND
connected to common ground.Vin
connected to step-down converter OUT +
.D2
connected to rotary encoder A
.D3
connected to rotary encoder B
.+
connected to common VCC.Out
connected to ESP32-S3 GPIO16
.-
connected to common ground.VCC
connected to common VCC.GND
connected to common ground.SCL
connected to ESP32-S3 GPIO18
.SDA
connected to ESP32-S3 GPIO19
.IN-
connected to one side of a resistor network.IN+
connected to DC Mini Metal Gear Motor IN2
.IN1
connected to common ground.IN2
connected to Adafruit INA260 IN+
.NO
connected to LED anode.COM
connected to 12V battery +
.NC
not used in this circuit.IN
connected to ESP32-S3 GPIO10
.DC-
connected to common ground.DC+
connected to common VCC.anode
connected to 12V relay NO
.cathode
connected to 12V battery -
.+
connected to step-down converter IN +
and 12V relay COM
.-
connected to LED cathode and step-down converter IN - GND
.IN +
connected to 12V battery +
.IN - GND
connected to 12V battery -
.OUT +
connected to common VCC.OUT - GND
connected to common ground.GND
connected to common ground.VDD
connected to common VCC.SCK
connected to ESP32-S3 GPIO11
.SDA
connected to ESP32-S3 GPIO21
.VCC
connected to common VCC.TRIG
connected to ESP32-S3 GPIO37
.ECHO
connected to ESP32-S3 GPIO36
.GND
connected to common ground.VIN
connected to common VCC.GND
connected to common ground.SCL
connected to ESP32-S3 GPIO18
.SDA
connected to ESP32-S3 GPIO19
.3V3
connected to ESP32-S3 3v3
.CS
connected to ESP32-S3 GPIO40
.MOSI
connected to ESP32-S3 GPIO39
.CLK
connected to ESP32-S3 GPIO35
.MISO
connected to ESP32-S3 GPIO0
.GND
connected to common ground.void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code for the Arduino UNO is a template and does not contain any functional code specific to this circuit.