tekisri
Posts: 2
Joined: Tue Aug 06, 2019 8:49 am

GPIO configuration + AM2302 temperature sensor

Tue Aug 06, 2019 8:56 am

Hello,

I am trying to read temperature and humidity values from ASAIR AM2302 sensor. Data signal is connected to GPIO4 of raspberrypi b+ model
https://cdn-shop.adafruit.com/datasheet ... AM2302.pdf

Overlayers and modules are added to activate one-wire communication in raspberrypi.
https://pinout.xyz/pinout/1_wire

Queries:

- According to the data sheet, GPIO4 has to be intially configured as output and is pulled down. After few seconds, the sensor sends the data and hence GPIO has to be configured as input.
I would like to know how to dynamically change GPIO configuration of raspberrypi b+ via Codesys environment.

- I would want to know the unique ID of sensor which is not visible in w1_bus_master directory, even though the modules (w1-them) are added.

Any help is greatly appreciated

Thank you in advance.

pcmanbob
Posts: 6619
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: GPIO configuration + AM2302 temperature sensor

Tue Aug 06, 2019 1:54 pm

Hi.

So you posted a link to the data sheet but did you actually read it ?

from page 2
Image

So seeing as the raspberry pi uses the Dallas 1-wire bus you can't use the built-in 1-wire interface to connect your sensor to the pi.

You have to use the special interface program provided by adafruit

https://learn.adafruit.com/dht-humidity ... g/overview

https://github.com/adafruit/Adafruit_Python_DHT
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

tekisri
Posts: 2
Joined: Tue Aug 06, 2019 8:49 am

Re: GPIO configuration + AM2302 temperature sensor

Mon Aug 12, 2019 12:21 pm

Hello,

Thank for the response. I have read the document. I would like to replicate the program on to codesys environment. I need some help in that area.

pcmanbob
Posts: 6619
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: GPIO configuration + AM2302 temperature sensor

Mon Aug 12, 2019 12:49 pm

tekisri wrote:
Mon Aug 12, 2019 12:21 pm
Hello,

Thank for the response. I have read the document. I would like to replicate the program on to codesys environment. I need some help in that area.
Sorry outside of my field on knowledge so can't help with that.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
joan
Posts: 14175
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO configuration + AM2302 temperature sensor

Mon Aug 12, 2019 1:18 pm

Surely https://forum.codesys.com/ is the place to ask?

There are many DHTxx software examples on the www.

Return to “Automation, sensing and robotics”