-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temperature range goes down to -127; should stop at -55 #15
Comments
Can you share some info about your project? Temperature of |
It's the DS18B20 demo project using an Arduino Uno. The temperature range from -54.875 to +125 is printed correctly, but -55 is printed as -127. |
I spent some time looking around at the DallasTemperature library and I noticed several commits related to handling negative numbers. I think the issue lies with the library since it defines the following (in And has the following to say about that value in the implementation (
However, -55 deg C is exactly -7040 (if you multiply it by 128 which the code does all over) Thus, when you request a reading the next time, the value matches a DISCONNECTED sensor when in reality it is not. I have opened an issue here: milesburton/Arduino-Temperature-Control-Library#236 Hopefully, this can be resolved either by fixing this bug (according to me :) ) or telling me what is wrong in my assertion... |
As a workaround, could you constrain the scaled range to -7039 to +16000? That would be -54.9921875 to +125°C which would be rounded off by many programmes. |
the minimum is -54.875 simply because how the sensor reports the temperature, there's no way to specify this with the same precision as the library. I would rather not do this in the sensor if I can avoid this. Since this is a simulation, the controls specify the temperature, wouldn't that be sufficient to set the temp to the value you desire? Or is there something else in your project that controls the temp? |
In simulation mode with the temperature slider at the far left (-55):
the Serial output displays:
Temperature is: -127.00
It should display:
Temperature is: -55.00
The text was updated successfully, but these errors were encountered: