Home

Awesome

Begin Python 🐍 with the TCLab

Welcome to this introductory course on Python! This course is intended to help you start programming in Python from little or no prior experience. There are video tutorials for each exercise if you have questions along the way. One of the unique things about this course is that you work on basic elements to help you with a temperature control project. You will see your Python code have a real effect by adjusting heaters to maintain a target temperature, just like a thermostat in a home or office.

Begin Python

One of the best ways to start or review a programming language is to work on a simple project. These exercises are designed to teach basic Python programming skills to help you design a temperature controller. Temperature control is found in many applications such as home or office HVAC, manufacturing processes, transportation, and life sciences. Even our bodies regulate temperature to a specific set point. This project is to regulate the temperature of the TCLab. Each TCLab has thermochromic (changes color with temperature) paint that turns from black to purple when the temperature reaches the target temperature of 37°C (99°F).

Final Project Objective: Program the TCLab to maintain the temperature at 37°C. Display the heater level with an LED indicator as the program is adjusting the temperature. Create a plot of the temperature and heater values over a 10 minute evaluation period.

To make the problem more concrete, suppose that you are designing a chicken egg incubator. Temperature, humidity, and egg rotation are all important to help the chicks develop. For this exercise, you will only focus on temperature control by adjusting the heater.

Topics

There are 12 lessons to help you with the objective of designing the temperature control for the incubator. The first thing that you will need is to install Anaconda to open and run the IPython notebook files in Jupyter. Any Python distribution or Integrated Development Environment (IDE) can be used (IDLE (python.org), Spyder, PyCharm, and others) but Jupyter notebook is required to open and run the IPython notebook (.ipynb) files. All of the IPython notebook (.ipynb) files can be downloaded at this link. Don't forget to unzip the folder (extract the archive) and copy it to a convenient location before starting.

  1. Overview
  2. Debugging
  3. Variables
  4. Printing
  5. Classes and Objects
  6. Functions
  7. Loops
  8. Input
  9. If Statements
  10. Lists and Tuples
  11. Dictionaries
  12. Plotting

Get TCLab

You will need a TCLab kit to complete the exercises and they are available for purchase on Amazon.

Temperature Control Lab

Install Python

Download and install Python or watch a video on how to install Python.

Install Python on Windows

Install Python on Windows

Install Python on MacOS

Install Python on MacOS

Install Python on Linux

Install Python on Linux

There are additional instructions on how to install Python and manage modules.

Support

We would love to hear any feedback or problems you would like to send us! We are always trying to improve this course and would like to hear about your experience. We can be contacted at eric@apmonitor.com or john@apmonitor.com.

Additional Resources