Forum -> share your case
User Voice

Post a new topic

Kits

Last Post

Views

Replies

Ultimate Kit How to get DS18B20 working

The Ultimate Kit documentation is missing some important information for Lesson 37 How to make a simple Thermometer 2. The DS18B20 is a 1-Wire bus device and each device has a specific serial number address that must be updated in the code. When using the 1602 LCD the address on the I2C bus may also be different, so two commands a required to correctly identify these devices.$ ls /sys/bus/w1/devices/28-031656c3cbff  w1_bus_master1If you only have one DS18B20 sensor connnected, this will be the 28-xxx folder, so copy this serial number into the "open" line of code to use the correct device endpoint in ds18b20.py#!/usr/bin/env pythondef ds18b20Read(): tfile = open("/sys/bus/w1/devices/28-031656c3cbff/w1_slave") text = tfile.read() tfile.close() secondline = text.split(" ")[1] temperaturedata = secondline.split(" ")[9] temperature = float(temperaturedata[2:]) temperature = temperature / 1000 temperature = round(temperature, 2) print temperature return temperatureFor the LCD, use the i2cdetect command to find the correct address of the LCD controller.$ i2cdetect -y 1     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 3f 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --                         In this case 0x3F is the correct address, which is updated in main.py.#!/usr/bin/env pythonimport RPi.GPIO as GPIOimport ds18b20import i2c_lcd1602import timescreen = i2c_lcd1602.Screen(bus=1, addr=0x3f, cols=16, rows=2)...

by tmc***
January 2017 03:51 am

163

0

Where is the guidebook for RFID starter??

I have got the RFID starter kit for Raspberry Pi, where can I find the guidebook and two version codes?

by Jac***
March 2016 10:44 am

1309

2

I could not get the buzzer to work (Ultimate kit)

HiCan you please confirm that this the same as LCD1602 and that it needs theheader pins soldering onto it to connect to the breadboard? Also I could not get the buzzer to work, but since then found that thepython code in another module said header pin 11 when it needed 12 to work. Icould not get the buzzer lessons to work. So the question is Do you know of anymore errors in the Raspberry Pi Ulitmate Starter kitcoding?

by Cle***
March 2016 22:02 pm

366

3

Post a new topic

  • CONNECT WITH US 
Copyright © 2016 Adeept.com All Rights Reserved.