A software service that monitors Runway Visual Range (RVR) inputs and updates the RVR value by adjusting based on ambient light conditions. Built for Raspberry Pi 3B+ as part of a real-time aviation ground operations system.
Reads serial RVR data, adjusts the value based on runway light intensity from an analog sensor, and publishes the result over Modbus TCP on port 1502. When RVR drops below 1200ft (RVR12), the airport enters low visibility operations.
- Raspberry Pi 3B+
- MCP3008 ADC chip (analog light intensity input via SPI)
- Potentiometer (simulates runway light intensity 0-5V)
- Laptop running sensor simulator (serial RVR input)
- C with libmodbus
- Raspberry Pi OS 32-bit
- SPI via Linux spidev
- systemd for service management
sudo apt install libmodbus-dev git
git clone https://github.com/tishap27/rvr-modbus
cd rvr-modbus
makesudo cp systemd/rvr-modbus.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable rvr-modbus
sudo systemctl start rvr-modbus
sudo systemctl status rvr-modbusService auto starts on boot and restarts automatically if it crashes.
docker build -t rvr-modbus .
python3 tests/sensor_simulator.py | ssh tisha@10.0.0.117 'docker run --rm -i -p 1502:1502 rvr-modbus'kubectl apply -f k8s/rvr-modbus-deployment.yaml
kubectl get pods
kubectl get servicesNote: K3s uses its own containerd runtime separate from Docker. If pod shows
ErrImageNeverPull, import the image manually:docker save rvr-modbus | sudo k3s ctr images import -Wait ~90 seconds on a Pi 3B+, then verify with:
sudo k3s ctr images list | grep rvr-modbus
On your laptop, pipe the simulator to the Pi over SSH:
python3 tests/sensor_simulator.py | ssh tisha@10.0.0.117 './rvr-modbus/modbus_server'Serial input format: RVR:12 where 12 means 1200ft visibility.
Light intensity from MCP3008 adjusts the value: adjusted = raw * (1 + 0.25 * intensity)
- Hardware integration - MCP3008 ADC wiring; potentiometer light intensity input will replace simulated values
- Low visibility alerting - Modbus coil output when RVR drops below RVR12 (1200ft)
- Error handling - serial disconnect recovery, Modbus client timeout, malformed RVR frame detection
- Testing - unit tests for RVR parser and adjustment formula; sensor_simulator.py extended for edge cases (dropout, out-of-range values)
- Calibration - refining the light intensity adjustment coefficient (currently 0.25) against real runway lighting data