Raspberry Pi Temperature Logger

The example demonstrates the steps required to turn a Raspberry Pi and low cost I2C sensor into a data logger.

Requirements:

 Temperature Logger Hardware

 

First, configure the I2C port:

The following Instructable will provide easy to follow instuctions to get the I2C port ready to use.

http://www.instructables.com/id/Raspberry-Pi-I2C-Python/

 This step only need to be performed if the I2C port is being used for the first time.

 

Next, wire up the temperature sensor. 

This should only take a few minutes with a solderless breadboard.

Make the following connections to the Raspberry Pi GPIO port:

Sensor RPi GPIO
VCC +3.3V
SDA SDA
SCL SCL
GND GND
ADD0 GND
ALT N/C

NOTE: DO NOT CONNECT THE SENSOR VCC TO +5VDC, THIS WILL DAMANGE THE SENSOR 

Next, configure the I2C port:

The following Instructable will provide easy to follow instuctions to get the I2C port ready to use.

http://www.instructables.com/id/Raspberry-Pi-I2C-Python/

 

Third, confirm the Raspberry Pi can see the sensor on the I2C port with one of the following commands:

I2Cdetect screen shot

 

 

Finally, run the Python program:

Temp_Logger.py

Python Temperature Logger Code

The program will display a line of data each time the temperature is logged:

Temperature Logger Running

 

Tips:

Use the following command to view the raw data file:

nano tempdata.txt

Copy the data to a USB drive and it can easily be imported in to Excel:

Temperature Logger Data in Excel

 

 The program can also be run in the background - this will allow data to be logged after the user session has been logged out:

sudo python temp_logger.py &

 

Please send comments or questions to : info@zagrosrobotics.com

 

 

  Home   Products   Featured Items   New!   Lab Notes   Download Files   Links   Contact
Copyright 2012 - Zagros Robotics, All Rights Reserved - Please send webpage comments or corrections to webmaster@zagrosrobotics.com
Zagros Robotics, PO Box 460342, St. Louis, MO 63146-7342,
(314)341-1836, Fax (314)576-5568 info@zagrosrobotics.com for answers to any questions.

Zagros Robotics, Inc
ASP.NET Shopping Cart Software