I am trying to connect an ESP8226 chip (~ Wemos D1 Mini) running Micropython to an AM2320 temperature/humidity sensor. I would like to make a few "remote sensors" that way and hook them up to small web app on a Pi to monitor that data across the house over the year.
I am having trouble reading the sensor data, even with an existing driver (https://github.com/mcauser/micropython-am2320); this stuff being pretty new to me I am not sure how to debug where the problem exactly is.
These are the exact products I bought, I hope it is okay to post them: Layout
- AM2320 layout taken from https://github.com/mcauser/micropython-am2320
- How to connect AM2320 to ESP8266 taken from https://github.com/mcauser/MicroPython- ... Nokia-5110
Testing
I copied the am2320.py from https://github.com/mcauser/micropython-am2320 to the board and ran the following code to scan for anything found via the I2C protocol, but it always prints an empty list. This worked on my pyboard-lite, so the sensor seems to work, but I dont want to use that due to the missing wifi capabilities.
Code: Select all
import time
from machine import I2C, Pin
import am2320
while True:
i2c = I2C(scl=Pin(5), sda=Pin(4))
print(i2c.scan())
time.sleep_ms(250)
I can run the driver on the ESP8266 with the sensor being connected correctly (as far as I can tell, please see image below). I am not able to read any data from it, though. The thing is, I can read data from it on my pyboard-lite, so the sensor seems to be working. Maybe the problem is one the board or the way I put it together.
My Questions
- Is there anything obviously wrong in my setup?
- Do I need resistors or something else?
- How would you go and debug hardware or software problems like this?
Thanks!