{"id":20989785,"url":"https://github.com/robtillaart/temperature","last_synced_at":"2026-02-19T11:14:22.551Z","repository":{"id":42046375,"uuid":"253507826","full_name":"RobTillaart/Temperature","owner":"RobTillaart","description":"Arduino library with dewPoint  humidex and heatIndex functions. ","archived":false,"fork":false,"pushed_at":"2024-04-13T09:14:19.000Z","size":48,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-07T18:27:44.986Z","etag":null,"topics":["arduino","dewpoint","formula","heatindex","temperature"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"RobTillaart"}},"created_at":"2020-04-06T13:35:53.000Z","updated_at":"2024-07-19T22:46:07.000Z","dependencies_parsed_at":"2023-11-12T11:21:56.440Z","dependency_job_id":"f7f95456-2472-431f-92b3-388868fde7c8","html_url":"https://github.com/RobTillaart/Temperature","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FTemperature","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FTemperature/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FTemperature/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FTemperature/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/Temperature/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225305640,"owners_count":17453419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","dewpoint","formula","heatindex","temperature"],"created_at":"2024-11-19T06:26:10.087Z","updated_at":"2026-02-19T11:14:17.506Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart"],"categories":[],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/Temperature/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/Temperature/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/Temperature/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/Temperature/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/Temperature/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/Temperature.svg)](https://github.com/RobTillaart/Temperature/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/Temperature/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/Temperature.svg?maxAge=3600)](https://github.com/RobTillaart/Temperature/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/Temperature.svg)](https://registry.platformio.org/libraries/robtillaart/Temperature)\n\n\n# Temperature\n\nArduino library with temperature conversion and weather functions including dewPoint, humidex, heatIndex and wind-chill.\n\n\n## Description\n\nThis library contains weather related functions.\nThese functions are approximations based on work of NOAA a.o.\n\nThese functions can be used with temperature and humidity sensors e.g.\nDHT22 or Sensirion, to make a weather station application.\n\nNote: pre-0.3.1 versions have incorrect heat-index.\n\n\n#### Related\n\n- https://en.wikipedia.org/wiki/Heat_index.\n- https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml\n- https://wahiduddin.net/calc/density_algorithms.htm\n- https://github.com/RobTillaart/pressure\n\n\n## Interface\n\n```cpp\n#include \"temperature.h\"\n```\n\n### Conversion\n\n- **float Fahrenheit(float Celsius)** idem.\n- **float Celsius(float Fahrenheit)** idem.\n- **float Kelvin(float Celsius)** idem.\n\nMore converters are implemented in the **temperatureConverter** class below.\n\n\n### DewPoint, humidex\n\n- **float dewPoint(float Celsius, float humidity)** idem.\n- **float dewPointFast(float Celsius, float humidity)** idem.\n- **float humidex(float Celsius, float dewPoint)** idem.\n\n\n### heatIndex\n\n- **float heatIndex(float Fahrenheit, float humidity)** idem.\n- **float heatIndexC(float Celsius, float humidity)** idem.\n\n\n#### 0.3.0\n\nThe formula for the **heatIndex()** was taken from https://en.wikipedia.org/wiki/Heat_index.\nSince version 0.3.0 the more elaborated version of https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml \nwill be used. \nNote: there will be performance differences.\n\nIndicative table\n\n|  Fahrenheit  |  Celsius  |  description  |  colour code  |\n|:------------:|:---------:|:--------------|--------------:|\n|    70-79     |   21-26   |  warm         |     green     |\n|    80-89     |   26-32   |  very warm    |    yellow     |\n|    90-104    |   32-40   |  hot          |    orange     |\n|   105-129    |   40-54   |  very hot     |       red     |\n|   \u003e 130      |   \u003e 54    |  extreme hot  |    purple     |\n\n\n### Absolute Humidity\n\n- **float absoluteHumidity(float Celsius, float relHumidity)**\nConverts relative humidity and temperature to absolute humidity.\nReturn unit is grams/m3.\n\n\n### WindChill\n\nWind speed @ 10 meter, if **convert** is true =\u003e wind speed will be converted to 1.5 meter\nelse ==\u003e formula assumes wind speed @ 1.5 meter\n\n- **float WindChill_F_mph(float Fahrenheit, float milesPerHour, bool convert = true)**\n- **float WindChill_C_kmph(float Celsius, float kilometerPerHour, bool convert = true)**\n- **float WindChill_C_mps(float Celsius, float meterPerSecond, bool convert = true)**\n\n\nIndicative table (subjective).\n\n|  wind chill °C  |  description           |\n|:---------------:|:-----------------------|\n|    \u003e -10        |  cold                  |\n|    -10 .. -25   |  very cold !           |\n|    -25 .. -35   |  very very cold !      |\n|    -35 .. -55   |  chance of frostbite   |\n|    \u003c -55        |  serious dangerous     |\n\n\n### Boiling temperature water\n\nWhen you are in the mountains the cooking point of water drops.\nThis can be so much that you can't boil an egg on mount Everest.\n\nTemperature in F and C at which water cooks.\nBased upon: https://en.wikipedia.org/wiki/High-altitude_cooking\n\n- **boilingFahrenheit(feet)** boiling temperature Fahrenheit at height in feet.\n- **boilingCelsius(meter)** boiling temperature Celsius at height in meter.\n- **boilingMeter(Celsius)** returns height in meters for a given the boiling point in Celsius.\nNote this is an approximation by reversing the formula.\nDo not expect it to be very exact.\n\n\nFor Celsius from feet call:\n```cpp\nC = boilingCelsius(feet * 0.3048);\n```\nFor Fahrenheit from meters call:\n```cpp\nF = boilingFahrenheit(meter * 3.2808);  //  * 3.280839895  == / 0.3048\n```\n\n----\n\n# TemperatureConverter class\n\nSince version 0.3.2 a temperature convertor class is added to convert to and from \nother (less known) temperature scales. \nThe idea is to set a value in one scale and retrieve it in the other.\nAs the converter holds the last value set, multiple conversions are easy.\nSee example.\n\nThe scales are typically named after their inventor. \nCheck Wikipedia for details about the scales.\n\n|  Name         |  units  |  1° in °K  |     0°C   |    100°C  |  notes  |\n|:--------------|:-------:|:----------:|----------:|----------:|:--------|\n|  Celsius      |   °C    |  1.000000  |     0.00  |   100.00  |\n|  Delisle      |   °De   |  0.666666  |  -100.00  |    50.00  |\n|  Fahrenheit   |   °F    |  0.555556  |    32.00  |   212.00  |\n|  Kelvin       |   °K    |  1.000000  |   273.15  |   373.15  |\n|  Newton       |   --    |  3.030303  |     0.00  |    33.00  |  not the force.\n|  Rankine      |   °Ra   |  0.555556  |   491.76  |   671.67  |  0°Ra == 0°K, steps == Fahrenheit.\n|  Reamur       |   °Re   |  1.250000  |     0.00  |    80.00  |\n|  Romer        |   °Ro   |  1.904762  |     7.50  |    60.00  |\n\nNote: units to be verified.\n\nNote: this class is slightly slower than direct conversion, but it \nprevents to have 8 x 7 optimized functions.\n\n\n## Interface\n\n```cpp\n#include \"temperature.h\"\n```\n\n#### Constructor\n\n- **temperatureConverter()** Constructor sets the default to zero degrees C.\n\n\n#### setters\n\n- **void setKelvin(float value = 0)**\n- **void setCelsius(float value = 0)**\n- **void setFahrenheit(float value = 0)**\n- **void setReamur(float value = 0)**\n- **void setRankine(float value = 0)**\n- **void setDelisle(float value = 0)**\n- **void setNewton(float value = 0)**\n- **void setRomer(float value = 0)**\n\n#### getters\n\n- **void getKelvin()**\n- **void getCelsius()**\n- **void getFahrenheit()**\n- **void getReamur()**\n- **void getRankine()**\n- **void getDelisle()**\n- **void getNewton()**\n- **void getRomer()**\n\n\n## Operations\n\nThe functions have a limited scope so one cannot use it for all input values possible.\nThe user should be aware of that. Check the references mentioned in the code and or\nWikipedia to confirm the applicability of the values generated.\nThe functions do not check the inputs.\n\nSee examples for typical usage.\n\n\n# Future\n\n#### Must\n\n- split of TemperatureConversion class as a library of its own.\n  - 0.4.0\n\n#### Should\n\n- improve documentation\n  - add short explanation per conversion unit? \n  - freeze/boil temps.\n- unit tests\n  - absoluteHumidity\n  - boiling tests.\n- add function freezing point shift due to pressure.\n\n#### Could\n\n\n#### Wont\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Ftemperature","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobtillaart%2Ftemperature","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobtillaart%2Ftemperature/lists"}