My father runs a company that manufactures precise metal parts for the automation industry. Modern machines don’t need much supervision anymore: Once they are set up and started, they mostly run for multiple hours without any human in the loop.
However, sometimes things go wrong. In the specific case of my father and his wire EDM CNC machines, the machines’ cutting wires can tear which requires a short maintenance process. That itself isn’t a big problem either – but what if you don’t notice that the machine has been stuck for several hours which results in great loss of time?
To solve that problem, I set out to create a remote monitoring and notification system.

I installed a Wago PFC100 industry-grade Programmable Logic Controller (PLC) in a switch cabinet close to the four machines that were going to be monitored. Using a potential-free contact from the machine that closes when the cool water pump goes on, a small relay circuit sets 24V input signals for the PLC.
The PLC was programmed in Codesys v3 and connected to the company network with an Ethernet cable. Furthermore, I bought a low-power Mini PC, installed Ubuntu on it and installed the LAMP (Linux, Apache, MySQL, PHP) stack on it.
The PLC program checks for changes in the signal level and inserts data into the MySQL database. Also, it calls a PHP script that triggers a Telegram bot to send out messages to all subscribed users.
The Apache web server runs an internal website that displays the data from the MySQL database.

Whereas the Telegram notifications can be received by any smartphone that has the Telegram app installed and an internet connection, the internal website is just reachable from within the network itself per se. To be able to access the website with the timeline of the different machines statuses, a VPN back to the company network was used. Once logged into the company network with the VPN, the internal website was accessible.
