ds18b20 problem

Hello everyone! U made a sketch for reading the ds18b20 one wire temp sensors and displaying the temps on a glcd... And some other stuff :) The sensors work and the teperatures are accurate but the problem is that somerimes i get a reading of -127°C and i was wonedring why this happens .. Checked the connections, sensors are in close proximity, everything ok. The error seemed to be less frequent when i added a 1500ms delay in the loop but it was still present.. Any suggestions? The temps are for information pourposes only and are not used for regolation but its still annoying :) sorry for my english :) Thank you!

The DS18B20 requires specific timing. When for example there are many interrupts from the Serial port or from I2C, the timing is delayed and you get wrong values. Do you check the checksum ? You should check it, and don't use the temperature when the checksum is not okay.

It is also possible that you are out of ram. Perhaps you use a lot of buffers for the glcd. You can check the available memory : http://playground.arduino.cc/Code/AvailableMemory Use the function at the bottom of that page.

When you write "some other stuff", that gets my attention :o ! Maybe you can tell what it is, so I don't have to stay awake at night wondering what other stuff it is :sleeping: Perhaps you use even more buffers, and libraries and classes.

My friend has a car painting chamber... He has a furnace for heating the air.. The problem is that in winter time he has alot of trouble getting the temperature to 50° for drying the clear coat... So we made baffles for directing air, so if he has trouble getting the teperature up he repositiones the baffles and the used air goer back trough the furnace... But he cant do that until the air inside the chamber clears (no paint particles in the air). So i used an mega 2560 some potentiometer for the baffle position and two linear actuators.. Now i upgraded the system so he can see teperatures of the air going out from the chamber an the temperature of air that goes in to the chamber... And the controller uses a glcd so i could make a "schematic" of the baffle positions and the flow of air... In short i write to the glcd a bunch of static lines (i could do them in the setup routine), i constantly write the positions of the baffles and display the set position angle number. And in the and there are a couple of if sentences for moving the actuatir if they are not in setpoint position.. So yes the loop is busy.. How can i check the crc if i may ask?

Sometimes the CRC check is done internally when you request the temperature. In that case you need to check the returned error.

It can be : OneWire::crc8() It can be a check for : DEVICE_DISCONNECTED_C

Which library are you using ? and what does the sketch look like ?

I dont have the code here... My laptop is at my friends house :) the library is called Dallas temperature arduino library... OneWire.h and DallasTemperature.h