If you have ever tried to build an industrial IoT sensor node using standard Arduino or hobbyist LoRa boards, you know the struggle. Real-world industrial sensors—like soil NPK monitors, flow meters, or weather stations—rarely use simple I2C or SPI. They use RS485 (Modbus RTU) or 0-10V Analog signals.
To connect these to a standard LoRa breakout board, you typically have to:
- Wire up external RS485 transceiver modules.
- Build custom voltage dividers to step down 10V to 3.3V.
- Figure out a way to toggle power to the sensors so they don't drain your battery.
- Write messy, complex code to handle the timing.
The result is often a messy "spaghetti" of jumper wires that is unreliable and impossible to deploy in a harsh outdoor environment. We needed something better.
2. Enter ArduLora: The All-in-One SolutionArduLora was born out of the necessity for a clean, professional, and accessible bridging device. It is a compact development board that takes the incredible long-range capabilities of the RAK3172 LoRaWAN module and surrounds it with the exact hardware interfaces required for industrial deployments.
Instead of prototyping with breadboards, ArduLora allows you to go straight from your Arduino IDE to a rugged field deployment.
Hardware Features that Matter:
- The Brain: Powered by the RAK3172 (STM32WLE5CC), supporting LoRaWAN and LoRa P2P on the RUI3 framework.
- Built-in RS485: An onboard SP3485 transceiver allows you to talk directly to thousands of off-the-shelf Modbus sensors.
- High-Voltage Analog: Two dedicated analog inputs (AI1/AI2) with onboard scaling to safely read 0-10V industrial signals with high 12-bit/14-bit ADC resolution.
- Smart Power Management: A dedicated power-control pin (
PB5) allows you to completely cut power to external sensors when the board goes to sleep, drastically extending battery life for remote nodes. - Status Indication: Onboard Yellow, Red, and Blue LEDs for instant visual feedback of TX, RX, and System Status.
Hardware is only half the battle. To make ArduLora truly "Arduino-friendly, " we developed and published an official OOP-based ArduLora Library (available right in the Arduino Library Manager).
Example code LoraP2P on ArduLora board
We wrapped the complex RUI3 AT-command-like API into clean, intuitive C++ functions. What used to take 20 lines of setup code now takes two:
#include <ArduLora.h>
void setup() {
Serial.begin(115200);
// Initialize all hardware pins and ADC resolution
ArduLora.begin();
// Power up external Modbus/Analog sensors
ArduLora.sensorPower(true);
// Configure LoRa P2P with a single line (Defaults to 868MHz, SF7)
ArduLora.configLoraP2P();
}
void loop() {
uint8_t payload[] = "Hackster.io is awesome!";
ArduLora.sendP2P(payload, sizeof(payload));
// Go into ultra-low power mode for 10 seconds
ArduLora.deepSleep(10000);
}Example code blink led on ArduLora board
void setup()
{
pinMode(PA9, OUTPUT); // Set pin PA9 as an OUTPUT
}
void loop()
{
digitalWrite(PA9, HIGH); // Turn the pin ON (3.3V)
delay(1000); // Wait for 1 second
digitalWrite(PA9, LOW); // Turn the pin OFF (0V)
delay(1000); // Wait for 1 second
}Example Modbus master
This example, our board is modbus master.
#include "Canopus_Modbus.h"
ModbusMaster node;
uint8_t result;
void setup()
{
//Enable power for external sensor
pinMode(PB5, OUTPUT);
digitalWrite(PB5, HIGH);
// Led PA8 as output
pinMode(PA8, OUTPUT);
Serial.begin(115200);
Serial.print("\r\n*****************ArduLora*******************");
Serial_Canopus.begin(9600, SERIAL_8N1);
}
void loop()
{
//***************READ node 1**************************
node.begin(1, Serial_Canopus); //slave ID node
Serial.printf("");
Serial.printf("\r\n\n\nExample read modbus RTU for ArduLora board");
result = node.readHoldingRegisters(0, 10);//Read 40000 to 40009
delay(10);
if (result == node.ku8MBSuccess) //Read success
{
for (uint8_t i = 0; i < 10; i ++ )
{
Serial.printf("\r\nValue 4000%d: %d", i, node.getResponseBuffer(i));
}
}
else Serial.print("Read Fail node 1"); //read fail
digitalWrite(PA8, !digitalRead(PA8)); //blink led
delay(500);
}🔍 Code Explanation:
ModbusMaster node: Creates a "Master" object to control other devices.Serial_Canopus: A special serial port pre-configured for the Modbus pins on ArduLora.node.readHoldingRegisters(0, 10): Requests data from address 0 to 9 from the slave device.node.getResponseBuffer(i): Retrieves the actual value received from the sensor.
The Arduino Serial Monitor shows the value of register:
Example read modbus RTU for ArduLora board
Value 40000: 1
Value 40001: 2
Value 40002: 3
Value 40003: 4
Value 40004: 5
Value 40005: 6
Value 40006: 7
Value 40007: 8
Value 40008: 9
Value 40009: 10Example Modbus slave
This example, our board is modbus slave. Board read analog at PB4 (AI1) and set value register 040001 (FC03, address 1)
#include "modbus.h"
#include "modbusDevice.h"
#include "modbusRegBank.h"
#include "modbusSlave.h"
modbusDevice regBank;
modbusSlave slave;
void setup()
{
//Enable power for external sensor
pinMode(PB5, OUTPUT);
digitalWrite(PB5, HIGH);
//Led PA8 as output
pinMode(PA8, OUTPUT);
Serial.begin(115200);
Serial.print("\r\n*****************ArduLora*******************");
regBank.setId(1); //Set id slave
regBank.add(40001); //Add register FC03, holding register, address 1
regBank.set(40001,0); //Set default value for 40001 is 0
slave._device = ®Bank;
slave.setBaud(9600); //Set baudrate 9600
analogReadResolution(12); //Set Resolution adc is 12bit, can upto 14bit
}
void loop()
{
int analog_In = analogRead(PB4);
regBank.set(40001, analog_In); //Update value for 40001 is analog_In
slave.run(); //Run service modbus RTU slave
digitalWrite(PA8, !digitalRead(PA8)); //blink led
delay(200);
}🔍 Code Explanation:
regBank.setId(1): Sets the board as Modbus device ID #1.regBank.add(40001): Reserves a register address where other devices can read data.slave.run(): The engine that listens for requests from the Modbus Master.
Because ArduLora bridges the gap between Arduino programming and industrial hardware, the possibilities are endless:
- Smart Agriculture: Connect an RS485 Soil NPK sensor, read the nutrients using a Modbus library, and send the data miles away to a LoRaWAN gateway.
- Factory Monitoring: Hook up 0-10V pressure or temperature gauges and monitor machinery health without running Ethernet cables across the factory floor.
- Smart Cities: Build ultra-low-power environmental monitoring stations that can run on a small battery and solar panel for years.
We built ArduLora to empower makers and engineers to build serious IoT networks without the headache. The hardware is available now, and the library is completely open-source.
- GitHub Repository & Code:NamNamIoT/ArduLora
- Get the Board: Available on Tindie and Elecrow.
Grab a board, install the library, and let us know what incredible industrial networks you build!











Comments