You can easily wire this breakout to any microcontroller, we'll be using an Arduino. For another kind of microcontroller, just make sure it has I2C, then port the code - its pretty simple stuff!
- Connect Vin to the power supply, 3-5V is fine. Use the same voltage that the microcontroller logic is based off of. For most Arduinos, that is 5V
- Connect GND to common power/data ground
- Connect the SCL pin to the I2C clock SCL pin on your microcontroller
- Connect the SDA pin to the I2C data SDA pin on your microcontroller.
You will also need to add two I2C pullup resistors if your board does not already have them. You can use 2.2K - 10K but we will just use 10K. The resistors go from VDD to SCL and SDA each.
The AM2320 has a default I2C address of 0x5C and cannot be changed.
Search for Adafruit_Sensor to locate the Unified Sensor library and Install it
Download Adafruit_AM2320
To begin reading sensor data, you will need to also install the Adafruit_AM2320 library.
We also have a great tutorial on Arduino library installation at:
http://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use
Load Demo
Open up File->Examples->Adafruit_AM2320->am2320_basictest and upload to your microcontroller wired up to the sensor
Thats it! Now open up the serial terminal window at 9600 speed to begin the test.
You can try breathing on the sensor to increase the humidity.
Page last edited March 08, 2024
Text editor powered by tinymce.