Peaks on my temperature graphs

Hi!

I use this “app” I made to monitor 2 cold chambers.
Some months (maybe years) ago the graphs started to show instant peaks as you can see in the attachment.
My first attempt was changing the power source. The peaks remained.
During the night (when my business is not running) the graphs don’t show peaks.
My guess is that some electrical disturb is happening.
How do I solve this?

Thanks!

  • Rodrigo

Based on what you’ve said, it’s impossible to say what’s causing this.
It doesn’t seem to be a Blynk issue, but something to do with either your sensor, your hardware or your code.
Maybe if you shared some info about those then something might leap out at us.
Hopefully this project isn’t assembled on a breadboard?

Pete.

I’m using Arduino UNO, ESP8266 as wifi bridge and 2 Ds18b20.
Power source 5V/1A (this I need to confirm when I get back to the company)

It used to work without peaks in the past. Definetily is some piece of hardware not working well. What?

thanks!

or the peaks were always there and the graphing smoothed them out???

I would start by trying to capture some more data when the peaks happen (can you also measure your power supply voltage?), so if the temp jumps by a large amount, log the time and actual temps. That way you will find out if the sensors are degrading or if there is something else going on. Have you exported the data from the chart?

I’d start by reviewing my grounding strategy.

How often do you sample the temperature? Worst case, you filter out the spikes with your firmware. Are you checking the CRC … OneWire::crc8?

How are you powering gyour ESP?
Hopefully not from the 3.3v pin on the Arduino.

Pete

I don’t think so because the peaks appeared suddenly. I’ll find a way to measure the power source voltage and come back with more info.
Actual temps don’t change as a peak. Both chambers have stock contollers with temperature display.
Thanks!

1 Like

Temp is read every 5 seconds.
Sorry, what’s CRC… OneWire::crc8?
Thanks!

Yes! It’s powered thru 3.3v pin on my Arduino.
Should I change to 5v?
Thanks!

Cyclic Redundancy Check. Are you using OneWire? crc8 should check the integrity of the temperature sample. If the CRC check fails, you’d re-read the temperature … two or three times if necessary.

OMG! I use OneWire library, but I don’t call the crc8. Should I?

Thanks!

Well, it’s a “little” more involved than just calling OneWire::crc8. :wink:

Skim through this,

https://playground.arduino.cc/Learning/OneWire

Read this,

Let me know if you have any questions.

I think OneWire::crc8 is the best solution. A more simple solution would be to test for temperature outliers. You’re reading the temperature every five seconds. I’m not sure how much the temperature of a cold chamber can change in five seconds, but let’s assume the most recent temperature sample indicates it changed by 10 degrees. That’s a pretty good indication the temperature sample is invalid. Just re-read it. You could experiment with smaller deltas.

Again, I vote for OneWire::crc8. If you find it too involved, try the outlier method.

NO!
The ESP-01 needs 3.3v. If you power it with 5v you’ll kill it.

It’s generally accepted that the Arduino 3.3v supply rail isn’t sufficient to power the ESP-01 reliably, so you you should be using a separate 3.3v supply, but the ground of that supply and the Arduino supply should be connected together. (Or you should ditch the Ardiono/ESP-01 combo all together and use a Wemos D1 Mini or NodeMCU instead and simplify the whole setup).

Pete.

Perhaps it depends on the ESP8266 but the NodeMCU ESP8266s I am using do allow 5V power input on its VIN pin.

Yes, that’s why I specified ESP-01, which is what most people use as a Wi-Fi modem.

Pete.

1 Like

@wickedbeernut, Thank you! I’ll take some time reading the content you shared.
In 5 seconds the actual temperature would NOT change more than 0.1 degrees.

@PeteKnight and @DaleSchultz Thanks! If I use only NodeMCU ESP8266s may I throw away the Arduino One and ESP8266?

Thanks you, gentlemen! You are awesome!

It might be worth you reading this:

Your sensors are 3v to 5v compatible, so will work with a NodeMCU without the need for any level shifting.

Pete.

I’ll follow your advice! Thanks again!
(I have short attention span also :smile:)

1 Like

Getting 100% accurate readings all the time when using $10 worth of hardware is mostly wishful thinking I guess :sunglasses:

I too had random spikes in my otherwise so pretty graph from time to time that I couldn’t derive to something specific. So instead of doing a ton of trouble shooting I just added some “sanity code”.

Readings that deviate more than +/- 30 degrees from the previous are simply ignored and a notice is printed in my terminal window:

void startSensorConversation() {
	
	DS18B20.requestTemperatures();
	newTemp = true;
}

void getSensorData() {
	
	if (newTemp) {

		float temp1E = DS18B20.getTempC(sensor1E);
		float roundedValue1E = ceilf(temp1E * 100) / 100;

		if (roundedValue1E < (lastValue1E - 30) || roundedValue1E > (lastValue1E + 30) ) {
			terminal.println("Error reading sensor 1E !");
		}
		
		else {
			lastValue1E = roundedValue1E;
			Serial.print("Bedroom: ");
			Serial.println(roundedValue1E);
			Blynk.virtualWrite(6, roundedValue1E);
		}

		float temp4B = DS18B20.getTempC(sensor4B);
		float roundedValue4B = ceilf(temp4B * 100) / 100;
		
		if (roundedValue4B < (lastValue4B - 30) || roundedValue4B > (lastValue4B + 30) ) {
			terminal.println("Error reading sensor 4B !");
		}
		
		else {
			lastValue4B = roundedValue4B;
			Serial.print("Living room: ");
			Serial.println(roundedValue4B);
			Blynk.virtualWrite(5, roundedValue4B);
    	}
    	
		newTemp = false;
	}
}

The code is from my old 433 Mhz project

1 Like

More data!
Checkout these readings when business is not running. No spikes.