An innovative engineer can solve a problem in a complicated industrial environment with a few low-cost electronic modules and some Arduino programming. You can use this wireless emergency push button, along with LoRa, for a wide variety of applications.

An Emergency Push Button

The original need for developing the wireless Emergency Push Button (EPB) presented here is rather specific and has to do with taking samples from trains delivering coal to an electric power plant. A coal sample must be taken from the top of a coal wagon to determine its calorific value before it may be used. This is an important parameter for a power plant.

Subscribe
Tag alert: Subscribe to the tag LoRa and you will receive an e-mail as soon as a new item about it is published on our website!

Before taking a sample, the sampler presses the existing EPB to signal his presence to the driver of the train. This should immobilize the train. Unfortunately, depending on the length of the train, the sampling position, and the curvature of the track, the sampler cannot always see his signal in front of the train. Occasionally while collecting samples, it has been observed that the train rolled inadvertently, causing accidents, and hurting the person. The EPB system needed improvement. 

Things to Be Aware Of

The coal trains can be very long, up to 500 meters, and there can be up to four of them next to each other being sampled and unloaded at the same time. Add to that curved railroad tracks, and you will understand that it is complicated to see what is going on. Furthermore, the environment is noisy due to unloading trains. Audible feedback is thus difficult, too.

The existing EPB system is a wired system. However, in such an environment, having cables run over long distances is risky, as they may break without anyone noticing. Replacing them or running more cables to provide visible feedback is complicated and expensive. Increasing the height of the signal mast so that it can be seen from a distance is not a practical solution either, as it requires good eyesight to identify for which track it would be. 

Going Wireless with LoRa

The solution we came up with is the wireless EPB (Figure 1). It consists of two units: an EPB Sender, and an EPB Receiver. Actually, the units are almost identical and capable of sending and receiving, but we will refer to them in this way. If you prefer, you can think of it as a master-slave or client-server system. 

Wireless with LoRa Fig 1
Figure 1: Overview of the Wireless Emergency Push Button (EPB) System.

Before taking a coal sample, the sampler presses a button on the EPB Sender to signal his request to sample. When the EPB Receiver in the control cabin receives this request, it activates a relay to press the button on the existing EPB system, and it sends an acknowledgement back to the EPB Sender unit. Now the sampler knows that his signal has hit home, and he can safely take a sample. When done, the sampler presses a second button on the EPB Sender to release the system. This time, the EPB Receiver releases the existing EPB by activating a second relay and again confirms this to the EPB Sender. The system is ready for a new sample.

In case the system is not available, or the signaling EPB is kept bypassed for operational purposes, the feedback signal will never return to the sender unit, alerting the sender and avoiding miscommunication.

Subscribe
Tag alert: Subscribe to the tag ESP32 and you will receive an e-mail as soon as a new item about it is published on our website!

EPB Sender and Receiver Circuits

The EPB Sender is an exact replica of the existing EPB unit, but with a small antenna and a small OLED screen added to it. It is powered by a single-cell LiPo battery. It has two push-to-activate buttons. Inside (Figure 2) is an ESP32 module that drives the OLED display and a LoRa transceiver module. Note that the ESP32 module was only used for convenience, not for its wireless capabilities. Any other cheap, low-power microcontroller module with the right interfaces (I²C, UART, 2× GPIO) can be used instead. 

EPB Sender with OLED display and two push buttons
Figure 2: The EPB Sender consists of an OLED display and two push buttons (besides the LoRa transceiver)

The EPB Receiver is similar to the sender unit, except that it has two relays instead of the push buttons, and it doesn’t have a display (Figure 3). Note that only one of the relays should be active at any time. This is taken care of by the software. 

The two relays of the EPB Receiver
Figure 3: The two relays of the EPB Receiver press the buttons on the existing EPB system.
Security

To have improved security such that the system never gets disturbed by some spurious signal, we selected low-power LoRa transceiver modules from Ebyte. Besides using interference-resistant spread-spectrum technology, they provide three parameters: channel frequency, air rates and a 4-byte ID. Communication can only take place when these three parameters are the same on both ends of the link.

The module features a serial interface and delivers up to 500 mW (21…30 dbm) at 868 MHz (Figure 4). The signal can travel 500 meters very comfortably along the railway track with a small handheld antenna and with the receiver unit antenna placed on the rooftop of the cabin / control room so that it remains in sight everywhere.
 

EPB Sender built on perfboard.
Figure 4: Prototype of the EPB Sender built on perfboard.

Software

Like the hardware of the two units, the software for the units is similar as well, and consists of two short Arduino sketches.

Both units configure the serial port used for communicating with the LoRa transceiver as 9600N81 in the setup() function. The EPB Sender configures two GPIO pins as push button inputs, whereas the EPB Receiver configures them as outputs to drive relays. The EPB Sender also prepares the OLED display.

In the loop() function, both the sender and receiver first check if a message has been received from the other unit. If so, they update their state accordingly. The receiver sends an acknowledgement message back to the sender and starts waiting for a new message.

The sender continues by checking the state of its two push buttons. Depending on which one is pressed, it sends a short ASCII string over the serial port to the LoRa transceiver. Only one key press is accepted at any time.

The software can be downloaded from this project’s page at Elektor Labs. Feel free to modify it as you see fit. The strings exchanged between the two units were chosen more or less arbitrarily and may be replaced by anything you like.


Editor's note: This article 200578-01 appears in Elektor July/Aug 2023.


 

Questions or Comments?

Do you have technical questions or comments about his article, wireless solutions, or LoRa? Contact Elektor at editor@elektor.com.