1. Overview: In many machine tool or punch press applications, operator safety is paramount. Sometimes we need to avoid single-handed operation to prevent the punch press from causing harm to the operator. We can use the intelligent control of the microcontroller to better complete such control and protect the safety of the operator.
The figure on the right is a simplified diagram of the control function.
This control process is relatively simple. It requires two keys. If one key is pressed, the second key will be effective within 5 seconds. If only one key is pressed, there will be no output. Only when both keys are pressed at the same time within 5 seconds, there will be output. After more than 5 seconds, there will be no output when the second key is pressed. You need to release the first key to make it effective again. When it exceeds 20 seconds, the alarm sound will be output. Pressing the second key at the same time is invalid, and the original key must be released to unblock it.
Such control can be said to be relatively simple. Use any two I/O ports of the microcontroller as key input ports, use two I/O ports as solenoid valve output and alarm output ports, and the other two ports as LED indication ports.
Programming is also very simple. The system continuously scans and queries the status of the two buttons. When one button is pressed, the timing starts. When it exceeds 5s, the output is blocked. At the same time, it is judged that the original button is released before it is restored to validity. The alarm level is output after more than 20s.