Sunday 16 November 2014

Raspberry Pi with DS18B20 temperature sensor (part 1)

1. Hardware needed in this tutorial:-
     a) raspberry pi,
     b) DS18B20 sensor,
     c) 4.7k Ohm resistor
     d) some wires
     e) breadboard (optional)

2. Connect DS18B20 sensor to PIN7 (GPIO 4), the connection actually same as this post.

3. To read the data from sensor, some of the modules need to be loaded first. Run the following command:-
  modprobe w1-gpio
  modprobe w1-therm

4. Check whether raspberry pi can detect DS18B20 or not. Access to the /sys/bus/w1/devices. Then, run "ls" command. If the sensor is detected by raspberry pi, there will be an output start with 28....



5. Use "cat" command to display the temperature. The full command will be "cat /sys/bus/w1/devices/28*/w1_slave. See 't' value. In picture below, t=28437 means current temperature is 28.437 degree celcius.



2 comments:

  1. Shorouk Shorouk for all household services from Cleaning of apartments, cleaning apartments, insect control and sewerage, offering you all the domestic services at the cheapest prices. Contact us to request the service you want Dear customer
    شركة تنظيف بخميس مشيط

    شركة تنظيف خزانات بالاحساء
    شركة تنظيف خزانات بابها
    شركة تنظيف خزانات بالاحساء

    ReplyDelete
  2. [SIZE="5"]تعتبر مركز الشعلة لخدمات التنظيف واحده من اعرق الشركات بالرياض و المتخصصه فى اعمال التنظيف بكافة انواعه.
    و تفخر الشركة بسابقة اعمال تعكس الثقة التى يضعها عملاؤنا فى خدماتنا المتميزه

    مركز الشعلة 0530242929

    تخصصنا فأبدعنا فى خدمات التنظيف التى نقدمها
    حيث تتمتع الشركة بالفرق المدربة و الموهله للقيام بأعمال تنظيف البيوت و المنازل و الشقق .
    و تقدم الشركة ايضا خدمات تنظيف الخزانات و عزلها و عزل الاسطح لضمان المحافظة على صحتكم عملاؤنا الاعزاء

    و تقدم الشركة ايضا خدمات تنظيف اخرى لضمان تغطية كافة احتياجاتكم فى كل الاوقات و كل و الظروف .

    حيث نقدم خدمات مثل :-

    خدمات نقل الاثاث و تخزينه
    خدمات تنظيف الاثاث و تلميعه
    خدمات مكافحة الحشرات و رش المبيدات
    خدمات تنظيف الموكيت و السجاد
    خدمات تنظيف المجالس
    خدمات تسليك المجارى و شفط البيارات
    خدمات تنظيف الواجهات و تلميع الاسطح

    اتصل بنا عميلنا العزيز و استمتع بخدماتنا المميزة فى اعمال نقل الاثاث و التنظيف و جميع الخدمات الاخرى -

    لا تتردد فى تصفح خدماتنا بالموقع و الاتصال بنا للأستفسارات فى اى وقت باليوم - اتصل الآن 0530242929
    [/SIZE]

    او زو موقعنا : https://www.facebook.com/mifgi/

    ReplyDelete