Gate Contact Sensor - ESP8266

Thread Starter

stevenafc

Joined Apr 7, 2021
5
Hi all,

I have moved into a house which has an old CAME electric gate which I would like use an ESP8266 to interface with in order to determine whether the gate is open / close or in between. The gate has limit switches as part of it's mechanism which I would like to utilise. Gate manual here.

Capture2.PNG

My plan is to use the 24VAC rail (4) from the CAME motherboard to power the ESP8266, this is intended to power accessories. The limit switches header (9) uses 5v signaling on 3 connection Gate Open / Gate Closed / Common.

From probling around the Gate's motherboard I was unable to find an easy to connect to (without soldering) header which would reliable produce 5v under any load - which is why I opted to try the 24v header.

This is my first circuit design since designing a terrible musical keyboard in school in 1999. I started designing the following schematic and quickly realised I may have some issues.

Circuit.png

In my schematic I have represented AC common as GND and post rectification common as 0v.

Because I am trying to interface with a DC signal from an AC power source I am confused as to how the common would work. By rectifying the AC myself have I created an entirely different common from the what the gate motherboard is using for it's logic or are they connected?
 

sghioto

Joined Dec 31, 2017
5,390
Where does the 24vac come from?
Is there a step down transformer?
EDIT: Never mind I see the transformer on the board where the power cord is connected.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,508
How you will power that ESP8266 device depends very much on what power it requires. As I have no clue about what it even is, I am not able to offer any suggestion about that.
A Separate, isolated, power source is the safest way to avoid hidden connection problems, as well as avoiding any overload to the present system supply, which may not be able to provide power for any additional items.
So this is not much of a solution, but rather a way to avoid possible problems.
And it seems that Yaakov knows what he is talking about!
 

BobTPH

Joined Jun 5, 2013
8,967
I can't for the life of me figure out what you are trying to do with the section labeled "Microcontroller pin protection."

In the first schematic you drive the output with two separate voltage dividers from 5V to 3.3V. In the second you drive each of them from an opto-isolator that is always turned on.

These ought to be input and output for synchronous communication MISO and MOSI. Depending on who is the master and who is the slave, one will be an input and the other an output, so what you are doing makes no sense.

Bob
 

MisterBill2

Joined Jan 23, 2018
18,508
It is NOT a half wave bridge rectifier, just a half wave rectifier. That circuit allows for one of the AC source connections to be grounded, while a bridge with 4 diodes does not allow for either AC input to be grounded.
In post #4, GO and GC are 5 volt signal outputs from that ESP8266 device, whatever it is, as shown to the right.
 

sghioto

Joined Dec 31, 2017
5,390
In post #4, GO and GC are 5 volt signal outputs from that ESP8266 device, whatever it is, as shown to the right.
The GO and GC signals are from the limit switches in the gate mechanism, see paragraph 2 in post 1.
Pins 5 and 6 are configured as inputs on the ESP8266
The ESP8266 is a micro controller module with wifi capability.
 

ericgibbs

Joined Jan 29, 2010
18,849
How you will power that ESP8266 device depends very much on what power it requires. As I have no clue about what it even is, I am not able to offer any suggestion about that
Hi Bill,
Why do you persist in criticizing other posters solutions to a problem, when
Quote "As I have no clue about what it even is, I am not able to offer any suggestion about that "

I use the ESP8266 in projects and the half-wave rectifier circuit is suitable for this application, especially with the high 24Vac to +5Vdc overhead.

So please stop sowing doubts in the mind of the TS, focus on Topics you know something about.
E
 

Thread Starter

stevenafc

Joined Apr 7, 2021
5
I can't for the life of me figure out what you are trying to do with the section labeled "Microcontroller pin protection."

In the first schematic you drive the output with two separate voltage dividers from 5V to 3.3V. In the second you drive each of them from an opto-isolator that is always turned on.

These ought to be input and output for synchronous communication MISO and MOSI. Depending on who is the master and who is the slave, one will be an input and the other an output, so what you are doing makes no sense.

Bob
The gate's limit switch header has 3 connections, FC, FA and F which is common. I used a multimeter to measure FA / FA against F during the gate's different states:

StateFCFA
Gate Open0v4.7v (DC)
Gate Closed4.7v (DC)0v
Opening (neither limit switch activated)0v0v

From this my understanding is that both FC and FA are putting out a 4.7v signal, which gets pulled to ground when the respective limit switches are opened (the switches are wired NC).

limit switches.PNG

I was hoping I could use the 4.7v signal from the FC / FA headers to drive (originally) the input pin on the 8266 at 3.3v and with the new schematic I am hoping I can drive an optoisolator using that 4.7v signal.

I just tried (with a breadboard) connecting FC through the optoisolator, which on the otherside had a 9v battery and an LED and it did turn on the LED. I also tried connecting the LED directly to FC / F and judging by the brightness of the LED the current is minimal at best so I am a bit concerned that I may impact the operation of the gate by drawing too much current.
 

MisterBill2

Joined Jan 23, 2018
18,508
Hi Bill,
Why do you persist in criticizing other posters solutions to a problem, when
Quote "As I have no clue about what it even is, I am not able to offer any suggestion about that "

I use the ESP8266 in projects and the half-wave rectifier circuit is suitable for this application, especially with the high 24Vac to +5Vdc overhead.

So please stop sowing doubts in the mind of the TS, focus on Topics you know something about.
E
There was no criticism in that remark. And it is always useful to know the power requirements of a device one wants to power. And a half-wave rectifier is not a bridge rectifier, it is simply a rectifier. And I did not say it would not work for the application.
 

ericgibbs

Joined Jan 29, 2010
18,849
hi Bill.
Nowhere do I state bridge rectifier, and I know that a half-wave rectifier is not a bridge rectifier.

If you read the TS's opening properly, he cannot use a full bridge rectifier.!

I also know the power requirements of the ESP device, that's why I recommended that a single diode would be good enough for the project.

E
 

MisterBill2

Joined Jan 23, 2018
18,508
The "bridge rectifier" reference is in the box showing a half wave rectifier in post #4. THAT is what I was addressing. Not one of your posts. It was indeed a reasonable circuit, but the name attached was not correct.
 
Top