Skip to content

grudloff/peltier_controller

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Peltier Temperature Controller

This project has as an objective the simultaneous temperature control of two fiber Bragg gratings (FBGs), which are a type of optical fiber sensor but could be easily adapted for other requirements.

We required a high-precision temperature controller. For this, a temperature controller was designed based on a Peltier, controlled with a temperature sensor as a reference and a Proportional Integrative Derivative (PID) controller that controls the power and polarity delivered through an H-Bridge.

A Peltier is a solid-state device that transfers heat from one face to the other when electrical power is applied. If the polarity is inverted, the heat transfer direction is inverted. This allows a Peltier element to be used to either cool or heat by inverting the polarity. By attaching a Peltier over a heatsink with a fan, we set one face as a reference, to be set close to ambient temperature. Then with the Peltier, we can either raise or lower the temperature of the opposite face.

In particular, we use the cooler of a CPU, as shown in the figure below. Thermal paste is added in the interface between the heatsink and the Peltier. A temperature sensor is positioned on the top face of the Peltier with the FBGs positioned next to it. Thermal paste is added to the interface between the sensors and the Peltier, and these are fixed to the Peltier by use of insulating tape.

Certainly, here's an example of a usage section that you can include in a README file to help users understand how to use the Arduino code for the temperature control system:

Usage

This Arduino code provides a flexible and configurable temperature control system using Peltier devices and PID controllers. Below are instructions on how to use and interact with the system:

Hardware Setup

  1. Connect Peltier Devices: Connect the Peltier devices and the H-Bridge as explained below in section Physical layout.

  2. Temperature Sensors: Connect DS18B20 temperature sensors to the OneWire bus and assign their unique addresses if necessary.

  3. Buzzer: Connect a buzzer to the designated pin for audio alerts.

Software Configuration

  1. Install Required Libraries: Make sure to install the following libraries using the Arduino Library Manager:

    • OneWire
    • DallasTemperature
    • PID_v1
  2. Upload the Code: Upload the provided Arduino code to your Arduino board using the Arduino IDE or another compatible development environment.

Serial Communication

The temperature control system can be interacted with via the Arduino's serial communication interface. Use a serial terminal (e.g., Arduino Serial Monitor) to send commands to the system. Set the baudrate to 9600.

Available Commands

  • Set PID Parameters (x command):

    • Send the character x to enter PID parameter setting mode.
    • Follow the on-screen prompts to adjust the PID parameters for different controllers (heaterA, coolerA, heaterB, coolerB).
  • Set Target Temperatures (t command):

    • Send the character t to set the target temperatures (setpoints) for the controllers.
    • Follow the on-screen prompts to enter new target temperatures for TA and TB.
  • Start Temperature Ramp (s command):

    • Send the character s to start a temperature ramp.
    • Follow the on-screen prompts to select the ramp mode (0 OFF, 1 TA+, 2 TA-, 3 TB+, 4 TB-) and initiate the ramp.
  • Select Controller for Tuning (c command):

    • Send the character c to select a controller for tuning (heaterA, coolerA, heaterB, coolerB).
    • Follow the on-screen prompts to specify the controller for tuning.

Monitoring and Alerts

  • The system will continuously monitor the temperature of the controlled environment and adjust the Peltier device power to maintain the desired setpoints.

  • Audio alerts will be generated by the buzzer in the event of temperature out-of-range conditions or significant temperature changes.

  • In case of out of bound temperatures or power, the system will be automatically reset.


Physical layout

Temperature controller side view Temperature controller top view
Temperature controller side view Temperature controller top view

The control logic is performed by a microcontroller ($\mu$C). The information flow logic is displayed in the figure below. The polarity is set by comparing the target temperature and the ambient temperature setting the Peltier as a heater or cooler, respectively. The electrical power is controlled by a PWM signal of the microcontroller delivered to the H-Bridge. The PID updates the PWM values by looking at the difference between target temperatures and sensor temperatures. Separate PID parameters are set for cooling and heating.

Information flow diagram of controller

Temperature controller components and schematic.

Component Model Characteristics
Temperature Sensor DS18B20 $\delta t=0.06\degree C$, $\Delta T=750[ms]$
H-Bridge L298N $I_{max} = 2A$ (Over 2 channels)
Microcontroller Arduino Uno R3
Peltier TEC1-12706 $V_{nom}=12V$, $I_{max}= 6.4A$

Controller circuit schematic