# On the Use of LoRa Technology for Logic Selectivity in MV Distribution Networks
## 6 Realized Demonstrator
### Node State Machine  
In Figure 5, the state machine implemented on the microcontroller of the sensor node associated with a PR is reported. After start-up, in normal operating conditions, the node enters an IDLE state, where the closed state of the breaker is emulated by an illuminated green LED, and the transceiver is in continuous reception mode. The circuit controller, through the high logic level of the line connected to the pin PA11, sends the fault signal. This pin is associated with an interrupt, so when a fault is detected, the microcontroller jumps to the relative Interrupt Service Routine (ISR). The ISR includes the following steps: (i) a red LED is turned on to signal the presence of the fault on the network; (ii) the timer that has to measure the Maximum Blind Waiting time \(T_{MBW}\) of the PR is started; (iii) the transceiver switches from the continuous receive condition (RX continuous mode) to the transmit condition (Tx) to send the BLIND command to the protection immediately upstream; (iv) the value of the status variable is changed from IDLE to FAULT.  
In the FAULT state, two different events can happen: a Blind message from the protection immediately downstream is received before the expiration of \(T_{MBW}\), or \(T_{MBW}\) elapses but the PR has not received any Blind message. When a generic message is received, the transceiver generates an external interrupt to the microcontroller (RxDone) and the microcontroller picks up the received message from the FIFO queue of the LoRa transceiver. If the message is recognized as Blind, then: (i) the timer for measuring \(T_{MBW}\) is stopped; (ii) the yellow LED is turned on to signal the Blind message reception; (iii) the status variable passes from the FAULT state to the BLIND state. On the  
Figure 4: Microcontroller and transceiver of the realized Long Range (LoRa) node.  
contrary, if \(T_{MBW}\) expires, the firmware performs the following: (i) tripping the breaker CB, which, in the demonstrator, is emulated by turning the green LED off; (ii) transmitting the tripping command to the downstream protection to isolate the section of the line affected by the fault; (iii) changing the value of the status variable from the FAULT condition to the BREAKER TRIPPED condition.  
It is possible to return to the IDLE condition and, therefore, to normal operation (from both the BLIND and BREAKER TRIPPED states) if the distribution line is restored; in the demonstrator, this event is emulated through a RESET signal provided externally by the circuit controller to the node.  
In the IDLE condition, even though no fault is detected, a PR can trip its CB if a Trip message is received from the PR placed immediately upstream. In this case, once the message is received and acknowledged by the microcontroller: (i) the yellow LED is turned on to signal the reception of a valid message and the green LED is turned off, emulating the tripping of the breaker; (ii) the status of the LoRa transceiver is changed from the Rx continuous reception mode to Tx transmission to transmit the Close message to the boundary Tie recloser TR.