How to connect ESP32 to relay

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
rp346@njit.edu
Posts: 18
Joined: Sun Sep 16, 2018 6:33 pm

How to connect ESP32 to relay

Post by rp346@njit.edu » Thu Nov 22, 2018 10:27 pm

Hi, I have this https://www.aliexpress.com/item/1PCS-NE ... 49680.html which want to control with ESP32. But not sure how do I connect to this relay to ESP32.

Anyone knows how to do connection ?
- roy

User avatar
mattyt
Posts: 410
Joined: Mon Jan 23, 2017 6:39 am

Re: How to connect ESP32 to relay

Post by mattyt » Fri Nov 23, 2018 4:23 am

It looks like a clone of the v1 Wemos Relay Shield.

So, looking at the schematic, the control pin is D1 and you'll need to connect 5V and GND.

Note that the v2 Relay Shield allows the control pin to be selected; a little nicer. :)

Also, while you can easily wire this to any ESP32 - or indeed any micro - if you want to use the Wemos Shield form factor you can use ESP32 boards that supports that pinout. I've used the TTGO Mini 32 for this use - the inside row of pins is a superset of that Wemos shield layout. Then you can just plug the shield directly into the micro board.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: How to connect ESP32 to relay

Post by Roberthh » Fri Nov 23, 2018 6:23 am

Please do not use that V2 shield https://wiki.wemos.cc/products:d1_mini_ ... lay_shield for switching mains voltage, if the other parts of the circuitry, like the ESP8266 pins or USB, can be touched. It is NOT safe! If you want to use it, put everything in a box with proper isolation and do not connect USB.

rp346@njit.edu
Posts: 18
Joined: Sun Sep 16, 2018 6:33 pm

Re: How to connect ESP32 to relay

Post by rp346@njit.edu » Fri Nov 23, 2018 2:07 pm

Thanks
- roy

Post Reply