Skip to content

Hardware configuration for LILYGO TTGO ESP32 4 channel relay board

Olli edited this page Dec 2, 2022 · 7 revisions

See the introduction video and its description.

Hardware Configuration

With standard configuration, you can control max 6 channels, controlling integrated or wifi-connected relays (Shelly or Tasmota). In this example, the board supports 4 GPIO relays. With this configuration, you can control for example 12 VDC-controlled AC relays by switching power on and off or you can select between the pre-programmed temperature levels of a heat pump or a floor heating system by simulating a manual away/home switch.

lilygo-junction-box

This document shows how low-voltage (24 VDC and below in this case) wiring (power to the ESP32 board and external relays) is made inside the junction box containing only low-voltage. Always leave mains current installations to a licensed electrician who also selects components that can be used in the mains current installations.

Wiring the board and modules

LilyGo Relay- Arska 24VDC wiring drawio (1)

  • Relay 1 has device 1 connected to a NO and COM terminals. If the relay does not get input voltage, the external relay is open and the dev 1 is not energized.
  • Relay 2 has a device connected to an NC and COM terminals. This is fault-tolerant wiring i.e. even if the relay does not get input voltage, the external relay is closed and device 2 is energized.
  • Relay 3 is connected to the dry contact of device 3 (NO+COM). In GPIO mode (relay type) the circuit is open when channel 3 is down and closed when it is up. In Inversed GPIO mode the circuit is open when channel 3 is up and open if it is down. Inversed GPIO mode is fault-tolerant i.e. the circuit is closed when the channel is up as well as when the microcontroller is not energized (or faulty).
  • Relay 4 is connected to the dry contact of device 4 (NC+COM). In GPIO mode the circuit is closed when channel 4 is down and open if it is up. Inversed GPIO mode is fault-tolerant i.e. the circuit is closed when the channel is up as well as when the microcontroller is not energized (or faulty).

Components and Tools used in this sample configuration

Components

Enclosure for the microcontroller

You can use for example an electrical connection box (metal would block wifi signals) for the controller and mount first the microcontroller board with spacer screws to a thin plywood or plastic board, which is fixed with screws to the box.

Make holes and prepare strain relief (strain relief connector, clamps, cable tie, knots...) for the wires, so that pulling accidentally a wire does not harm the connections. Make sure that there is ventilation/airflow through the box so that the controller (with wifi) does not run too hot, which could shorten its life expectancy.

Tools

  • Soldering iron and soldering tin for pin headers
  • Cutters, crimping tools
  • Screwdriver(s)
  • Drill

Optional tools:

  • Multimeter for checking wiring and connections