Temperature Controller Lab: Part I
Description: Construct a basic temperature controller using thermoelectric coolers (TECs) and a power supply.
Materials:
- 800W ATX power supply (1): Despite the much lower total power consumption of the TECs, we’ll want a lot of headroom for the initial inrush current surge.
- TEC1-12706 (2): These are standard thermoelectric coolers. We’ll stack them on top of each other for a higher hotplate temperature at a lower voltage.
- Aluminum sheet (1)
- Hacksaw (1)
- Silicone adhesive paste
- Relay module
- Raspberry Pi 3
- SD card
- Jumper cables F2M
- Thick gauge wire
- Wire strippers/wire cutters
- ATX power adapter board
- Power cable for ATX supply to wall outlet
- DS18B20 temperature sensor with adapter board
Procedure:
- Cut one piece of wire. Connect it between the VCC terminal on the relay module and the +12V connection on the ATX adapter board. Do the same for ground on the ATX adapter and ground on the relay board. Do the same for NO (normally open) on the relay board and +12V on the ATX adapter board. Do the same for NC (normally closed) on the relay board and ground on the ATX adapter board.
- Connect a jumper wire between the 5V pin on the Raspberry Pi and the 5V terminal on the ATX adapter board. Do the same for ground on the Pi and ground on the adapter board. Connect a GPIO pin on the Pi to the IN pin on the relay board.
- Measure the dimensions of the TEC. Saw a piece of the aluminum sheet of the same size.
- Consider TEC1 and TEC2 (labeling each TEC with indices). Use silicone to connect the cold plate of TEC1 to the hot plate of TEC2. Then use silicone to connect the aluminum plate to the hot plate of TEC1. Use silicone to connect the DS18B20 sensor to the top of the plate. Place it toward the edge. Hold the “sandwich” together with a piece of duct tape and wait a few hours for the silicone to dry.
- Connect the ground wires on the TEC to the ground terminal on the ATX adapter board. Connect the red wires on the TEC to the COM pin on the relay board.
- Load Raspberry Pi OS on the SD card. Plug the Pi into a monitor via an HDMI cable. Place the SD card in the Pi’s SD slot, turn on the ATX power supply, and press the power button on the adapter board. Turn on the monitor.
- Write the PWM-based PID controller code to control the relay. See here for a sample of PID controller code. See here for a sample PWM implementation.
- Tune the PID parameters accordingly.