New Elektor Book: PID Controllers Based on Arduino and Raspberry Pi

PID control is a commonly used control algorithm. Elektor’s new book is a great resource for anyone looking to use a Raspberry Pi 4 or Arduino Uno in PID-based automatic control applications.

Industrial and commercial process control are very important areas of automatic control engineering. Basically, two types of control algorithms are used in process control: ON/OFF control and proportional integral derivative (PID) control. Both control algorithms use feedback where the plant output response is compared to the desired value and action is taken to minimize the error between the two.

In simple ON/OFF control applications, full power is applied to the installation if the error is positive, otherwise the power is cut off. The ON/OFF control has many drawbacks. First, the error is never zero and therefore precise control of the installation is not possible. For example, in ON/OFF temperature control, the measured temperature exhibits oscillatory behavior and may be several degrees above or below the desired value. On/off control. On the other hand, it is very difficult to control installations with time delays using an ON/OFF type regulation. Third, the ON/OFF control is generally based on the use of a relay, and the relay has to switch several times, which shortens its service life.

What are PID controllers?

PID control is the most commonly used control algorithm, widely used in industrial, process and commercial applications and has been universally accepted as the simplest and perhaps the best control algorithm resulting in control precision of a factory. The popularity and wide use of PID controllers can be attributed partly to their robust performance in a wide range of process control applications and partly to their ease of use, which allows engineers to use and tune them in a simple and direct way. As its name suggests, the PID algorithm consists of three basic coefficients; proportional, integral and derivative which are modified to obtain an optimal response.

New book release

The new book, Hands-on PID-based digital control with Raspberry Pi and Arduino Uno, is to use the Raspberry Pi 4 and Arduino Uno in PID-based automatic control applications. The book begins with the basic theory of continuous and discrete time feedback control systems. The time responses of first and second order systems are given in detail. Working and fully tested projects are given to control real systems using PID controller algorithms. Open-loop step time response, various PID parameter tuning methods and closed-loop time response of developed systems are given in the book along with block diagrams, circuit diagrams, PID controller algorithms and Complete program listings and program descriptions for the Raspberry Pi and Arduino Uno.

An example of a PID controller

A draft of the book is presented below. It is used to control the water level in a tank using a Raspberry Pi 4, an ultrasonic sensor, a tank, a tank, a submersible pump, a MOSFET switch and a power supply. The time response of the output stage of the system with the PID controller is shown in the diagram, where it was necessary to set the water level to 10 centimeters.

Project Overview PID Controller

Project elements with PID controller

The System Output Stage Timing Response with PID Controllers
The timing response of the system output stage with the PID controller.

The projects given in the book should teach the basic theory and applications of PID controllers and these projects can be easily modified by readers for other control applications. Interested readers can further their knowledge by searching the Internet, where there are many tutorials, application notes, projects and articles on PID controllers.

The book covers the the following topics:


  • Open loop and closed loop control systems
  • Analog and digital sensors
  • Transfer functions and continuous time systems
  • First-order and second-order system time responses
  • Discrete-time digital systems
  • Continuous time PID controllers
  • Discrete Time PID Controllers
  • ON-OFF temperature control with Raspberry Pi and Arduino Uno
  • PID Temperature Control with Raspberry Pi and Arduino Uno
  • DC PID Motor Control with Raspberry Pi and Arduino Uno
  • PID Water Level Control with Raspberry Pi and Arduino

About Cedric Lloyd

Check Also

A nationwide art and literature zine is created right here in Baton Rouge

Some say they first saw the owl spread out on a table in a Mid …