Regulate Temperature with a Raspberry Pi Pico — Part 1: Hardware
For those of you who don’t know me, my main hobby is brewing my own beer. One of the most crucial aspects of the brewing process is maintaining a consistent temperature, especially during the fermentation step. I looked at off-the-shelf regulators but their functionalities are limited beyond regulating heating and cooling. Likewise, Warren G and Nate Dogg weren’t able to assist either since they regulate in a different sort of way. Being a data guy I wanted something more, something that I had more control over, something that I could possibly monitor remotely, but more importantly something that I could extract the data from. Since I also like playing around with tech, and I love DIY, I decided to see if I could build something myself using a Raspberry Pi Pico.
This article series will cover the temperature regulator itself, not the actual heating or cooling components. I will leave it up to you to decide what type of heating and cooling equipment you require for your project.
In part 1, of this article series, I will be covering the hardware components that are required for the temperature regulator, where to purchase them from, and I explain what each component is used for.
This is the list of components from The Pi Hut online store that I used:
- Raspberry Pi Pico W or Raspberry Pi Pico
- Dual Channel Relay Pico HAT
- 1.3" OLED Display Pico HAT
- Pico Quad Expander Board
- Temperature Sensor and Resistor
- USB to Micro USB Cable
- Breadboard
- Jumper Wires
NOTE: I am in no way affiliated with The Pi Hut, I just found their online store to have a wide variety of components and their delivery service to be very good. If you are not in the UK then you might have to search for the components at your local Raspberry Pi supplier.
Raspberry Pi Pico
The Pico is the actual microcontroller which is the brains of the project. It is available in two flavours, it just depends if you want one with WiFi or one without. I would recommend paying a little more and getting the one with WiFi because it just opens up your options to do more with it. I went with the version that has the headers pre-soldered on as we’ll need these to connect the microcontroller to the expansion board.
Dual Channel Relay Pico HAT
This Pico HAT relay module has two relays. We’ll need one to control a heater, and the other to control a fan / cooler. We won’t be covering the heating of cooling equipment in this article series but whatever you chose to control, make sure they don’t require more Amps than these relays can handle.
1.3" OLED Display Pico HAT
This Pico HAT display module has a 1.3" OLED display, with two buttons. We’ll use this to display the current temperature and the buttons to set the target temperature.
Pico Quad Expander Board
Expander boards are handy so that you can plug multiple HATs with your Pico. I went with the quad expander one so that I would have extra pins available to connect the jumper wires to, and so that I could add an extra HAT if I wanted to.
Temperature Sensor and Resistor
The DS18B20 digital temperature sensor is generally the default choice for most microcontroller projects as it’s pretty easy to wire up and code. This one is waterproof so it is well suited to being in contact with the beer (just be sure to sterilise it well prior to using it).
USB to Micro USB Cable
We will need a USB to Micro USB cable to power the Pico microcontroller, and to be able to copy the Python code files onto it. I would recommend one at least 0.5m long to make it easier to reach your computer.
Breadboard
We’ll need a breadboard to wire up the temperature sensor and the resistor. They are very handy to have while you’re still testing everything before soldering up.
Jumper Wires
We’ll also need some male — female jumper wires to connect the temperature sensor on the breadboard, to the expansion board.
In Part 2 of this article series, I will show you how to assemble and connect up all of these components. Then in Part 3, I will show you how to copy the required code files from my GitHub repo onto the Pico microcontroller to make it all run.
Please follow me on Medium if you enjoyed this article and would like to know when I publish the next parts in this series, and any other future articles.