Invisible and cheap door and window sensors

Hi,

(also look at my second message below with pictures)
I want to share how I made the door and window open/close sensors myself. I am a hardware design engineer and like to make my own solutions. In the rotating part I use a small magnet (10mm round magnets from aliexpress). In the door/window frame I could use a reed relay, but instead of moving parts, I use a semiconductor solution. An omnipolar hall sensor from TI. The DRV5033AJQLPG is a perfect solution. This hall sensor is placed in the door frame and the magnet is in the door. So when the door is closed, the magnet is in front of this hall sensor. The hall sensor will operate with a low voltage. I use hall sensors on purpose because they have a longer life span (than reed relays). I use a choke on the power supply and capacitors and ESD diodes to protect the hall sensor for ESD discharges (or voltages produces by lightning and inductance of the cable). I still have to determine which voltage I will use for these sensors (2.5V-38V voltage range). 2 things are important. A lower voltage generates less heat in the hall component, but give a lower output voltage (with a lower voltage error marging). A higher voltage gives a higher voltage error marging, but I am afraid that this will shorten the life span of the component. That’s why I didn’t use reed relays in the first place. I will probably use 5V. I use a 2 wire cable that is shielded (white wire is output signal, red is power supply and shield is ground). Cable is 12m max. Please tell me which voltage level I should use (to avoid misinterpreted signal levels due error marging). It’s also possible to let the sensor work at 3v3 and translate it to volt afterwards. I probably also will use a simple RC filter to filter noise.
These signals will go to a MQTT input signal PCB that will process these signals and will notice each difference. If there is a difference, the MCU will report the change to home assistant with time stamp.
The sensor works great. I can show my doors and the connections if someone is interested (see message below for the pictures). Tested it with applying a 5V level and the 5V power going to a resistor and LED to the output of the hall sensor.
When I leave my home every sensor will read its current state and an alarm will be issued when a door changes it logic state while I’m away from home.
I still have to develop this MQTT input PCB. Possible hardware configuration is an ATSAMD21 with ENC28J60. I want a wired network solution. The inputs will be processed by SPI IO ex panders (eg MCP23S17). The voltage limit of these IO is 5V. I probably have to use opto-couplers or transistor inputs to translate higher voltages.
Tell me your thoughts about these hall sensor solution. Any recommendations are welcome. Please also tell me if someone already made a wired IO MQTT input solution. I’m new to this MQTT. I know that there are topics, but the exact minimum required variables that must be used is still unclear to me.
These PCB’s will also process all the switches I use in my home. These are momentary press buttons from Jung (4 switches (2 times 2 switches (up/down)). I have CAT5 cables that are going to these switches. Providing power and connecting the 4 switch outputs.

Best regards,
Erik

Ps. my home (bugalow) consists of 120 square meters. Over 4km 19mm pipe is used (use glue for all connections) and the amount of cables are impressive. Every switch, wall socket, etc. is connected to the fuse box space.

Here are some photos of the sensor. I attached a 220 Ohm resistor to +5v other side goes to the LED and the minus of the LED goes to the open drain of the hall sensor.
The current of LED causes the current to increase. If I don’t use a LED the current even decreases when active. The door must still be painted, but just to give an idea what I’m doing.

Notice the round hole for the magnet at the first photo

You can see that there is a magnet in de door

Sensor in door frame

Space between door and magnet is 4mm. It still works :wink:

Door open. Wire comes out of the wall socket that will also be used for light switch (override switch). The door sensor will trigger the lights to go on or off.

Door closed with LED on. Higher current is due to the LED that’s on

Door closed without LED

Sensor before it was mounted in the door frame. I soldered a 100NF capacitor onto the to92 housing and secured the connections with epoxy. Please make sure that the surface of the sensor is completely in parallel with the magnet.

Nice,
The only issue i’d have with it is that it uses wires, i have 10 doors over 3 floors :thinking:

I prefer to do most of the things with a wire (that’s why I chose the ethernet MQTT client). To make it more reliable and less hackable. Now I have 16 sensors in my building.