• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Sensor readings sometimes temp -140 C

Q&A Forum › Category: Home Automation › Sensor readings sometimes temp -140 C
0 Vote Up Vote Down
Anders Carlsson asked 2 years ago

Hello! I have followed the course ESP32 MQTT – Publish and Subscribe with Arduino IDE and everything works. But randomly I get values ex temp, +22 C and then suddenly -140 C to then give correct values again. All 3, temp, humidity and air pressure jump away and then read correct values again. I also use Node-Red and if you then use charts, the chart will be useless with such a reading. I’m using I2C and I haven’t tested the SPI protocol if it gets a more stable result. I have read that you should put the SD0 pin to ground and that helps a bit but not completely. I use the computer’s usb for the voltage and also tested with a voltage-fed hub but no difference. Does anyone have a solution to this?

Question Tags: bme280
10 Answers
0 Vote Up Vote Down
Nigel Tolley answered 2 years ago

So the obvious answer would be to remove the spurious readings in software. Obviously it isn’t going to be -140C any time soon, so have your code simply ignore any readings where the temperature is below -100C and you’ll be fine. I’m going to assume the corrupt readings all occur at the same time, and if I’m right, then you can just ignore all the corrupt readings by looking at the temperature value.
What’s the root cause? Good question. How long is the lead between the temperature sensor and the ESP? Is there an e.g. wifi connection jamming it every so often? Are any wires loose? I’d check the obvious stuff like that, and try it, and then add that line of code (actually, an IF statement between taking the reading and doing any updating) anyway!

0 Vote Up Vote Down
Anders Carlsson answered 2 years ago

Hello Nigel! Yes, all error readings occur at the same time. The wires are about 0.05m and I have also soldered them. And I get these misreadings in the serial moitor. I have also searched for this error and people seem to be having problems with the BME280 sensor and I didn’t get any answers for a solution. I have ordered 2 new ones and then chose the 5V the one I have is 3.3V I have also tested a BMP280 sensor and I have not received any error like this. But you have given me a way around the problem but if anyone has found a solution I’m interested.

1 Vote Up Vote Down
Anders Carlsson answered 2 years ago

I forgott Thank`s Nigel for your answer!

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi.
Many times readings like that are caused by long cables (which doesn’t seem the case) or unstable power sources.
It can also be the case of a fault in the sensor.
That never happened to me. I’m not really sure that might be the issue for your case.
Regards,
Sara

0 Vote Up Vote Down
Anders Carlsson answered 2 years ago

Hello Sara! Thank`s for your answer! I will test with another power supply, but the BMP280 has not any fault readings so it`s pointing that somethingis is wrong with the sensor. I will get 2 new in a week so I will test with them.

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Ok.
Then, let us know the results.
Regards,
Sara

0 Vote Up Vote Down
Anders Carlsson answered 2 years ago

Hello! I have now tested with a new BME280 for nearly 24 hours and no fault readings. I use the same usb as before so the problem is the sensor. This new sensor is 5V so it`s not thes ame as the old one was 3.3V I will give it another 24 hours before I am sure.

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Ok. Thanks for letting us know.
It definitely seems it was a hardware problem,
Regards
Sara

0 Vote Up Vote Down
Anders Carlsson answered 2 years ago

I have now tested the new BME280 sensor for more than 48 hours and have not received any errors, so I can probably state that it was a sensor error. I can use the old sensor in applications that do not contain charts.

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Ok.
Great.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.