DS18B20 DS18X20 Intermittent Readings errors

Hi,

Try adding the line…

SYSTEM_THREAD(ENABLED);

to the your definitions, for example just after ‘Ubidots ubidots(TOKEN);’ but should also work at the end of the definitions just before the setup().

Next you need to place your first two lines of your loop() within a single threaded blocking statement as follows…

void loop()
{
SINGLE_THREADED_BLOCK() { //block calls while reading the sensor
sensors.requestTemperatures();
Temperature = sensors.getTempCByIndex(0);
} //end of block
tempF=Temperature*1.8+32;

....rest of your code....

This worked for me by stopping interrupts out of the temperature sensor read routine. Hope it works OK for you as well.