The Temperature Control Laboratory (TCLab) is an application of feedback control with an Arduino, an LED, two heaters, and two temperature sensors that are mainly based on the `APMonitor TCLab` project by Jeffrey Kantor and Carl Sandrock.
This TCLab consists of three main parts: hardware, Arduino sketch, and the `TCLab` library.
**The following guide provides step-by-step instructions to design and build from scratch your own TCLab version that can communicate with Python and Jupyter Notebook.**
## TCLab hardware
The TCLab is a modular, portable, and inexpensive solution for hands-on process control learning. The heat output produced by the transistor is adjusted by modulating (PWM) the current flow to each of the two devices. Then, thermistors measure the temperatures by the Arduino's ADCs.
The energy from the transistor output is transferred by conduction and convection to the temperature sensor. Heat transfer dynamics provide rich opportunities to implement single and multivariable control systems, modeling, and system identification applications. The TClab is integrated into a small PCB, which can be mounted to any Arduino or Arduino-compatible microcontroller.
The next Figure shows the TCLab version distributed by Jeffrey Kantor and Carl Sandrock.
The device is a resource for model identification, controller development, and machine learning applications. It is a pocket-sized lab with Python software for the purpose of reinforcing control theory for students.
You will find the complete project with the PCB layout in the open project at [Upverter]().
**The TIP31C and TMP36 data-sheets are in this repository**
## Arduino Sketch
The Arduino Sketch (TCLab sketch) is a set of methods that supports the Temperature Control Lab when downloaded and installed on a compatible Arduino device. The sketch is used in conjunction with the compatible Python library `TCLab` for programmable control of the Temperature Control Lab with Python.
1. Plug the Temperature Control Laboratory board in an Arduino UNO or Leonardo. Connect your computer to the Arduino via the USB connection. Plug the DC power adapter into the wall and attach it to the power input to the TCLab board.
2. Install Arduino Drivers if needed. For most users, there will be no need. If you are using Windows 10, the Arduino board should connect with no additional drivers. Mac OS users may need to install a serial driver for Arduino Uno clones. A suitable driver can be found [here](https://github.com/adrianmihalko/ch340g-ch34g-ch34x-mac-os-x-driver) for clones using the CH340G, CH34G or CH34X chipset.
3. Install Arduino Firmware:
* Download and install the Arduino IDE application.
* Download the file TCLab-sketch.ino located in this repository in the folder with the same name.
* Open the Arduino IDE application. Select the Arduino board type from `Tools -> Board -> Arduino Board -> Arduino Uno` or your compatible board, and finally verify the port connection.
To confirm the board's proper operation, use the serial monitor (located under the tools menu of the Arduino IDE). Select serial monitor, set the baud rate to `115200`, and line endings to 'newline.' If the firmware is operating correctly, enter the command
**Note: if the serial monitor does not answer you when you type a command, double-check the setting in the serial monitor and consider that serial commands are case-sensitive.**
The `TC-Lab` project will be used for the students as a portable temperature controller system to implement several kinds of controllers. Thus, the student should develop the next tasks to reach the final goal (main objective):