Power from electric gate + sensing 24V output

I am using a Wemos D1 (not mini) to interface with my electric gate on my driveway. The board that's on the gate has a 24v output for accessories (max 300mA), and my D1 says the barrel plug can be up to 24v. So far so good! It also has 2 connections that when closed, triggers an opening/closing, so I got a relay (with optocoupler isolation) to do this. This much also works and I am very happy!

I now want to detect if the gate is open/closed. The board also has a programmable output (for flashing lights etc.) that is 24v output, labelled "LP". It can be programmed to be on when closed or open. So I got a 0-25v DC voltage sensor (it's just a voltage divider) for this.

However when testing the 24v output, I have found some strange behaviour:

  1. When I have the wemos D1 board powered by the accessory power of the board, with my meter I am reading 36v on this LP output, not 24v. If I disconnect the D1 board from accessory power and instead power it with an external source, I get the expected 24v. Why would this be, why the extra 12v? Unfortunately to power with an external source I had to have a wire going through the gate, which makes it inneffective as a gate, so this is not a long term solution :smiley: I really need to be able to use the power the gate provides.

  2. Before I measured the 36v, I connected the voltage sensor up to my board, to A0 and GND. (:grimacing: luckily I don't think anything broke). I found that no matter what the status of the gate (open or closed), the LP output was reading 36v. If I disconnected the voltage sensor to the D1, open gave me 36v and closed gave me 0v. This does my head in, I can't understand why connecting it would change the behaviour of this output!

Here's what it looks like in "prototype" stage. The 0/1 connection is the accessory power output. The 30/5 connection is connected to the relay. The LP +/- is connected to the voltage sensor (in this pic not connected to the D1). In this state I get the 36v/0v readings for open/closed. If I connect the S or GND pins from the voltage sensor to the D1, I start getting 36v/36v.

Can anyone explain this behaviour (I initially expected some sort of grounding issue but couldn't see a problem)? What might I have done wrong?


Can you provide a better schematic than the picture allows, and post your code too?

Hi, @philip_nelson
Can you also post a picture of the diagram on the side of the gate controller?
What make/model is the gate controller?

A schematic with pin and component labels would be appreciated as asked by @er_name_not_found .

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Can you verify your 24v is dc or ac?

It sounds like the difference between a rectified 24V and 24V with a capacitor filter (input of the Wemos?).

It does seem weird to have such an output.


Good question, I have come across bigger commercial/industrial gate controllers that use 24AC, possibly to help prevent electrolytic corrosion on distant sensors/switches with long connecting leads.

Tom... :smiley: :+1: :coffee: :australia:

The gate controller is a Entrematic Ditec ION4 (see http://motepro.com.au/Manuals/Ditec/Sliding/ION4-6_IP2288EN.pdf which has details. Taken from page 14:

page 21:

Details of the 30/5 connection:


and "LP":

and here is my "schematic":

Note that also 1-6 and 1-8 are connected, they are safety stop/safety closing (gate installer did this). 0 goes to earth.

I'm using esphome so no "code", I can paste my yaml if that helps but it's pretty simple, there's not much to it.

Also here's the options for the LP output:
I set it to "07".
When I don't have the D1 plugged into accessory power, using my meter I see the expected 0/24v when the gate is closed/open from the LP output.

Thanks for the info.

What is your relay?
Is the 36V you measure across the barrel plug when it is unplugged from the D1?

If you put your DMM in volt AC range, what does the LP voltage measure?

Tom... :smiley: :+1: :coffee: :australia:

Relay is this:

It's not the barrel plug I'm measuring the 36V, it's the "LP" output.
When I unplug the barrel plug to my D1, I get 24V on the LP output. When I plug in the D1 (barrel plug is plugged in to 0/1 connections), I get 36V on the LP output.


It sounds like the 24Vdc has a different gnd to the gnd of the output you are detecting from the gate controller.
If you disconnect the voltage sensor completely what LP voltage do you get.
Have you tried the Vac reading yet?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

I would try it with FF = ON

Just tried, got 83V.

I tried disconnecting the D1 power again and this time it stayed at 36Vdc, so now I'm really confused :confounded: I was sure it was dropping to 24V when I was testing this last night.

I'm going to have to do some more testing to try and figure out what's going on. It does seem like grounding issue.

Thanks a lot for your help so far guys.

Did you measure directly across LP + and LP - ?

You've already connected your Wemos D1 to the LP pins .... is this correct?

If so I would suggest you load the D1 with the Arduino example "Blink w/o delay"
Connect ONLY the D1 to the LP pins and see if the led on the board blinks. Then measure the voltage at LP.

BTY what are you using to measure the LP voltage?

Yes, directly from LP+ to LP- with nothing else connected.

LP pins to the voltage sensor to the wemos. Power from the 0/1 pins on the gate board to the barrel plug on the Wemos.

A cheap multimeter.

Best to approach bit by bit (pun intended :slight_smile: )

I suggest you load the D1 with the Arduino example "Blink w/o delay"
Connect ONLY the D1 to the LP pins and see if the led on the board blinks. Then measure the voltage at LP.

Sorry I'm not following why you're suggesting to connect the D1 only to the LP pins. I am already successfully powering the D1 from the 0/1 pins (24Vdc output) and have the relay working. I can remotely open/close the gate by sending commands to switch the relay. I'm very happy with this part.

I'm now trying to use the LP output to detect the gate open/close status, as that output can be set to supposedly output 24V when the gate is open and 0V when it's closed. This is why I have the voltage sensor connected to the LP pins.

Anyway, I tested some more last night and have found that when I have the D1 powered by the gate board, the gate remote only works when it's really close. I'm guessing the D1/esp8266 is drawing too much power, which reduces the effectiveness of the built-in receiver. This doesn't pass the wife-test. As cool as opening the gate from my phone is, we still want the old school remotes to work. I am going to have to find a way to power the D1 from another source. This will also resolve the issues I'm having with the LP output, as when I externally power the D1, I get the expected 24V from it.

I misread the first post, I though you were getting power from the LP, but you are trying to sense the LP.

So my suggestion (what I would do) is to disconnect the relay board, and whatever else you have connected to LP and 0/1.

Then connect ONLY the D1 to the 0/1. Retest your remotes.

What I'm trying to suggest here is to start with the minimum hardware (D1) and slowly add additional hardware to find what is causing your issues.

BTW how are you sensing the LP output with your D1?

Yeah I tried this last night. Only power to D1 and nothing else connected. The remotes had to be really close to work :frowning:
I think I can fit another small power cable in through the conduit that goes to this box. I think this will solve all of the problems.

Thanks for your suggestions :+1:

Before you go through the trouble or running another wire I suggest you try one more test:

Leave the D1 connected but add the below statements to turn off the WiFi on the D1. My thought is perhaps its not a lack of power that reduced the range of your remotes but the existence of the WiFi in the vicinity.

#include <ESP8266WiFi.h>  // for WIFI_OFF

// Operational Parameters:

// device setup:

void setup()

// Disable WiFi radio:
    WiFi.disconnect();    // probably the same as WiFi.mode (WIFI_OFF)
    //alternate code:    WiFi.mode( WIFI_OFF );
    delay(2); // needed for some unknown reason

Thanks for the idea, I tested this just by powering it from an external source and the remote still worked well (pretty sure it's 433MHz).

I ended up routing another power cable (from a 24Vdc outdoor power pack) through the conduit to get to the wemos inside the gate motor cover. Everything is now working as expected. Still a bit of a mystery about the LP output but that problem has now gone away, I get the expected output now I don't have it powered from the gate board. :slight_smile:

Thanks for your help guys :+1: