IoT Sensors DHT11, SHT20, DS18B20, Pimoroni Enviro phat

Описание к видео IoT Sensors DHT11, SHT20, DS18B20, Pimoroni Enviro phat

Common temperature & humidity sensors for IoT.
Showing 1-wire and I2C setup in Raspberry Pi.

Reference & my notes:
https://learn.pimoroni.com/article/ge...
Install lib: curl https://get.pimoroni.com/envirophat | bash

DHT11
https://learn.adafruit.com/dht
sudo pip3 install Adafruit_DHT

DS18B20 1-Wire
sudo pip3 install sensor
#1-wire sensor, default using gpio04, but it can be changed as below:
#sudo dtoverlay w1-gpio gpiopin=18 pullup=0
#cd /sys/bus/w1/devices ##if can't see w1... perhaps not yet enable 1-wire
#ls
#check '28-xxxxxxxxxxx' folder
from sensor.DS18B20 import DS18B20
ds=DS18B20('28-XXXXXXXXXX')
ds.temparature()
t=ds.tempearture()
t.C
t.F

SHT11 I2C
i2cdetect -y 1
#get the Hex address

from sensor.SHT20 import SHT20
sht = SHT20(1, 0x40) #address at 40
h=sht.humidity()
h.RH
t=sht.temperature()
t.C

Комментарии

Информация по комментариям в разработке