Not sure if this has been done before, either way, here’s my take on things.
TL;DR
Grey plastic box thingy (with lights) that turns Makita router and dust collector motors on and off automatically by way of signaling a Home Assistant (home automation server) when Pin 15 on the Onefinity Breakout Board Adapter goes high, which in turn will control two off-the-shelf smart switches.
Primary Responsibility
Act as a signalling device to my home automation software so it can turn the smart plugs (switches) on and off accordingly
NOT intended to control the motors directly, only to signal something else to do that process
Allow manual override of all signals (physical safety switch) to prevent motors from turning on when not desired
Optional: Allow easy manual control of both spindle and vacuum motors in case of malfunction
Main Guts:
- ESP32 (ESP-WROOM-32 model) Microcontroller (WiFi and Bluetooth)
- ESP32 screw terminal breakout board
- x1 Red, x1 Green LED
- Double Pole —> Single OR Double Throw Toggle Switch
- Custom mains power extension cord with a double-gang box containing a light switch which controls a duplex power socket
- Custom designed square-ish box in FreeCAD and 3D printed
- Assorted wire, solder and coffee
IoT Devices
- Sonoff S32 Smart Switch Flashed with ESPHOME (Makita router)
- TP-Link Kasa Smart Switch (dust collector)
- Ikea TRÅDFRI Shortcut button (smart push button) connected to Home Assistant via MQTT to manually control the dust collector motor
Home Automation
Raspberry Pi 4
- Home Assistant 2022.9.6 (FREE and open source)
- ESPHOME add-on for Home Assistant
- Node-Red for Home Assistant (flow-based development tool for visual programming)
Ancillary devices
- Onefinity Breakout Board Adapter, SKU: 3001013
- Custom made extension cord with a double-gang electrical box at one end which contains a light switch and dual power outlets
- USB 5v mobile phone charger and cable for powering the ESP32 microcontroller
Basic Workflow and Operation
When the toggle switch is moved, this signals my home automation server to talk back to the control box and tell the microcontroller to turn on or off either of the LEDs. This process is separate and independent from anything dealing with the CNC machine. The ONLY function of the toggle switch is to turn one LED off and turn the other one on. Back and forth, that’s it.
With the toggle switch in the safe (green LED) position, the home automation software will ignore all signals from the CNC and do nothing.
In the unsafe (red LED) position, anytime a 3.3v signal is detected from pin 15 on the CNC, the automation server will send a “turn on” signal to two different smart switches. And if a zero voltage is detected, the switches get sent the “turn off” command.
NOTE: If the safety toggle switch is turned to safe (green) AFTER a program has started on the CNC, the router and vacuum will NOT turn off after the program is finished and will require manual intervention.
If this control box ever fails or is in safe mode (ignoring the CNC signals), then simply pressing the Ikea button will turn on the vacuum, and the Sonoff smart switch has a manual override on/off button built into the side and will do the same. This way I can run the vacuum for cleanup separately from the CNC control.
And, here’s the pictures. I will be happy to provide the ESPHOME and Node-Red configurations if needed. Let me know if anything isn’t clear or I missed something. Cheers!