Esp32 + relay hardware tips for gate opening

Hello,

I ve been reading a lot for a few months for my first DIY project and would need help / tips to confirm I’m on the good way.

I will first explain my goal with HA:

  • I want the outdoor gate when people comes in the house to be open either with a keypad and a master code, temporary code like for the gardener only working Tuesday morning for instance, when I go out of the house I want a push button that will open the gate, and also most importantly I need to be able to open the gate when people rings the doorbell using my phone.

That being said, here is what I have successfully got working as a test:
Hiletgo ESP32-wroom-32 with a 4x3 IP65 matrix keypad and a push button, with dupond cables connecting everything. All the logic is managed by the esp32 which successfully interfaces with HA. Up to now I think this is very basic and standard.

Now I’m planning to push that in production at my entry door outside but here is where I struggle and would require help:

  • I ve read a lot of topic about esp32, with warning of cheap quality and fire issues. Therefore I want the automation to work and not the house to burn. I’m a total noob at electric pcb and would like to know what would you choose for esp32 if it were for your house and this type of use, ie in a waterproof box outdoor, with external temperature which could reach up to 40-45C ? I m surprised there is not really a “default” product or brand everybody goes to.
    For me, I would like the esp32 once mounted to be very reliable and fixed, so I think it must have holes so that I can fix it, but also I would like all the pins to be with screws and not having to solder anything. I couldn’t find anything matching this criteria except buying a breakout board, is that the only solution ?
    Still there is no mainstream esp32 with breakout board everyone agrees is the best so I’m asking if you have such reference on hand ? ChatGPT couldn’t help about this or send fake links not reliable.

  • Regarding wiring between the esp32 and relays, which ones would you use ? I m reading a lot also about fake or poor quality cables but couldn’t find something everyone would buy.
    The matrix keypad 4x3 has 12 pins behind it. How would you do to get the most reliable system to connect the keypad to the esp32? Should I buy a molex connector and then wire to the screws of the esp32 so that I’m sure it stays as time goes by ?

  • Same question for relay, in my case it would be single or maybe 2 relays if I want to open the gate or the car gate. What brand would you recommend ? I ve read songle is to be avoided but what are the best and safe available.

This install is critical to enter my house for the next decade and I don’t want to have problem every month or so, hence my topic here to get approval or tips, I have to say I m very surprised those questions don’t have a generally agreed andwers, or at least I haven’t found them.

Thanks for your help

Eric

Fire?? I’ve never heard of this. Cite?
The ESP32 is the processor chip made by Expressif in China. There are dozens of prototype boards that incorporate an ESP32 chip. And there are several versions of the chip to add to the confusion.

I don’t do much with the ESP32’s. Most of my projects use the Wemos D1 Mini based on the ESP8266 (ESP12 module). They are more basic, have all the I/O pins I require, and they are cheap- I buy them 10 at a time from Ali Express. Also, I have nothing requiring Bluetooth. (The ESP8266 is WiFi only). [If someone can show me a DIY project using Bluetooth, I may change my mind]. Oh, one more thing. The Wemos D1 Mini is easily socketed to a perfboard.

If you are concerned about the quality of some of the multitude of Chinese board makers, look at QuinLED. Quinled is based in the Netherlands and the owner, Quindor, is a DIY hobbyist. I bought two of his boards just for evaluation because one of the options is Ethernet. The price is competitive, also.

LEARN TO SOLDER. You may be able to find an ESP32 breakout board with screw terminals, but over time they will be problematic. Especially with wide temperature swings. Dupont jumpers are for bench-top experimentation. NOT for ‘production’. Soldered connections are the most reliable.

The operating spec for the ESP processors is a comfortable -20°C to 85°C, so you are safe there. Put a temperature sensor inside the box to monitor it.
Plastic box, of course. If you use a metal box, your WiFi range will be about one meter.

LOL

Where are you getting this nonsense? First, an ESP cannot drive a relay directly. You either need a powered relay board or a MOSFET transistor interface.

Solder. Everything else has an increased risk of failure due to outdoor exposure. If the keypad has a Molex connector then you could buy the companion connector, but that requires a special crimp tool to attach the wires, or solder. That said, the keypad is the only part that I would make removable wither by a plug or terminal strip.

Screws? I have never seen an ESP board with screw terminals. There may be one. I would even buy one for benchtop experiments, but not for ‘production’. And as I said above, screw terminals are problem prone in outdoor conditions. The connections loosen over time and temperature swings then corrosion creeps in.

Without knowing the specs of the current and voltage of the motors controlling the gates, no one will guess. If it is like a typical garage door opener a small relay will be OK. But you will not drive a relay from an ESP. The GPIO pins are limited to 20mA,

Learn to solder.

Because, you are asking unusual questions.

Begin with a schematic of your proposed system. Without a proper schematic, every reply to your questions will be a guess.

I’ve seen nothing in your intent of controlling gates that is beyond an ESP device.

I was general, but I read [Songle Relay board safety concerns with 240V] and was a bit scared, once again it’s my first project so just want to make sure I don’t make a big mistake I will quickly regret.

In my project I don’t plan to do electricity, I have taken a profesional company, but the logic around the ESP and HA they don’t know how to do it and I wanted to get them answers so that they could work properly and so that my end user requirements are met.

Regarding Wemos D1 Mini, it looks to fit my need indeed, for my setup my matrix keypad has 7 pins to use, and 1 pin + GND for the push button to open the gate, FYI below a picture of my test project which worked well, you can see the keypad, the ESP32 and the push button which will be used to open the gate when going out from the inside.

Roger that, so be it and I will learn, that should be doable :). I may have not been looking at the good places but couldn’t find anything related about how to build something ready for production which would looked like my case. I want to build it for production and then not touch it anymore.

How would you mount the Wemos, I was thinking of screwing it in a plastic IP65 box close to the gate, would that be ok ?

I thought that I only had to connect the ESP to a basic relay like this AE Relay but then reading the first topic I mentionned I was a bit scared about what type and brand of relay I should use.

Do you mean that I first have to decide what type of gate strike I will put and then I will be able to decide the type of relay ? I was thinking something like this: AE electric strike
I will have to liaise with the electricity company, I was thinking the relay would work whatever the type of strike chosen, or it was something very commonly used.

How should the ESP / D1 be wired to the relay ? should it be screwed or soldered ? Can’t we use wago ?

I’m not 100% sure it’s MOLEX (sorry, still my first project), but how would you go for production with this ? Would you solder as well cables between the keypad and the ESP / D1 ? Looks a pain to solder in the keypad or there must be something obvious how to do it which I don’t see.

Thanks for your help

You need to know the current and voltage required by the strike. But looking at this one, most relay modules would work.

I looked at the keypads on the AE page that your link brought up. I have no need for a keypad or strike, but the keypads on that page look interesting. I had never heard of the Wiegand signal: WG26/34 that the keypad uses, but to my surprise there is an ESPHome configuration for that keypad and it only uses two wires to the ESP,

Again, without a schematic of your planned project - EVERYTHING suggested is a guess.

Update
I am a sucker for new toys. I just bought one of the Wiegand keypads to replace my 20-year-old garage door keypad.