My parents have a door in their kitchen that is right next to two ovens and a drawer. When the ovens or drawer are open, then someone opening the kitchen door would smash it into the opened oven or drawer, damaging both sides. I built an interlock system that detects when the ovens or drawer are open, and engages an electromagnetic lock to prevent the kitchen door from being opened. It unlocks as soon as the ovens and drawer are closed.

The open/closed detectors for the drawer and one of the ovens use Hall effect sensors with neodymium magnets. I found a very thin, but very strong magnet (gold-plated for corrosion resistance) that I adhered to the glass on the oven door with Kapton tape (on the bezel, outside of the hot part). I also built a 3D-printed housing for the sensor on the back of the oven frame opposite it.

Due to physical constraints, it wasn't possible to put a Hall effect sensor on the other oven. Instead, I reverse-engineered the oven's control board, found the exact (somewhat obscure) wiring connectors that the oven uses, and made a passthrough sensor that MITMs two of the wiring harnesses (one for signal, one for power). It uses a MOSFET to amplify a signal that my custom control board uses to sense when the oven's own door open/closed switch is engaged. It also uses an optocoupler so that the oven and the rest of the system are electrically isolated. I was surprised that the oven uses the duty cycle of a PWM signal (instead of just a simple on/off signal) to represent whether the oven door is open or closed.

There's also a push button switch next to the door to disengage the system. It's fail-safe, in that there are no electronics or software involved. It's a simple electrical disconnection of the power that goes to the door lock. The lock itself is fail-safe, too: it's an electromagnetic lock (rather than one with a physical bolt or latch), so if power goes out, it's guaranteed to disengage.

The brains of the operation is a custom control board with an off-the-shelf Arduino nano soldered onto it. I could have put all of the Arduino components directly onto the board, but it was easier to use a pre-fabbed Arduino and just design the custom parts.

I ran CAT5 to most of the sensors, but used some heavier 18 AWG wire for the lock, since it needs to handle more current. I used JST XH connectors for most things, but larger XT30U for higher-current components.

A few other things I'm proud of:

- All of this was non-invasive to the ovens. I didn't drill any holes or cut any wires.

- I designed some custom PCBs for this (my first time) using Kicad (Phil's Lab on YouTube is great!) and had them fabbed and partially SMT-assembled at JLCPCB. They turned out great. Pretty amazing compared to when I had some boards fabbed locally 20+ years ago. Turnaround time, quality, price, and general experience are loads better than they used to be.

- I taught myself CAD and 3D-printed enclosures for the electronics and sensors. I used OnShape, which has a semi-hidden version that's free for personal use, as long as you make your designs public.

- I taught myself surface-mount electronic assembly for this project. It was easier than I expected.

- The push button on the wall has an RGB LED in it that shows status. It also allows the system to be disabled temporarily for 5 minutes by long-pressing it.

- Given that some of the electronics will be installed in or near an oven, I took care to characterize the thermal environment and respect the thermal constraints for all of the components I used.

- I put a temperature sensor in the electronics in the oven, and if the electronics ever get too hot, it will indicate overheating via the LED that's in the pushbutton switch on the wall. (I checked the temperature in the sensor location while the oven was running before installation, so this is just a precaution. It hasn't ever overheated.)

- The control board enclosure has a laser-printed label on its face that marks the ports for all of the sensors, actuators, and power connections.

- The whole system is basically invisible except for the button and the electromagnetic switch.

This whole project is a bit of a Rube Goldberg machine, but it was really fun to do the design, hardware, software, and physical assembly. It turned out really well, and has been working great for a few years now.