enricosx
Posts: 8
Joined: Sun Jan 17, 2016 5:38 pm

How can i use five AM2320?

Sun Jan 17, 2016 5:42 pm

hello i'm a noob :D
i have raspberry pi b 2
please help me to understand how can i use with python five AM2320 sensor
http://www.aliexpress.com/item/5pcs-AM2 ... 97408.html
thanks

RDS
Posts: 776
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: How can i use five AM2320?

Sun Jan 17, 2016 7:28 pm

I assume you have got it working with 1 sensor to start with.

enricosx
Posts: 8
Joined: Sun Jan 17, 2016 5:38 pm

Re: How can i use five AM2320?

Sun Jan 17, 2016 7:40 pm

ok, but i dont know use one sensor.
w1-gpio? adafruit library? or...?

User avatar
mikronauts
Posts: 2794
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: How can i use five AM2320?

Sun Jan 17, 2016 9:22 pm

1) it is usually a good idea to research what sensor to buy, and to buy well supported ones before ordering

2) a simple google for "AM2320" leads to the data sheet and much more

http://akizukidenshi.com/download/ds/aosong/AM2320.pdf

3) a quick peek at the data sheet shows it is an I2C device, without any external pins to set the address

Therefore:

- you should need an I2C multiplexer to use more than one on an I2C bus

- the same google search had links to Arduino code you could try adapting to the Pi using the WiringPi library

And googling for "Raspberry Pi AM2320" had links to some postings that may be of help to you.
enricosx wrote:hello i'm a noob :D
i have raspberry pi b 2
please help me to understand how can i use with python five AM2320 sensor
http://www.aliexpress.com/item/5pcs-AM2 ... 97408.html
thanks
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

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

Re: How can i use five AM2320?

Sun Jan 17, 2016 9:53 pm

It's probably simplest to use it in so called 1 wire mode (not to be confused with Dallas 1-wire). It then acts like a DHT22. So you would need a 4k7 resistor per device and one spare GPIO per device.

Of course I would read it using my software, probably http://abyz.co.uk/rpi/pigpio/examples.html#pdif2_DHTXXD

User avatar
mikronauts
Posts: 2794
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: How can i use five AM2320?

Sun Jan 17, 2016 10:02 pm

good point. I guess I have I2C on the brain :)

What joan said - I can heartily recommend her excellent library.
joan wrote:It's probably simplest to use it in so called 1 wire mode (not to be confused with Dallas 1-wire). It then acts like a DHT22. So you would need a 4k7 resistor per device and one spare GPIO per device.

Of course I would read it using my software, probably http://abyz.co.uk/rpi/pigpio/examples.html#pdif2_DHTXXD
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

enricosx
Posts: 8
Joined: Sun Jan 17, 2016 5:38 pm

Re: How can i use five AM2320?

Mon Jan 18, 2016 7:42 am

thanks :D

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: How can i use five AM2320?

Mon Jan 18, 2016 9:00 am

mikronauts wrote:I can heartily recommend her excellent library.
[ot]
:shock:
can't be
[/ot]

enricosx
Posts: 8
Joined: Sun Jan 17, 2016 5:38 pm

Re: How can i use five AM2320?

Mon Jan 18, 2016 11:08 am

Code: Select all

 gcc -Wall -pthread -o DHTXXD test_DHTXXD.c DHTXXD.c -lpigpiod_if2
test_DHTXXD.c:31:25: fatal error: pigpiod_if2.h: No such file or directory
 #include <pigpiod_if2.h>
                         ^
compilation terminated.
DHTXXD.c:10:25: fatal error: pigpiod_if2.h: No such file or directory
 #include <pigpiod_if2.h>
                         ^
compilation terminated.
:?

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: How can i use five AM2320?

Mon Jan 18, 2016 11:11 am

Massi wrote:
mikronauts wrote:I can heartily recommend her excellent library.
[ot]
:shock:
can't be
[/ot]
Why not?

I don't know what Joan's gender is but the name is very commonly a female name here in the UK, although it is also a common Male name in other countries. (my default assumption was female on that basis).

Joan's gender is irrelevent to my opinion of Joan's superb PIGPIO library and excellent posts.
Doug.
Building Management Systems Engineer.

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: How can i use five AM2320?

Mon Jan 18, 2016 11:18 am

enricosx wrote:

Code: Select all

 gcc -Wall -pthread -o DHTXXD test_DHTXXD.c DHTXXD.c -lpigpiod_if2
test_DHTXXD.c:31:25: fatal error: pigpiod_if2.h: No such file or directory
 #include <pigpiod_if2.h>
                         ^
compilation terminated.
DHTXXD.c:10:25: fatal error: pigpiod_if2.h: No such file or directory
 #include <pigpiod_if2.h>
                         ^
compilation terminated.
:?
Did you follow the download instructions?

I can see it on Github

re-download it from github?

Code: Select all

git clone https://github.com/joan2937/pigpio
but I would have thought that it is in the zip file

Code: Select all

wget abyz.co.uk/rpi/pigpio/pigpio.zip
You did have the file in your working directory?
Doug.
Building Management Systems Engineer.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: How can i use five AM2320?

Mon Jan 18, 2016 12:07 pm

BMS Doug wrote:Why not?

I don't know what Joan's gender is but the name is very commonly a female name here in the UK, although it is also a common Male name in other countries. (my default assumption was female on that basis).

Joan's gender is irrelevent to my opinion of Joan's superb PIGPIO library and excellent posts.
i totally quote you, but i had a different default assumption and never thought to different possibilities :)
totally irrelevant, i agree, but it's strange lol

enricosx
Posts: 8
Joined: Sun Jan 17, 2016 5:38 pm

Re: How can i use five AM2320?

Mon Jan 18, 2016 1:01 pm

:oops: i don't see download istructions :oops: :oops: :oops:

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How can i use five AM2320?

Mon Jan 18, 2016 1:09 pm

enricosx wrote::oops: i don't see download istructions :oops: :oops: :oops:
Follow one of the links that Doug gave you in viewtopic.php?f=91&t=132994#p886689

Return to “Beginners”