enabling temperature sensor

Connection

Beaglebone DHT11

Connect 3 Pins of DH11 3.3V,  ground and P8_11 headers, for DHT11 sensor initialization by reference of BeagleBone Black’s cape expansion headers information

DH11 specifications

Download Python Library for DHT

Adafruit Python DHT Sensor Library

Python3
$sudo apt-get update 
$sudo apt-get install python3-pip 
$sudo python3 -m pip install --upgrade pip setuptools wheel

Setup Library
$sudo pip3 install Adafruit_DHT

Examine CODES

$sudo python3 ./AdafruitDHT.py 11 P8_11
Temp=21.0* Humidity=39.0%

#!/usr/bin/python
import sys
import Adafruit_DHT

sensor=11
pin="P8_11"

while True:
    humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
    print('Temp={0:0.1f}*  Humidity={1:0.1f}%'.format(temperature, humidity))

Displaying on LED 7 Segments

Leave a Reply

Your email address will not be published. Required fields are marked *