Posts | Comments

Planet Arduino

Archive for the ‘Arduino PID Control’ Category

You may have come across the term “PID control,” and while this proportional-integral-derivative control method does a great job of smoothing out oscillations, where does one get started? 

One solution would be Mr Innovative’s demo device, showcased in the video below. In it, a DC gear motor is able to smoothly rotate an arrow overlaid on a protractor by a certain number of degrees.

Input is via a Bluetooth smartphone interface, and an encoder is used for feedback to the commanding Arduino Uno. Everything is fastened together by 3D-printed parts, and if you’d like to try your own PID experiment, code and print files are linked in the video description.

If you want to keep something at a certain temperature, say a block of aluminum, you’ll need a thermocouple and some sort of heating element. While you could turn a heater on and off abruptly in a sequence appropriately known as “bang-bang,” a more refined method can be used called PID, or proportional-integral-derivative control. This takes into account how much the temperature is outside of a threshold, and also how it’s changing over time.

As shown in this example by Electronoobs, PID control can be accomplished using an Arduino Uno, along with a type K thermocouple and a MAX6675 module for sensing. The Arduino sketch reads the data and sends the proper amount power to a heating element via a MOSFET in order to maintain the desired temperature without excessive oscillations.

What I want, is the aluminum block below to have let’s say, exactly 100 degrees. I’ll control the real temperature using a K type thermocouple. To read the data I’ll use the MAX6675 breakout module and control the PID algorithm with and Arduino. Finally, to apply power we will make a small circuit using a MOSFET or maybe a TRIAC in case of high AC voltages. This will be a close loop. The thermocouple measures the real values, the Arduino creates the signal applied to the MOSFET and this transistor will control the power of a heating element inside of the aluminum block and once again the thermocouple will measure the value, that’s why it’s a close loop.

Be sure to check it out for an introduction to this powerful control scheme!



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook