The Micropilot FMR10 radar sensor by Endress+Hauser is a small radar that offers continuous distance measurement, perfect for measuring liquid levels in tanks. In this blog, we'll explain how to use the FMR10 radar sensor with an ESP32 PLC 14, a powerful tool for industrial automation with ESP32.
Getting started with ESP32 PLC and required Software
To follow this blog, you'll need the Arduino IDE with Industrial Shields' libraries installed and Node-RED for data visualization. If you still don't have the Arduino IDE properly configured, we suggest you follow the steps starting at page 17 of the ESP32 PLC 14 manual.
If you don't have Node-RED installed yet, follow the first lesson of this free course:
Develop your SCADA Application based on Node-RED
How to connect the FMR10 Radar Sensor to an ESP32 PLC?
The FMR10 radar sensor can output measurement results in two ways: via Bluetooth or a 4-20mA analog input. To connect the FMR10 to an ESP32 PLC, you can use Bluetooth or directly read the mA from the output circuit. If you choose to connect via Bluetooth, you'll need the Endress+Hauser SmartBlue app for Android, which allows you to configure various aspects of the radar sensor, such as sensitivity and calibration. More information can be found here:
If you prefer to operate the radar by reading the analog signal, we have used an ESP32 PLC 14 with its analog inputs configured to 4-20mA. This configuration allows you to read the radar measurements directly into the PLC. This is how the circuit looks:
You can use any other of our PLCs with analog inputs, but then you will need to convert the radar output to 0-10V.
Creating a Node_RED flow to display Radar Sensor measurements
Before we code the program for the PLC, we'll create a Node-RED flow to display the measurements. This flow will have a "mqtt in" node, three "function" nodes, two "text" nodes and two "chart" nodes. Then add the "fmr10" topic to the "mqtt in" node. Set the one of the "chart" nodes' X axis to display the last 5 minutes, and set the other "chart" to be a bar chart. For two of the "function" nodes, add this code:
And for the remaining "function" node, this code:
The flow should look like this:
You'll also have to create a dashboard group for the "text" and "chart" nodes.
MQTT server setup and coding for ESP32 PLC with FMR10
We've made a simple code that converts and outputs the recieved signal to the serial port and to the MQTT server. It reads from I0_7 because that's where we've connected the circuit to the PLC. The results are converted to metres and sent to both the serial monitor and the Node-RED flow through MQTT.
You can download the code from here:
Or copy it from here:
If your PLC has a 0-10V analog input, you'll use this formula for the distance:
Results: Monitoring FMR10 Radar measurements with Node-RED dashboards
After deploying the Node-RED flow and uploading the program to the PLC, you should see the resulting measured distance in the Node-RED dashboard:
And in the Serial Monitor:
Maximizing efficiency with the FMR10 Radar and ESP32 PLC
Using the FMR10 radar sensor with an ESP32 PLC 14 allows for precise liquid level measurements in tanks, making it an excellent choice for various industrial automation applications. With the help of tools like Arduino IDE, Node-RED, and the SmartBlue app, configuring and managing the sensor becomes straightforward. This setup provides flexibility in how data is captured and displayed, ensuring that users can tailor the system to meet their specific needs.
By leveraging these components, industries can achieve efficient, accurate, and reliable data collection and monitoring, enhancing overall operational efficiency and safety.
How to use the FMR10 Radar Sensor with an ESP32 PLC 14?