I wanted to experiment Node-RED with some device using Modbus. I already worked with many different types of interfaces but never did a project with Modbus protocol. It happens that my electronic bench power supply has a serial interface with this capability. This is quite impressive as this protocol is normally found only in advanced instrumentation devices as well as on industrial devices. This small and cheap power supply has an extremely good cost/benefit ratio and is widely used by the hobbyist community (tons of good of reviews on youtube channels). Just to explain for those who do not have the feet on electronics: this is an adjustable DC-DC down converter that delivers stable (low noise, low ripple) voltage and current to its output. We can power a wide variety of electronic boards (like Arduino, esp, SBCs, etc), circuits and sensors with such power supply. Data can be visualized in a nice but small OLED display. The power supply has a bank of 10 preset memories where we can store voltage, current over protection values (for voltage, current, and power) and brightness of the OLED display. On the negative side changing the values stored in the memory is far from friendly. It is necessary to press the keys and the rotary encoder of the device quite many times for a simple change.
Here is a picture of the PSU (power supply unit):
The manufacturer even provides a desktop application that runs on Windows, and it works well, but I decided to spend some time to design my own user interface. It is not that the original software is not good. I just wanted to gain more experience playing with the dashboard. I estimate that I spent one day working on the logic flow and on learning how to use Modbus nodes and four or five days playing with the dashboard design.
A couple of pictures from the Windows software from the manufacturer:
I will resume this project in the future aiming to add some features from the original software: the capability to preset memory values and the ability to run scripts to automatically change output voltage/current over time. When this is done I will make this project available in github (but not before that).
All in all the project was easier than I first thought. So far the flow is clean and easy to maintain. The dashboard design seems acceptable after several changes. I can scale the amplitude of the charts with three sliders which is good to improve the visualization.
The data shown is the dashboard is real-time since Modbus node is polling the device at a fast rate. By the way, there is a major difference between the original software and the Node-RED version. The first thing the original software does, after establishing the serial connection, is to lock the keyboard (and rotary encoder knob) of the power supply so any control is driven only by the software. In the Node-RED version, I can control and change parameters in any side (device or dashboard). When I change something in the device the change is quickly updated to the dashboard. When I extract (copy values) from a preset memory to the working memory (bank 0) in Node-Red the device is quickly updated.
This is the look and feel of the dashboard:
and here a picture of the power supply unit taken while the gif above was recorded: