Temperature Sensor (DS18B20) doesn't work with Weather:bit board

Hello there!

I recently bought two Temperature Sensors (DS18B20) to use with the Weather:bit board and I am having a bit of an issue with them. Both are always returning the same temperature values: -12 (if I don’t divide the “soil temperature” variable by 100) or 0 (if I divide the “soil temperature” variable by 100).

I put the sensors on cold water, hot water and soil samples and the result is always the same: temperature values of -12 or 0.

I also bought the Soil Moisture sensors to use on the Weather:bit and they work perfectly.

I verified the hardware hookup and everything is ok.


The javascript code on Microsoft MakeCode is simple as that:

input.onButtonPressed(Button.AB, function () {

basic.showNumber(weatherbit.soilTemperature())

})

I tested the temperature sensors with a digital multi meter and they seem to be fine.

I am wondering if the problem could be in the weather:bit extension for the Microsoft MakeCode.

I don’t know what to do more. I need help, please.

Thank you,

Patrícia

Hi Patricia,

I was able to replicate your error and I found a fix that should work for you. When you open the [Soil Temp Example, delete the code blocks for “Start Weather monitoring” and “Soil temperature (C)”. After you have done that, go to the “Extensions” tool and re-install the weather:bit extension. It should prompt you that you wish to “uninstall weatherbit and install weatherbit”. Select yes and after you have re-installed the extension, re-add the “Start Weather Monitoring” and “Soil Temperature(C)” blocks and then re-upload the code.

That should fix the issue but if not, let me know and we can troubleshoot further.](micro:climate Kit Experiment Guide - SparkFun Learn)

Hi TS-Mark,

Thank you for your reply.

I tried other thing to fix the issue: the update version 0.0.14 of the weather:bit extension, and it worked!

I used the extension with the update containing the full constructors lines for the pins (12 and 13) and it solved my problem.

The community of the pxt-weather-bit on GitHub helped me too. And now everything is fine!

Thank you for your support!

Patrícia