I still haven’t found a solution for using a micro:bit V2 with the DHT22 sensor. As far as I can tell from my testing, readings with MakeCode still do not work.
Has anyone found a solution to this issue? Or am I doing something wrong?
All of the extensions are made by people. They get bored and move on. You have said the extension works with the V1 micro:bit. That may have been the last time it was updated. You may need to write your own extension or fix the one you are using.
Even the manufacturer’s extensions are not guaranteed to work after a while.
With today’s technology, I decided to take a closer look at the extension published on GitHub. In other words, I learned enough to dig into the code myself.
After reviewing it, creating my own fork, and spending a few hours modifying and testing the code with the help of Copilot, I ended up with a working version of the extension.
It is probably not perfect, but it provides stable readings and, from my testing so far, it works reliably.
The extension is available here:
It can be added directly from the MakeCode Extensions menu.
It works on my micro:bit V2 with an AM2302/DHT22 sensor.
There is still an occasional issue where a reading fails, but this can be handled by checking whether the last read operation was successful before using the returned values.
Example 1
This example sends the readings directly to the serial output:
Could someone else please test it and let me know whether it also works on your micro:bit V2?
Any feedback or additional testing results would be greatly appreciated.