Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jwilleke/dfrobot-ds18b20
A test and example Arduino code for DS18B20 Temperature Sensor
https://github.com/jwilleke/dfrobot-ds18b20
Last synced: 13 days ago
JSON representation
A test and example Arduino code for DS18B20 Temperature Sensor
- Host: GitHub
- URL: https://github.com/jwilleke/dfrobot-ds18b20
- Owner: jwilleke
- Created: 2023-12-29T17:52:08.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-30T09:47:56.000Z (about 1 year ago)
- Last Synced: 2025-01-20T22:57:00.533Z (17 days ago)
- Language: C++
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DS18B20 Temperature Sensor
Code use [OneWire]
## Dallas Temperature Control Library vs DFRobot
We found the [DallasTemperature-DS18B20](https://github.com/jwilleke/DallasTemperature-DS18B20) which uses the Dallas Temperature Control Library has more features and seems to be easier to use.
## Device
We used this [Gravity: Waterproof DS18B20 Temperature Sensor Kit](https://www.dfrobot.com/product-1354.html)
## We statred with the code
[SKU:DFR0198 Waterproof DS18B20 Sensor Wiki](https://wiki.dfrobot.com/Waterproof_DS18B20_Digital_Temperature_Sensor__SKU_DFR0198_) and added few things like
getTempF(celsius) tp get Fahrenheit from Celsius value.## Expected Output
``` bash
24.00 Celsius 75.20 Fahrenheit
24.00 Celsius 75.20 Fahrenheit
23.94 Celsius 73.40 Fahrenheit
23.87 Celsius 73.40 Fahrenheit
23.81 Celsius 73.40 Fahrenheit
23.75 Celsius 73.40 Fahrenheit```
## Arduino can not deal with high precision numbers
The float data type has only 6-7 decimal digits of precision. That means the total number of digits, not the number to the right of the decimal point. Unlike other platforms, where you can get more precision by using a double (e.g. up to 15 digits), on the Arduino, __double is the same size as float__.
We have been aunable to get any Celsius to Fahrenheit calculations to be accurate.