This solution shows how to create an hydraulic pressure monitor node. The monitor node measures hydraulic pressure from a sensor with a 4-20mA interface. It then transmits this data frequently over LoRaWan® to a LoRaWan® server.
At the LoRaWan® server the data arrives in the following format
Byte1 | Byte2 | Byte3 |
---|---|---|
4 | P1 | P2 |
where |
- Byte 1 is a marker for the data type, here always 4
- Pressure is sent as
P1P2
e.g. 1009 kPa (would be 0x03 0xF1 in the data package)
To build this system, the following hardware are required:
- WisBlock Base RAK5005-O * 1pcs
- WisBlock Core RAK4631 * 1pcs
- WisBlock IO RAK5801 * 1pcs
- SUP-P300 - a hydraulic pressure sensor with 4-20mA interface * 1pcs
Note: To send the data of sensor node to LoRaWan® server, a LoRaWan® gateway is also needed. If you don't have one, we recommend you use RAK7243.
The assembly of sensor node is as follows:
We choose a 2-wire hydraulic pressure sensor in this example, So we only need to connect the signal and power as the picture above.
The test scenario is shown as follows:
- Arduino IDE
- RAK4630 BSP
- SX126x-Arduino library
The code for the hydraulic pressure sensor node can be found in the sketch file
The log of sensor node is shown as follows:
16:16:09.893 -> =====================================
16:16:09.893 -> Welcome to RAK4630 LoRaWan!!!
16:16:09.893 -> Type: OTAA
16:16:09.893 -> Region: EU868
16:16:09.893 -> =====================================
16:16:15.083 -> OTAA Mode, Network Joined!
16:16:36.105 -> Sending frame now...
16:16:36.105 -> -------pressure------ = 9 KPa
16:16:36.105 -> lmh_send ok count 1
16:16:56.108 -> Sending frame now...
16:16:56.108 -> -------pressure------ = 15 KPa
16:16:56.108 -> lmh_send ok count 2
16:17:16.107 -> Sending frame now...
16:17:16.107 -> -------pressure------ = 15 KPa
16:17:16.107 -> lmh_send ok count 3
16:17:36.108 -> Sending frame now...
16:17:36.108 -> -------pressure------ = 15 KPa
16:17:36.143 -> lmh_send ok count 4
16:17:56.113 -> Sending frame now...
16:17:56.113 -> -------pressure------ = 15 KPa
16:17:56.148 -> lmh_send ok count 5
16:18:16.132 -> Sending frame now...
16:18:16.132 -> -------pressure------ = 15 KPa
16:18:16.132 -> lmh_send ok count 6
We use Chirpstack as LoRaWAN® server in this solution, the data sent to LoRaWAN® server is shown as follows:
LoRa® is a registered trademark or service mark of Semtech Corporation or its affiliates. LoRaWAN® is a licensed mark.