ESP32 Dual Channel Relay Module

The ESP32 Dual Channel Relay Module is a versatile and powerful solution for controlling devices via Apple HomeKit. Featuring the ESP32-WROOM-32E board, this module delivers excellent performance, reliability, and extensive capabilities for smart home automation.

Module Overview

This module combines the powerful ESP32 microcontroller with two integrated relays, allowing you to independently control two different devices. It is ideal for applications such as lighting, fans, pumps, motors, or blinds.

Key features:

  • ESP32-WROOM-32E: Wi-Fi and Bluetooth support
  • Dual Channel Relays: Independent control of two circuits
  • Integrated Power Supply: Converts 220V AC to 5V DC, then regulates to 3.3V via an 1117 voltage regulator for the ESP32 module
  • Optocouplers and Galvanic Isolation: Ensures safe separation between the ESP32 and load
  • Ease of Use: Clearly labeled terminals for power and load connections
  • Comes with: Pin headers and jumper for configuration
  • Programming Interface: Accessible pin row below the ESP32-WROOM-32E module
  • Apple HomeKit Compatibility: Fully compatible with the esp32-homekit library

Specifications

FeatureSpecification
Input VoltageAC 220V to DC 5V, then 3.3V via 1117 regulator
ESP32 ModelESP32-WROOM-32E
Wi-Fi802.11 b/g/n
BluetoothBluetooth 4.2 BLE
Relays2 x 10A/250VAC, 10A/30VDC
GPIO PinsFully accessible
PCB Dimensions71 mm x 46 mm

Note: One limitation of this module is the absence of a protective ground (earth) connection.

Pinout and Connections

Clearly marked terminals make this module easy to use:

  • COM1, NO1, NC1: Common, Normally Open, Normally Closed (Relay 1)
  • COM2, NO2, NC2: Common, Normally Open, Normally Closed (Relay 2)
  • GND and 5V: Power inputs
  • GPIOs: Directly accessible via pin headers

ESP32 GPIO Pinout

Based on the PCB silkscreen, the module provides three pin headers:

Header 1 (Top Right Vertical):

LabelFunction
G23GPIO23 | Onboard LED
GNDGND
TXDTXD
G22GPIO22
RXDRXD
G21GPIO21
G19GPIO19
GNDGND
G5GPIO5
G18GPIO18
G16GPIO16 | Relay 1
G17GPIO17 | Relay 2
G0GPIO0
G4GPIO4
G15GPIO15
G2GPIO2
SDOGPIO23
SD1GPIO22
3V33.3V
CLKGPIO0

Header 2 (Bottom Right Vertical):

LabelFunction
GNDGND
3V33.3V
ENENABLE
SVPGPIO36
SVNGPIO39
G34GPIO34
G35GPIO35
G32GPIO32
G33GPIO33
G25GPIO25
G26GPIO26
G27GPIO27
G14GPIO14
G12GPIO12
SD3GPIO10
CMDGPIO11

Header 3 (Bottom Center Horizontal – Programming):

LabelFunction
5V5V Input
GNDGND
RXRX (GPIO3)
TXTX (GPIO1)
GNDGND
IO0GPIO0 (Boot Mode)

Programming Interface

The row of six pins located below the ESP32-WROOM-32E module is used for flashing firmware. The pin order from left to right is:

  • VCC
  • TX
  • RX
  • GND
  • GND
  • IO0

To program the module:

  1. Connect a 5V FTDI programmer to the corresponding pins (TX to RX, RX to TX, GND to GND, and VCC to 5V).
  2. Place a jumper between GND and IO0 to enable bootloader (programming) mode.
  3. Power the module and flash firmware using your development environment (e.g., Arduino IDE or ESP-IDF).
  4. After flashing, remove the jumper and reset or power-cycle the module.

Hardware Integration

Connecting the module is straightforward:

  1. Connect a stable 220V AC power supply; the module automatically converts this to 5V DC.
  2. The onboard 1117 regulator then provides a stable 3.3V supply for the ESP32.
  3. Connect your devices to the relay terminals using COM, NO, and NC.

Important: Always turn off the power before making or modifying connections to ensure safety.

ESP32 Software Configuration

This relay module works perfectly with my esp32-homekit library, allowing for simple and reliable Apple HomeKit integration.

Usage Tips

  • Ensure safe load handling and respect the relay capacity.
  • Use the galvanic isolation feature to protect the ESP32.
  • Leverage Apple HomeKit for intuitive automations and scenes.

Project Examples

Here are some ideal use cases for this module:

  • Smart Lighting: Control lights via Siri or automation routines.
  • Blinds and Shades: Precisely control motors with percentage-based positioning.
  • Automatic Irrigation: Smart garden systems with automated watering.
  • Ventilation Systems: Intelligent fan control for optimal air quality.

Conclusion

The ESP32 Dual Channel Relay Module offers a robust and user-friendly solution for smart home automation with Apple HomeKit. By combining powerful hardware with intuitive software integration, you can easily create advanced automations. Explore the possibilities and take your smart home projects to the next level!

Scroll to Top