Milesight UC511: LoRaWAN Solenoid Valve Controller
Milesight UC511 LoRaWAN solenoid valve controller: own ChirpStack decoder framework, valve status, pulse counting, downlink control and smart irrigation.
- LoRaWAN
- Class A / Class C, OTAA
- Solenoid outputs
- 2 latching solenoid interfaces
- GPIO
- 2 GPIO (pulse / digital input)
- Power
- Built-in solar panel + rechargeable battery
- Ingress protection
- IP67, M12 connectors
- Pressure (variant)
- Optional pipe pressure input
- Configuration
- NFC (Milesight ToolBox)
What the UC511 does
Valve status
Open / closed state of solenoid 1 and solenoid 2.
Pulse counting
Flow-meter pulses per valve for volume-based irrigation.
GPIO inputs
Two GPIO read external dry contacts or pulse signals.
Pipe pressure
Optional pressure reading on hardware variants that ship the sensor.
Battery level
Reported as a percentage alongside the periodic status uplink.
Integration
Sensor / controller
Measures or controls in the field and sends LoRaWAN uplinks.
LoRaWAN gateway
Receives the radio packets and forwards them to the server.
ChirpStack
Network server: manages sessions and decodes the payload.
ThingsBoard / Grafana
Dashboards, alarms, rules and reports.
function decodeUplink(input) {
var bytes = input.bytes;
var data = {};
for (var i = 0; i < bytes.length; ) {
var channel = bytes[i++];
var type = bytes[i++];
// Device info (join / power-on): version, SN, class. Length is field-specific.
if (channel === 0xff) { i += deviceInfoLen(type, bytes, i); continue; }
// Battery (%)
if (channel === 0x01 && type === 0x75) { data.battery = bytes[i]; i += 1; continue; }
// Valve 1 / valve 2 status: 1 byte (0 closed, 1 open; 0xFF = delayed-command ack)
if (channel === 0x03 && type === 0x01) { data.valve_1 = readValve(bytes[i]); i += 1; continue; }
if (channel === 0x05 && type === 0x01) { data.valve_2 = readValve(bytes[i]); i += 1; continue; }
// Valve 1 / valve 2 flow pulses: UINT32 little-endian (4 bytes)
if (channel === 0x04 && type === 0xc8) { data.valve_1_pulse = readUInt32LE(bytes, i); i += 4; continue; }
if (channel === 0x06 && type === 0xc8) { data.valve_2_pulse = readUInt32LE(bytes, i); i += 4; continue; }
// GPIO 1 / GPIO 2 status: 1 byte (hardware/firmware dependent)
if (channel === 0x07 && type === 0x01) { data.gpio_1 = bytes[i]; i += 1; continue; }
if (channel === 0x08 && type === 0x01) { data.gpio_2 = bytes[i]; i += 1; continue; }
// Pipe pressure (kPa): UINT16 little-endian, on pressure variants
if (channel === 0x09 && type === 0x7b) { data.pressure = readUInt16LE(bytes, i); i += 2; continue; }
// Unknown channel: stop. Downlink-response, history and task-status
// segments are deployment-specific and decoded per rollout.
break;
}
return { data: data };
}
function readValve(v) {
if (v === 0xff) return "command_ack";
return v === 1 ? "open" : "closed";
}
function readUInt16LE(b, i) {
return (b[i + 1] << 8) | b[i];
}
function readUInt32LE(b, i) {
return ((b[i+3]<<24)|(b[i+2]<<16)|(b[i+1]<<8)|b[i]) >>> 0;
}
function deviceInfoLen(type, b, i) {
void b; void i;
if (type === 0x01 || type === 0x0f || type === 0x0b || type === 0xfe) return 1; // version, class, status, reset
if (type === 0x09 || type === 0x0a || type === 0xff) return 2; // hw / fw / TSL version
if (type === 0x16) return 8; // serial number
return 1;
}
Implemented from the published Milesight byte specification (Communication Protocol / User Guide).
The UC511 payload is configuration-dependent: which channels appear depends on the hardware and firmware version and on enabled features (valve mode versus counter mode, GPIO, the optional pressure input, and history or task-status frames). This is a framework on the published Milesight byte specification, not a drop-in: the valve status, pulse and GPIO channels above are implemented from that spec, while downlink-response, history and task-status segments are mapped per deployment and validated against a real uplink. As a Class C device the UC511 can accept downlinks in near real time to open or close a valve.
Configuration & pitfalls
Class A vs Class C
Run Class A for the longest solar-battery life, or Class C when valves must respond to downlinks in near real time. Pick one consciously, since Class C raises receive current.
Latching solenoids
The outputs drive latching (bistable) solenoids with a pulse, so a valve holds its position without continuous current. Match the coil voltage and pulse to your valve.
Pulse counting setup
For volume-based irrigation, wire the flow meter to the valve pulse input and document the litres-per-pulse factor so dashboard volumes stay traceable.
Hardware variants
Pressure input, GPIO and history frames exist only on newer hardware and firmware. Confirm the exact channels with one captured uplink before finalising the decoder.
How merkaio supports your UC511
From sourcing to day-to-day operation, all from one partner on our own European infrastructure.
Pre-staging & provisioning
We configure the UC511, set keys, intervals and alarms, and ship it ready to deploy.
Own decoder
Payload codec for ChirpStack v4 and ThingsBoard, implemented from the Milesight specification.
Dashboard integration
Data lands in your ThingsBoard or Grafana, with alarms and reports.
Operations & monitoring
We run the LoRaWAN stack and dashboards on European infrastructure, you just use the data.
Frequently asked questions
Let's discuss your infrastructure. Digital and on-site.
Whether it's IoT platform development, hardware selection, managed hosting for ChirpStack, ThingsBoard, Grafana or NetBird VPN, or migration from a self-hosted setup - we'll find the right solution for your use case. Book a free 30-minute consultation, no commitment required.
Your contact
Timo Wevelsiep
Founder, merkaio
15 minutes, no commitment, directly with Timo.
Decoder for ChirpStack v4. merkaio is an independent integrator and is not affiliated with Milesight.