[STM32F401RE] DHT11 Sensor on STM32 doesn't work

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
Maray97
Posts: 2
Joined: Tue Dec 15, 2020 3:38 pm

[STM32F401RE] DHT11 Sensor on STM32 doesn't work

Post by Maray97 » Tue Dec 15, 2020 3:42 pm

Hello everyone,
I'm trying to get data from a DHT11 on an STM32F401RE, however when I call the measure method, it gives me an error.
Here's the code:

Code: Select all

import machine, dht                                                         
d = dht.DHT11(machine.Pin('PA3'))                                           
d.measure()
and this is the error:

Code: Select all

Traceback (most recent call last):                                              
  File "<stdin>", line 1, in <module>                                           
  File "dht.py", line 16, in measure                                            
OSError: [Errno 110] ETIMEDOUT
it gaves me this on each pin, except the PA2 pin that remains blocked when measure is called.
My pinout from left to right is: PA3, Vin, GND (it is a three pins sensor)

can someone help me? Thanks

Post Reply