Circuit Documentation
Summary
This circuit involves an ESP32 microcontroller, a 12V relay, a plastic solenoid valve, and power supply components (Vcc and GND). The ESP32 controls the relay, which in turn controls the solenoid valve. The relay is powered by the ESP32 and the solenoid valve is powered by an external Vcc source.
Component List
ESP32 (30 pin)
- Description: A versatile microcontroller with built-in Wi-Fi and Bluetooth capabilities.
- Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
12V Relay
- Description: An electromechanical switch used to control high voltage devices with a low voltage signal.
- Pins: NO, COM, NC, IN, DC-, DC+
Vcc
- Description: Power supply providing a positive voltage.
- Pins: Vcc
GND
- Description: Ground connection.
- Pins: GND
Plastic Solenoid Valve
- Description: A valve controlled by an electromagnetic solenoid.
- Pins: pin1, pin2
Wiring Details
ESP32 (30 pin)
- D4 is connected to DC+ of the 12V Relay.
- GND is connected to DC- of the 12V Relay.
- 3V3 is connected to IN of the 12V Relay.
12V Relay
- DC+ is connected to D4 of the ESP32.
- DC- is connected to GND of the ESP32.
- IN is connected to 3V3 of the ESP32.
- COM is connected to pin1 of the Plastic Solenoid Valve.
- NC is connected to GND.
Plastic Solenoid Valve
- pin1 is connected to COM of the 12V Relay.
- pin2 is connected to Vcc.
Vcc
- Vcc is connected to pin2 of the Plastic Solenoid Valve.
GND
- GND is connected to NC of the 12V Relay.
Code Documentation
ESP32 Code
void setup() {
Serial.begin(115200);
pinMode(4, OUTPUT);
}
void loop() {
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
}
Description:
- setup(): Initializes the serial communication at a baud rate of 115200 and sets pin 4 as an output.
- loop(): Toggles pin 4 HIGH and LOW with a delay of 1 second (1000 milliseconds) between each state. This will control the relay connected to pin 4, turning it on and off every second.
This code is intended to control the relay, which in turn controls the solenoid valve, allowing it to open and close at 1-second intervals.
