devices.esphome.io

LCTech ESP32 Relay Board x16

LCTech ESP32 Relay Board x16

Device Type: relay
Electrical Standard: global
Board: esp32

Product

Product description

This is a 16-relay board with an ESP32-WROOM-E and two 74HC595 shift registers.

Each relay has COM+NO+NC exposed. Each relay supports 10Amp max load (Songle SRD-05VDC-SL-C).

Many vendors advertise that this board can be powered with 5-12VDC. The manufacturer LCTech literature lists it as a 5V product.

I bought it from: https://www.aliexpress.us/item/3256808359095569.html

LCTech Wiki page: http://www.chinalctech.com/cpzx/Programmer/Relay_Module/735.html

Input voltage considerations

The XL1509-3.3 Converter supports up to 40V, but the 470uF input capacitor (C3) is rated at 25V max on at least some variations of these boards.

The Vin supply is fed directly to the relay coils without any regulation or conversion. Voltages higher than 5V may lead to unacceptable power dissipation or shortened relay life.

There does not appear to be any simple solution for reducing the voltage across the relay coils. A naive swap of the 1N4148 snubber diode for a 5V Zener will lead to high power dissipation across the BJT. Snubber Diode

📝 NOTE:

The best course of action is to feed this board with 5V on the VIN terminal.

Serial Progamming Pinout

This board has a 6 pin header for programming. Some images show this header pre-installed. My board shipped the 1x6 header separately and required soldering. The silkscreen labeling of this header was clear on my board. Does expose GPIO0, but does not route EN for automated flash support.

PinComment
3V3Use 3.3V only
TXTTL / 3.3V Serial TX pin
RXTTL / 3.3V Serial RX pin
GND
GND
IO0GPIO0 pin also connected to pushbutton labeled IO0 for programming

GPIO Pinout

This board has two 2x10 headers which provide access to all GPIO pins on its ESP32.

⚠️ CAUTION:

The silkscreen labels on my board did not exactly match the schematic or manual continuity tracing.

Verify correct pinout prior to use!

Header P3 is located closest to the board edge with odd numbered pins closest to the edge

PinComment
1GND
23V3
3SVP
4EN Tied to button labeled EN
5GPIO34
6SVN
7GPIO32
8GPIO35
9GPIO25
10GPIO33
11GPIO27
12GPIO26
13GPIO12 / RCK / 74HC595 RCLK
14GPIO14 / SI / 74HC595 SER
15SD2
16GPIO13 / SCK / 74HC595 SRCLK
17CMD
18SD3
19GND
203V3

Header P2 is located closest to the relay modules with odd numbered pins closest to the board edge

PinComment
1GND
2GPIO23
3GPIO22
4TX
5RX
6GPIO 21
7GND
8GPIO19
9GPIO18
10GPIO5 / G / 74HC595 OE
11GPIO17
12GPIO16
13GPIO4 / SCLR / 74HC595 SRCLR
14GPIO0 Tied to button labeled IO0
15GPIO2
16GPIO15
17SD1
18SD0
19CLK
203V3

Basic Config

esphome:
name: ESP32 relayboard
esp32:
board: esp32dev
# IO0 button can be configured as a binary_sensor
binary_sensor:
- platform: gpio
name: "button1"
pin: GPIO0
# SPI or GPIO configuration of 74HC595 for access to relays
spi:
- id: "spi_bus"
clk_pin: GPIO13
mosi_pin: GPIO14
sn74hc595:
- id: "sn74hc595_hub"
type: spi
spi_id: "spi_bus"
latch_pin: GPIO12
oe_pin: GPIO5
sr_count: 2
# 16 relay outputs, exposed as switches in Home Assistant
switch:
- &common_relay
platform: gpio
id: "relay1"
pin: &common_pin
sn74hc595: "sn74hc595_hub"
number: 0
- <<: *common_relay
id: "relay2"
pin:
<<: *common_pin
number: 1
- <<: *common_relay
id: "relay3"
pin:
<<: *common_pin
number: 2
- <<: *common_relay
id: "relay4"
pin:
<<: *common_pin
number: 3
- <<: *common_relay
id: "relay5"
pin:
<<: *common_pin
number: 4
- <<: *common_relay
id: "relay6"
pin:
<<: *common_pin
number: 5
- <<: *common_relay
id: "relay7"
pin:
<<: *common_pin
number: 6
- <<: *common_relay
id: "relay8"
pin:
<<: *common_pin
number: 7
- <<: *common_relay
id: "relay9"
pin:
<<: *common_pin
number: 8
- <<: *common_relay
id: "relay10"
pin:
<<: *common_pin
number: 9
- <<: *common_relay
id: "relay11"
pin:
<<: *common_pin
number: 10
- <<: *common_relay
id: "relay12"
pin:
<<: *common_pin
number: 11
- <<: *common_relay
id: "relay13"
pin:
<<: *common_pin
number: 12
- <<: *common_relay
id: "relay14"
pin:
<<: *common_pin
number: 13
- <<: *common_relay
id: "relay15"
pin:
<<: *common_pin
number: 14
- <<: *common_relay
id: "relay16"
pin:
<<: *common_pin
number: 15
Edit this page on GitHub