Introduction

Temperature data is possibly the most common information collected by scientists, engineers, and hobbyists. With a TINKERplate, it is possible to connect up to eight temperature sensors to the Digital I/O connector. What follows is some examples of how to read and display the temperature from these sensors.

What You'll Need

  1. A DS18B20 temperature sensor. You can use the one shipped with the TINKERkit that looks like:

    And plug it into the mini breadboard which is also in the kit:

    If you have never used a breadboard before, here is a tutorial you may find useful: https://www.sciencebuddies.org/science-fair-projects/references/how-to-use-a-breadboard
    Or you can use a DS18B20 that has wires attached like the kind we sell here.
  2. A TINKERplate attached to a programmed Raspberry Pi

Steps

Connections

  1. Connect the sensor to channel 1 of the Digital I/O port on the TINKERplate.
    If using parts from the TINKERkit then your setup should look like:

    If using a wire sensor then your setup would look like:

Code 1 - Simple

Use the Thonny IDE again to write and run the program as shown below. The output is displayed in the window labeled "Shell" on the bottom.

Again, if you don't feel like typing, here is the code you can copy and paste:

The above code can be downloaded from github by typing the following instructions on the command line:

  1. git clone https://github.com/pi-plates/TINKERplate-Projects.git
  2. cd TINKERplate-Projects
  3. python3 SimpleTemp.py

Code 2 - a Thermometer

Let's make things a -little- more interesting by displaying the temperature on a Meter panel. Again, use Thonny and enter the following program:

This time after clicking the RUN button a panel meter will pop up showing the temperature in large colorful characters:

Here is the code again:

The above code can be downloaded from github by typing the following instructions on the command line:

  1. git clone https://github.com/pi-plates/TINKERplate-Projects.git
  2. cd TINKERplate-Projects
  3. python3 aThermometer.py

 

Series Navigation<< Displaying Data with a Virtual MeterBattery Tester I >>