Full-scale industrial automation can be costly and isn’t always necessary. Instead, you can automate separate processes like temperature control and humidity monitoring.
One way to do this is using proportional–integral–derivative (PID) controllers — the most common and efficient feedback-based control technology out there.
But PID controllers are good at one thing only — controlling the environment they’re in. If you also want to collect data about that environment, you need to install data loggers. And they make process automation a lot more expensive than it has to be.
We’ve found that a simple Bluetooth Low Energy (BLE) integration can overcome this obstacle. Essentially, it can:
- provide easier installation and configuration through a mobile app
- offer a simple way to collect and analyze data from the controlled environment.
If you like the sound of that, read on to explore the idea of BLE-enabled PID controllers.
First, we’ll take a general look at what PID controllers are and how they work. Then we’ll explore the difficulties of using a default PID controller — and compare using default PID controllers to using PID controllers with BLE.
Finally, we’ll offer an example implementation of a BLE-enabled PID temperature controller. We have built both a controller prototype and a mobile app to go with it.
A PID controller is a device that controls an environment or process based on feedback about said environment/process. The diagram below describes the general principle behind a PID controller.
Definitions of components and processes in the diagram:
- The setpoint is the desired state for the environment/process.
- The PID controller is a device that decides whether the environment/process is staying at the setpoint.
- The controller output is a response from the PID controller, showing how much the environment/process deviates from the setpoint.
- The process is whatever corrective action can return the environment/process to the setpoint.
- The process variable represents the result of continuous monitoring of the environment/process.
When using a PID temperature controller, you first define a setpoint. For instance, say you want the room to stay at 25 degrees Celsius. In this case, 25 degrees Celsius will be your setpoint. Using process feedback from a temperature sensor, the PID controller will continuously monitor the environment to make sure it stays as close to the setpoint as possible. In our case, it will keep the room at 25 degrees.
What makes PID controllers different from simple thermostats is their ability to maintain the environment/process at the setpoint. Instead of turning the heating on and off, a PID controller will gradually increase and decrease the temperature to maintain it at the necessary level.
It’s a simple and elegant solution to a common problem. But it does come with caveats.
A large drawback to using PID controllers is their inconvenient design. A typical industrial PID controller uses a seven-segment display for settings and is configured with mechanical buttons. This design makes PID controllers uninformative and uncomfortable to set up and use.
And because PID controllers are usually installed in remote locations in industrial environments, this design leads to a lot of unnecessary struggle. But while design inconvenience is something you can deal with, the fact that most PID controllers don’t record processed data might not be.
Factories often need to know why something has gone wrong as opposed to just knowing it has. And a basic PID controller doesn’t record the data it processes. All it does is maintain the environment at setpoint.
To also record data, factories must install data loggers. These devices record and sometimes visualize data about controlled processes. They also tend to be on the expensive side.
When you combine the prices of PID controllers and data loggers, you’ll see that the costs go way higher than you might have anticipated.
Design inconvenience and cost are not always an issue. For instance, you might need only one PID controller without the need to record data. But why bear the difficulties if you can avoid them with a simple and secure BLE integration?
BLE is a standard for wireless communication that allows you to interact with a PID controller from a distance. Combine it with a dedicated mobile application and you get a comprehensive system that:
- enables quick PID controller setup and configuration through an intuitive mobile app
- reduces the costs associated with using PID controllers by combining them with data loggers
- displays data from the controller on a smartphone.
These claims are not empty. We’ve built a prototype of a BLE-enabled PID temperature controller to illustrate the potential of this upgrade.
The first step for any project should be to identify the scope. Here’s what we aimed to accomplish with our BLE-enabled PID controller prototype:
- Establish setpoints
- Measure the temperature
- Control the temperature and keep it as close to the setpoint as possible
- Take corrective action if the temperature doesn’t match the setpoint
- Log measured data
- Communicate with a smartphone via BLE to: configure the device; display the temperature and controller output; check the logged temperature and controller output
The diagram below shows how the proposed system would work.
To develop the prototype, we used the Nordic Semiconductor nRF52 DK development kit and the following hardware:
- 1-wire digital thermometer DS18B20
- I²C to 1-wire bridge device DS2482S-100
- Wirewound resistor HS10 10R J
- MOSFET transistor AO4407
- MOSFET transistor driver TC4432E
- NOR flash memory 25SF161
- Real-time clock PCF85263A
- OLED graphic display 0.96-128X64-BLUE
- Capacitive touch module AT42QT1010
The prototype we’re going to build will work similarly to the one described earlier. It will read data from a temperature sensor and look for any deviations between the measured temperature and the setpoint. If there is a deviation, the PID controller will regulate the heating element to maintain the temperature as close to the setpoint as possible.
Our PID controller will log all measured data with timestamps, which will allow for tracing back any changes in the temperature if necessary. These logs will be available in the dedicated mobile application.
The device can be configured directly from the device (using buttons) or from a dedicated mobile app (through the BLE connection).
Below, you can see how the prototype looks from above.
The mobile application we propose to go with the PID controller is simple. It has a total of three screens: the main screen, the settings screen, and the data logger screen.
On the main screen, you see the data you would typically want to monitor at all times:
- Process value (in our case, the current temperature measurement)
- Setpoint value
- Controller output
The main screen allows you to switch the PID controller between manual and automatic modes. From here, you can either go to the settings screen or the data logger screen.
The settings screen will allow you to configure the PID controller remotely. You can then save, upload, and apply the new settings.
Finally, the data logger page will allow you to track any changes in temperature over time. The mobile app can visualize the logged temperature measurements in a graph and update it in real time.
This screen will also provide the ability to navigate through the logged data and save it to a file.
To make sure that our BLE-enabled PID controller prototype works as intended, we tested it in real-life conditions. Below, you can see how successful the prototype was at keeping the environment temperature at 70 degrees Celsius.
The results were great: We achieved high control accuracy with a regulation speed of 55 seconds and a maximum dynamic deviation of 18 degrees Сelsius.
PID controllers are the most common and efficient method for feedback-based environment control. But they come with two caveats:
- Due to their design, PID controllers can be extremely uncomfortable to configure and use.
- PID controllers don’t log the measured data. To do that, you also need to install a costly data logger, which will greatly increase the cost of using a PID controller.
Our idea was to avoid both issues by enabling a PID controller with BLE. To test this idea, we built a BLE-enabled PID controller prototype and designed a dedicated mobile application to go with it.
As a result, we improved the PID controller user experience and decreased the cost of using a PID controller by combining it with a data logger.
Have an industrial IoT project in mind? Let’s talk!
This project came directly from the Lemberg IoT lab. Engineers working there enjoy technical challenges so much that they often make their own projects and test out ideas. And you can benefit from their skills and ambitions.
If you have an IoT project in mind, just get in touch with Slavic Voitovych, our Business Developer. Slavic is always happy to discuss potential projects and talk about our IoT expertise at Lemberg.