Simple python script for connecting a DS18B20 temperature sensor to a Raspberry Pi. It can print either the temperature (configurable for Celcius or Farenheit) or the temperature and a timestamp.
You will need:
- a Rasperry Pi with SSH access
- a DS18B20 temperature sensor
I followed this guide to set up the temperature sensor, if you have not already. It can be found here:
- Make sure your Pi is updated, then install modprobe.
$ apt-get update
$ apt-get install modprobe
-
Connect your DS18B20 temperature sensor to the Raspberry Pi
-
Find the serial of the temperature sensor
cd /sys/bus/w1/devices
ls
This will list all of the devices in the GPIO board.
Change to the one that ends in 28-xxx
then type cat 28-xxx to make sure it's collecting data.
-
Wired internet is usually more stable than a wifi dongle
-
If you want to add this as a cron job, you can use
thermcron.sh(or see below) to run it as often as you want.
python /root/thermo.py >> /root/temp_log.csv
If you want to get in on this, give me a shout!
- David Sopkin - dsopkin
This project is licensed under the GNU General Public License v3.0 - see the LICENSE.md file for details
Please feel free to report bugs and request features in the issues section.