Issue with ESP8266 and DS18B20 sensor #9250
-
Hello everyone, First, I hope this is the good place to post my issue. I started my project with a french blog post wich describes how to set a ESP8266 board with a temperature sensor and Arduino code. Lately I found I could use MicroPython to run my board and I was quite excited to try this as it appears to be easier to update code and run it, in particular with REPL prompt. With the first DS18B20 sensor, I realised the values were weird : between 25°C and 33°C inside which are obviously not correct.
but discover_fake and classify_fake indicates this is counterfeit as you can see at the bottom.
I'm thinking about returning to Arduino code because it sounds like it doesn't care about counterfeit sensor or not but I would prefer finding a solution to my problem with MicroPython ;) Could you please help me to find if this is only a hardware problem or if there is some improvements to do in my code ? Thanks to everyone who read my post ! Under : discover_fake & classify_fake
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Try this between the convert and the read:
|
Beta Was this translation helpful? Give feedback.
-
I just confirmed that the DS18x20 and the actual ESP8266 code work. And yes, your code misses the wait time after convert(). |
Beta Was this translation helpful? Give feedback.
Try this between the convert and the read:
utime.sleep_ms(1000) # min of 750ms for 1wire conversion