mcauser / micropython-am2320

MicroPython driver for the Aosong AM2320 temperature and humidity sensor
MIT License
25 stars 6 forks source link

does not work sometimes #4

Closed khvolk closed 8 months ago

khvolk commented 2 years ago

I used an AM2320 with this library with good results. But today I got:

Traceback (most recent call last): File "", line 1, in File "am2320.py", line 44, in measure OSError: [Errno 19] ENODEV

after starting sensor.measure(). Adding two 1 kOhm resistors (SDA to 3.3V, SDL to 3.3V) solve this problem.

mcauser commented 2 years ago

Hi @khvolk you're correct. To use the I2C interface, your SDA+SCL lines need pull up resistors. I'll update the docs so it's more clear that they are required.