Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-Based Wi-Fi Controlled Solenoid Valve with Relay

View and Edit Project In Cirkit DesignerImage of ESP32-Based Wi-Fi Controlled Solenoid Valve with Relay

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

  1. 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
  2. 12V Relay

    • Description: An electromechanical switch used to control high voltage devices with a low voltage signal.
    • Pins: NO, COM, NC, IN, DC-, DC+
  3. Vcc

    • Description: Power supply providing a positive voltage.
    • Pins: Vcc
  4. GND

    • Description: Ground connection.
    • Pins: GND
  5. Plastic Solenoid Valve

    • Description: A valve controlled by an electromagnetic solenoid.
    • Pins: pin1, pin2

Wiring Details

ESP32 (30 pin)

12V Relay

Plastic Solenoid Valve

Vcc

GND

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:

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.