Posts: 1
Joined: Tue Dec 04, 2018 5:07 am

Reading sensor

Tue Dec 04, 2018 5:19 am

I have a AM2302 temp/humidity sensor ( and a Pi 3 B+.

I am attempting to read the temp data from GPIO15 (Pin10) but cannot find the correct code to pull the data.

+ is connected to 3v3 (Pin1)
Out is connected to GPIO15 (Pin10)
- is connected to GND (Pin6)

What code can I use to display data in Python 3?

I was unable to pull the serial of the sensor with the following:
sudo modprobe w1-gpio
sudo modprobe w1-therm
cd /sys/bus/w1/devices/

Posts: 92
Joined: Thu Mar 22, 2018 1:02 pm
Location: Finland

Re: Reading sensor

Tue Dec 04, 2018 12:07 pm

Install the Adafruit DHT library. AM2302 is not a Dallas 1-wire sensor, it's a DHT22 in a different package.

Return to “Automation, sensing and robotics”