# Finding electric automatic gate openers state

#### Meesen0743

Joined May 19, 2020
3
Hi everyone,

I am currently working on a home automation project where I am trying to determine the state of an electric automatic gate opener.

The actuating arm has 5 wires, with 2 of them being the closed state reed switch; although as I have found it is not just a simple reed switch, it is a reed switch with 2 transistors and has an input of 24v (don't ask me how i found out)

I have replaced the 2 transistors and the gate is once again working . During the repair process i jotted down the wiring diagram of the circuit so hopefully I can somehow get a state from it (either NO or NC) that i can then integrate with Tasmota running on a d1 mini.

Attached is a screenshot of the circuit in Circuitjs1, and when the switch is closed the yellow wire drops approximately 1v.

If anyone could help me with a circuit that won't fry the reed circuit again it would be really appreciated
Thanks,
Meesen0743

#### Attachments

• 39.2 KB Views: 17

#### Alec_t

Joined Sep 17, 2013
12,009
Does the gate-opening motor connect to the yellow wire? If so, the load resistance on the circuit shown will be a lot less than 1.5Meg and will make detecting the switch state easier.

#### Meesen0743

Joined May 19, 2020
3
The motor itself does not, the yellow wire and green wire are a separate circuit in the actuator arm with the reed switch.

Last edited by a moderator:

#### Alec_t

Joined Sep 17, 2013
12,009
I'm puzzled as to why your circuit includes the NPN/PNP Sziklai pair if it's not passing relatively high actuator motor current.
So, assuming the yellow wire doesn't see a low-resistance load, I suggest you could monitor the voltage across the switch to indicate its state. This might require dividing down the voltages at both sides to be within the input range of a comparator or micro.

#### Meesen0743

Joined May 19, 2020
3

#### Attachments

• 28.1 KB Views: 2
Last edited:

#### Alec_t

Joined Sep 17, 2013
12,009
You can't put 7.5V into the comparator if its supply voltage is only 5V. Why not use the 23V supply? That comparator has an output transistor with open emitter and collector, so you could connect the collector via a pull-up resistor to +5V.