Introduction
Modern buildings are packed with systems — HVAC, lighting, access control, and energy metering — but most of them run on separate proprietary controllers that don't talk to each other. The result is a building that's instrumented but not truly intelligent.
In this Instructable, you'll learn how to build a flexible, open-source smart building automation controller using the NORVI X platform. It's built on the ESP32-S3 microcontroller, supports industrial I/O, speaks Modbus RTU natively, and connects to the cloud over WiFi, Ethernet, or 4G — all at a fraction of the cost of traditional BMS hardware.
This guide covers a practical HVAC zone control system with remote monitoring, but the same hardware can handle lighting automation, energy metering, and access control.
Step 1: Understand the Problem With Traditional Building Automation
Before building anything, it's worth knowing why this matters. Traditional Building Management Systems (BMS) come with some frustrating limitations:
- Proprietary controllers that need vendor-certified technicians to configure
- No interoperability between subsystems — each zone or floor operates in a silo
- Little to no native cloud/API connectivity
- High licensing costs that price out small-to-medium commercial buildings
- Long lead times and expensive replacement cycles when hardware reaches end-of-life
The goal of this project is to replace that complexity with a single open platform that any engineer can program, configure, and scale.
Step 2: Gather Your Components
Hardware (per zone controller)
- 1x NORVI CPU-ESPS3-X1 (ESP32-S3 with WiFi, Ethernet, RS-485)
- 1x NORVI X-AI4 (4x analog inputs, 4–20 mA, 16-bit ADC)
- 1x NORVI X-R4 (4x relay outputs)
- 1x NORVI X-DI4 (fast digital inputs)
Sensors & Actuators
- Temperature & humidity sensor (4–20 mA output)
- CO2 sensor (for demand-controlled ventilation)
- Fan coil unit (controlled via relay)
- Door/window contact sensors
Tools & Software
- Arduino IDE or ESP-IDF
- MQTT broker (local or cloud — e.g., HiveMQ, Mosquitto, AWS IoT)
- Optional: Node-RED or Grafana for dashboarding ** Estimated cost per zone controller: ~$135–145 USD**
Step 3: Understand the System Architecture
Here's how the layers of the system fit together:
| Layer | Component | NORVI X Module |
|---|---|---|
| Sensing | Temp, Humidity, CO2 sensors | X-AI4 (4–20 mA) |
| Output Control | HVAC relays, Fan Coil | X-R4 relay module |
| Contact Monitoring | Door/Window Sensors | X-DI4 digital inputs |
| Communication | Modbus RTU to BMS | Built-in RS-485 |
| Connectivity | WiFi / Ethernet / 4G | Built-in on CPU |
| Edge Logic | Schedules, Alarms, Setpoints | ESP32-S3 firmware |
| Module | NORVI X Module | Core processing and integration layer |
Each CPU module connects to I/O expansion boards via a dedicated expansion bus. You can stack up to 200 I/O points across a single controller — no rewiring, no new CPU needed.
Step 4: Wire Up the Hardware
- Mount the NORVI CPU-ESPS3-X1 on a DIN rail in your control panel.
- Attach the X-AI4 expansion module — connect your 4–20 mA temperature, humidity, and CO2 sensors to the analog input terminals.
- Attach the X-R4 relay module — wire your fan coil unit switching circuits to the relay output terminals.
- Attach the X-DI4 — connect door/window contact dry contacts to the digital input terminals.
- Wire RS-485 A/B terminals to your upstream BMS or SCADA system (Modbus RTU).
- Connect Ethernet or configure WiFi for cloud/dashboard access.
Tip: For remote plant rooms or retrofit sites with no wired network, use the NORVI CPU-ESPS3-X2 or X3 variant, which adds 2G/4G cellular connectivity. No local network infrastructure needed.
Step 5: Program the Controller
All logic runs locally on the ESP32-S3. Use the Arduino framework or ESP-IDF — no proprietary IDE or vendor cloud dependency required. A basic control loop looks like this:
#include <ModbusMaster.h>
#include <PubSubClient.h>
float readTemperature() {
int raw = analogRead(AI4_CH0_PIN);
return map(raw, 0, 65535, 0, 100); // 4-20mA to temperature
}
void controlFanCoil(float temp, float setpoint) {
if (temp > setpoint + 0.5) {
digitalWrite(RELAY_CH1_PIN, HIGH); // Fan coil ON
} else if (temp < setpoint - 0.5) {
digitalWrite(RELAY_CH1_PIN, LOW); // Fan coil OFF
}
}
void loop() {
float temperature = readTemperature();
controlFanCoil(temperature, 22.5); // 22.5°C setpoint
publishToMQTT("building/zone1/temp", temperature);
delay(5000);
}
Define your schedules, setpoints, alarm thresholds, and failsafe behaviour in firmware. Optionally expose configuration parameters over MQTT or a lightweight REST API.
Step 6: Set Up Cloud / Remote Monitoring
One NORVI X CPU isn't limited to HVAC. Add more expansion modules to cover:
- Lighting automation — X-Q4/X-Q8 transistor outputs for 0–10 V dimming
- Occupancy sensing — X-DI8/X-DI16 for PIR sensors and pushbutton overrides
- Daylight harvesting — X-AV4 analog inputs for photocell sensors
- Energy metering — RS-485 Modbus RTU to commercial energy meters
A single NORVI X controller can simultaneously manage HVAC zone control, occupancy-based lighting, and access logging — eliminating the need for separate controllers per subsystem.
For a 12-zone office building across three floors, deploy one NORVI X unit per zone and connect them all to a central data concentrator or SCADA system over Modbus RTU.
Step 8: Test and Deploy
Before deploying to site, run through this checklist:
- Verify all analog input readings match expected sensor output ranges
- Test relay outputs — confirm fan coil switching responds to setpoint logic
- Verify Modbus RTU communication with your upstream BMS
- Confirm MQTT telemetry is flowing to your dashboard
- Simulate a network outage — confirm local failsafe logic holds
- Test OTA update path before final installation
NORVI X vs Traditional Smart Building Hardware
Here's how NORVI X compares against the alternatives engineers typically Evaluate:
| Capability | Traditional BMS | Dev Boards | IoT Gateways | NORVI X |
|---|---|---|---|---|
| Industrial I/O (DI/DO/AI/AO) | ✔✔✔ | Limited | ✖ | ✔✔✔ |
| Open Programming (C/C++) | ✖ | ✔✔✔ | ✖ | ✔✔✔ |
| RS-485 / Modbus RTU | ✔✔✔ | Manual wiring | ✔✔ | Native built-in |
| 4G / LTE Cellular Option | Requires add-on | DIY | ✔✔ | ✔✔✔ |
| Modular I/O Expansion | Vendor-locked | ✖ | ✖ | Up to 200 I/O |
| Price Point | High | Very Low | Medium | $80–$150 USD |
Conclusion
With NORVI X, you get industrial-grade I/O, open ESP32 programming, native Modbus RTU, and cloud connectivity — all in a modular platform that scales from a single zone to hundreds of I/O points
Estimated hardware cost per zone controller: ~$135–145 USD — a fraction of a traditional BMS controller, with full programming flexibility retained.
This approach is ideal for system integrators, OEM machine builders, smart building startups, and retrofit projects where legacy BMS hardware needs to be replaced with something open and scalable.
Note: NORVI X is not suitable for applications requiring strict IEC 61131-3 Ladder Logic compliance or certified safety functions (SIL/PLd). Those applications require dedicated safety PLCs.
More Resources
- NORVI X Product Page: norvi.io/norvi-x
- NORVI Shop: shop.norvi.lk
- GitHub (code examples): github.com/IndustrialArduino
- Technical Support: support@norvi.io | +94 77 111 1776
Top comments (0)