RaspberryPi Temperature Sensor: Difference between revisions

From Wurst-Wasser.net
Jump to navigation Jump to search
Line 17: Line 17:
Check whether there is now our sensor device:
Check whether there is now our sensor device:
  cd /sys/bus/w1/devices
  cd /sys/bus/w1/devices
  ls
  ls -1


  XXX
  10-000802ad5087<ref>This will differ, since this is the UID of my device.</ref>
w1_bus_master1


See it's content (values):
See it's content (values):
  cd XX
  cd 10-000802ad5087<ref>This will differ, since this is the UID of my device.</ref>
  cat XX
  cat w1_slave


Result:
Result:


  ?
  39 00 4b 46 ff ff 03 10 9c : crc=9c YES
39 00 4b 46 ff ff 03 10 9c t=28562<ref>This is the temperature in degrees celsius (multiplied by 1000), therefore I have 28.562°C in my living room. OMG! It's frickin' hot!</ref>


=== Code ===
=== Code ===

Revision as of 20:34, 19 June 2013

Time to build a temperature sensor with my Pi.

Schematics

RaspberryPiDS18B20.png

Configure the Pi

Update the OS

This not necessary, but generally a good idea.

apt-get update
apt-get ugrade

Setup kernel modules for GPIO and 1-wire device

modprobe w1-gpio
modprobe w1-therm

Check setup

Check whether there is now our sensor device:

cd /sys/bus/w1/devices
ls -1
10-000802ad5087[1]
w1_bus_master1

See it's content (values):

cd 10-000802ad5087[2]
cat w1_slave

Result:

39 00 4b 46 ff ff 03 10 9c : crc=9c YES
39 00 4b 46 ff ff 03 10 9c t=28562[3]

Code


  1. This will differ, since this is the UID of my device.
  2. This will differ, since this is the UID of my device.
  3. This is the temperature in degrees celsius (multiplied by 1000), therefore I have 28.562°C in my living room. OMG! It's frickin' hot!