Long story short: I want my garage to close automatically when I drive away. This was working before, but now it's not. The previous circuit might have been functioning despite being incorrectly designed. I have limited knowledge about circuits and I'm learning as I go through this project.
I apologize if this post isn't well-structured. I've spent the entire day working on this and now have a bad headache and a lot of built-up frustration. A schematic will be provided below.
My garage door motor setup:
- Two wires connect to a normally open switch
- 24 volts potential difference across the open switch
- Voltage drops to 0 when the switch closes, triggering the garage door
- A Meross garage door opener is connected to the same terminals
- It's also normally open (non-conductive, as I've learned)
- This works fine alongside the switch, as neither allows current flow unless triggered
My Arduino setup:
- Connected to several sensors to detect when a car is leaving
- Uses a MOSFET with its gate connected to an Arduino pin (driven LOW)
- Positive wire from the garage door opener connected to the MOSFET's drain
- Negative wire connected to the MOSFET's source
- The intention was to close the circuit when the Arduino pin is driven HIGH
Initially, this worked perfectly. However, after one sensor failed and was replaced with a different type, the logic still worked but the door stopped responding. I then discovered the MOSFET I was using had low resistance between gate and source, so I replaced it.
This led to erratic behavior and inconsistent voltage readings. The voltage between the positive and negative wires would fluctuate wildly (e.g., 24V to 15V to 8V to 13V to 18V). This happened both when measuring across the MOSFET, the physical switch, or directly on the terminals of the garage door opener.
Thinking the issue might be a lack of common ground, I connected the Arduino to the garage frame, which has continuity with the negative wire from the garage door opener.
This stabilized the voltage but caused the physical switch and Meross opener to stop working. My theory is that the current now follows the path to ground through the frame instead of flowing through the negative wire, preventing the opener from detecting the voltage change. Measurements show about 20 out of 24V flowing this way.
My original intention was to use the MOSFET to isolate the circuit from the Arduino while allowing control. However, I now realize I may have inadvertently connected the source to Arduino ground by following the advice from a famous chatbot.
I've been using ChatGPT for assistance, which has been helpful but sometimes provides incorrect information. When I catch these errors, I can work out the correct answer, but undetected mistakes lead to non-functional designs.
Here are the schematics (apologies if they're not ideal):
- Circuit with fluctuating voltage: https://ibb.co/WFB3rQL
- Circuit with stable voltage but non-functional opener: https://ibb.co/XWdmkwD
Can anyone identify what might be wrong? I believe I need to design a circuit that works in theory before implementing and debugging it, rather than the other way around.
PS: The sensor, code, and logic are all working fine. I get the Arduino to trigger pin 7 at the appropriate time, which then opens the MOSFET for 500 ms. It's the circuitry and what happens with the current that stumps me.
Interested in learning about electrical engineering!