Hi, I’m new to the forums, so hopefully this is the correct place to post this topic. I am experimenting with weather stations using a weather:bit, with a micro:bit sending a string by usb to a node red application.
I have three stations running, and recently two of them have displayed a temperature of -141C and -144 C for an extended period of time. With this, the humidity is also zero. Everything else works fine. One had been on for approximately 16hrs when it did it, and the other had run for 3 days when it did it, then did it again 6 days later.
I am seeing these numbers directly from the debug node in the Node Red app, so I do not suspect it is the problem. My micro:bit code is as follows;
weatherbit.startWeatherMonitoring()
serial.redirectToUSB()
basic.forever(function () {
basic.pause(6000)
serial.writeValue("AirTemp ", weatherbit.temperature() / 100)
basic.pause(100)
serial.writeValue("Humidity", weatherbit.humidity() / 1024)
basic.pause(100)
serial.writeValue("Pressure", weatherbit.pressure() / 260200)
basic.pause(100)
serial.writeValue("Speed", weatherbit.windSpeed() * 1.61)
basic.pause(100)
serial.writeValue("Direction", pins.analogReadPin(AnalogPin.P1))
basic.pause(100)
serial.writeValue("SoilMoisture", weatherbit.soilMoisture())
basic.pause(100)
serial.writeValue("Rain", weatherbit.rain() * 25.4)
basic.pause(100)
serial.writeValue("SoilTemp", weatherbit.soilTemperature() / 100)
basic.pause(100)
serial.writeValue("Light", input.lightLevel())
basic.pause(100)
serial.writeValue("Accel", input.acceleration(Dimension.Y))
})
Thanks!
Hi dfgillespie,
That is some weird behavior. Just to confirm, is the rest of the data from the BME280 on the Weather:bit reasonable? If you are getting accurate humidity, pressure and altitude readings, it may be something in the code locking up. Does resetting the board fix the issue or is the temperature data consistently -141C/-144C. Also, try uploading our example code from the [Experiment Guide to see if the reported temperature is still -141/-144C. If the temperature reported is sane with our example, it most likely is something with the code reporting to node red.](https://learn.sparkfun.com/tutorials/microclimate-kit-experiment-guide/experiment-1-reading-the-temperature-humidity-and-pressure)
Thanks for the reply. Resetting has always fixed the negative temperature issue. Since humidity also drops to zero with the low temperature, I suspect something in the board. Possibly a low voltage or faulty ground? One was powered off a Raspberry Pi running of a battery that holds at 13.5v with a solar charger, the other off my iMac. It shows no sign of overheating. I have one board that stuck on 100% humidity shortly after my post. Resetting did not fix it, but swapping out the weather:bit with the same micro:bit did.
Is it possible that I am running low on ram? Do you think a longer pause between serial write messages would help? I have also had issues with wind direction sending ??? (255 on the pin as I am reading now). The hardest part is the time it takes to get a false measurement.
Interesting. It definitely sounds like something is hanging up in your code either with the I2C bus or your serial/BLE output. I would try playing around with the delays in between each string for the various sensors and see if that helps. Try upping it to half a second for starters.
I’ve been away from the computer for a couple days, but before I left I took the conversion factors out of the micro:bit code. I noticed when one was in error state that the messages were coming in much slower, so I wondered if the conversion factors were slowing it down. So I left 3 running for 5 days now, and so far no negative temperatures! I may try upping the delays, but this seems like a good start. Thanks for the help!