Circuit Documentation
Summary of the Circuit
This circuit integrates an ESP32 development board with an MQ-4 methane gas sensor, a tilt sensor, and a buzzer. The ESP32 serves as the central processing unit, reading sensor inputs and controlling the buzzer based on predefined conditions. The MQ-4 sensor provides analog readings related to the concentration of methane gas in the air. The tilt sensor acts as a digital switch that changes state when tilted. The buzzer is used as an output device to alert users when certain conditions are met, such as the detection of methane gas or a change in the tilt sensor's state.
Component List
ESP 32 DEVKIT V1 (30 pins)
- Description: A microcontroller board based on the ESP32 chip, featuring Wi-Fi and Bluetooth connectivity, with a range of digital and analog pins for interfacing with various sensors and actuators.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, VIN, 3V3, D15, D2, D4, RX2, TX2, D5, D18, D19, D21, RX0, TX0, D22, D23
MQ-4 Methane Gas Sensor
- Description: A gas sensor designed for detecting methane (CH4) concentrations in the air, providing both analog and digital outputs.
- Pins: A0, D0, GND, VCC
Tilt Sensor
- Description: A sensor that detects orientation or inclination changes, providing a digital output when tilted.
- Pins: pin1, pin2
Buzzer
- Description: An electromechanical component that emits an audible tone when powered.
- Pins: POSITIVE, NEGATIVE
Wiring Details
ESP 32 DEVKIT V1 (30 pins)
- D34: Connected to MQ-4 (A0) for analog methane concentration readings.
- 3V3: Provides power to MQ-4 (VCC).
- GND: Common ground connection with MQ-4, tilt sensor, and buzzer.
- D4: Connected to tilt sensor (pin1) to detect tilt events.
- D5: Connected to buzzer (POSITIVE) to control the buzzer's sound.
MQ-4 Methane Gas Sensor
- A0: Connected to ESP32 (D34) for analog methane concentration readings.
- VCC: Powered by ESP32 (3V3).
- GND: Common ground connection with ESP32, tilt sensor, and buzzer.
Tilt Sensor
- pin1: Connected to ESP32 (D4) to detect tilt events.
- pin2: Common ground connection with ESP32, MQ-4, and buzzer.
Buzzer
- POSITIVE: Connected to ESP32 (D5) to be controlled by the microcontroller.
- NEGATIVE: Common ground connection with ESP32, MQ-4, and tilt sensor.
Documented Code
No code has been provided for the microcontrollers in the circuit. To fully utilize the circuit's capabilities, embedded code should be written and uploaded to the ESP32 microcontroller. The code should initialize the necessary pins, read sensor data from the MQ-4 and tilt sensor, and activate the buzzer under specific conditions such as the detection of methane or a tilt event.
