I have a simple script that uses the `dht` library to read values of dht11 and push them to a server. I first developed this on a NodeMCU v3 board and it is working fine. I ordered another dev board but instead of the NodeMCU v3, they sent me a NodeMCU Amica. Even though I thought that they are the same, I experience the following strange behavior.
After uploading the exact same micropython script, values received from the Amica board have singificant fluctuations which were not present using the NodeMCU v3 board! Switching the same sensor back to the NodeMCU v3 board, the fluctuations disappear. Here is a screenshot of the values.
I think it is obvious that in the middle is where I switched the sensor from the NodeMCU v3 to Amica!
Any thoughts?
Different behavior of sensor between boards
Re: Different behavior of sensor between boards
At first I thought that something may be wrong with the timings of the Amica module which affect the one-wire bit banging which causes the error. However, after looking into the dht driver of MicroPython https://github.com/micropython/micropyt ... dht/dht.py this wouldn't be possible since there is a CRC when measuring.
So if we can assume that the transmission is correct, then the only thing that could go wrong is the actual sensor measurement. At the moment the only thing I can think of is that the Amica does not provide the correct power to the module causing wrong measurements. I will have to test this tomorrow.
Any suggestions or comments welcome.
So if we can assume that the transmission is correct, then the only thing that could go wrong is the actual sensor measurement. At the moment the only thing I can think of is that the Amica does not provide the correct power to the module causing wrong measurements. I will have to test this tomorrow.
Any suggestions or comments welcome.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Different behavior of sensor between boards
If you have access to an oscilloscope you could check for noise on the DHT11 power line. Otherwise experiment with decoupling capacitors.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Different behavior of sensor between boards
Indeed, after switching the sensor to an external power supply, the fluctuations are gone, and the measurements are back to normal.
Unfortunately I don't have an oscilloscope right now to confirm this.
Thanks. According to the datasheet of the original NodeMCU there are decoupling capacitors. This leads me to believe that the Amica board does not follow the original schematic.pythoncoder wrote: ↑Sat Apr 21, 2018 9:28 amIf you have access to an oscilloscope you could check for noise on the DHT11 power line. Otherwise experiment with decoupling capacitors.
Unfortunately I don't have an oscilloscope right now to confirm this.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Different behavior of sensor between boards
I think you've proved the point, even without a 'scope.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.