Arduino library for DHT sensors - integer only

Arduino CI Arduino-lint JSON check License: MIT GitHub release

DHTINT

Arduino library for DHT sensors - integer only

Description

This is an experimental integer only library, based upon - https://github.com/RobTillaart/DHTNew - version 0.4.12

Goal is to reduce footprint by using integer math only. This way the lib becomes more usable for processors like the ATTINY 45 or 85.

As the library only uses integer math it will not trigger the automatic including of the floating point math libraries. This will save additional memory unless other code uses floating point math.

Compare DHTINT versus DHTNEW

Sketch: ..\example\dhtint_minimum.ino

replaced DHTINT with DHTNEW

platform library sketch size variables
UNO DHTNEW 5730 341
UNO DHTINT 3978 321
delta 1752 20
ESP32 DHTNEW 206730 13464
ESP32 DHTINT 206110 13456
delta 620 8

Gain is most substantial for the UNO platform.

Raw data access

To access the decimal part the following two functions are added. These give access to the bytes that are low level communicated. The user can decode these values to get the integer + decimal part. This can be used for efficient storage or transmission.

  • uint16_t getRawTemperature()
  • uint16_t getRawHumidity()

Note these functions have no equivalent in the DHTNew library (yet).

Integer offset

To set the decimal part of the offset the following two functions are added.

  • uint16_t setDecimalOffsetHumidity(int offset)
  • uint16_t setDecimalOffsetTemperature(int offset)

An offset of setDecimalOffsetTemperature(15); means +1.5 °C

Note these functions have no equivalent in the DHTNew library (yet).

Future

  • Keep in sync with DHTNEW.
  • Test more
Similar Resources

ROS1 and ROS2 messages for event based image sensors

ROS package with array messages for event based cameras This package has definitions for messages created by event based sensors. The events are kept

Feb 22, 2022

Codes to use terrarium sensors for SEPA 2021

SEPA Codes to use terrarium sensors for SEPA 2021 For temperature sensor: Install Arduino IDE Go to sketch - Include libraries - Manage libraries an

Jan 10, 2022

A ros package for robust odometry and mapping using LiDAR with aid of different sensors

W-LOAM A ros package for robust odometry and mapping using LiDAR with aid of different sensors Demo Video https://www.bilibili.com/video/BV1Fy4y1L7kZ?

Nov 2, 2022

An easy to build CO2 Monitor/Meter with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.

An easy to build CO2 Monitor/Meter with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.

CO2-Gadget An easy to build CO2 Monitor/Meter with cell phone App for real time visualization and charting of air data, datalogger, a variety of commu

Dec 17, 2022

Project to create a teensy based gamecube controller with hall effect sensors, snapback filtering, and notch calibration

Project to create a teensy based gamecube controller with hall effect sensors, snapback filtering, and notch calibration

PhobGCC Gamecube controller motherboard using a teensy as the microcontroller. Aim is to make an accessible and consistent controller. Has the option

Dec 31, 2022

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor

Sensirion Mass Flow Sensor Arduino library, modified from MyElectrons and Nabilphysics Arduino repositories for SFM3300 Digital Mass Flow Sensor. When the sensor data gets stuck, the library has a hard reset function to ensure that it is read continuously.

Apr 11, 2022

A Fingerprint Door Lock using a microprocessor named Arduino UNO and programming through Arduino IDE

A Fingerprint Door Lock using a microprocessor named Arduino UNO and programming through Arduino IDE

INSTRUCTIONS - The codes for the Fingerprint Door lock are present in the Code For Fingerprint Door Lock folder The instructions of how to operate the

Mar 3, 2022

Arduino M-BUS Master node for Arduino MKR M-BUS Shield

 Arduino M-BUS Master node for Arduino MKR M-BUS Shield

Arduino M-BUS Master node for Arduino MKR M-BUS Shield This software will read out a M-BUS device connected to an Arduino MKR board equipped with our

Nov 30, 2022

Internet of things created using arduino IoT cloud, consisting of esp and arduino boards

Internet of things created using arduino IoT cloud, consisting of esp and arduino boards. Goal of the project is to create a 3D printed RFID protected (with PIN) lock, including surveillance.

Sep 1, 2022
Comments
  • Get decimal part of reading

    Get decimal part of reading

    For humidity, I could live with an integer values (the datasheet claims it has no greater repeatability than 1% anyway, though it probably depends also on the RH range we are looking at. Haven't extensively tested this sensor). It would still be nice to have a less jumpy response in some application.

    I feel it is a bit unfortunate there is no way to get the decimal part of the reading as should be able to get it until 0.2 degC precise (I know, i am complaining about a few bytes because floats but don't want to give up a decimal).

    I'm having a couple of other sensors in my project and am using all integer math. For the other sensors I use two bytes per reading (one for the integer and one for the decimal part).

    I don't know how DHTint could best do it and keep the api similar as in DHTnew. Maybe a separate read method, or option to the read method?

    Then again. Since you are thinking about tenth of degree offsets in issue #2 , maybe it makes sense to add a "scale" method to say we want everything in tenth of degree?

  • Improve offset

    Improve offset

    now the offset is in whole degrees, if offset would be in tenth of degrees, and the rounding would be postponed till the call of temperature() it would be possible to increase the accuracy of the calibration process.

Related tags
Arduino library for the SHT2x series temperature and humidity sensors including SHT20, 21, 25.

SHT2x Arduino library for the SHT2x and HTU2x temperature and humidity sensors. Description The SHT2x family of sensors should work up to 400 KHz I2C.

Dec 7, 2022
Several Proteus projects using Arduino Boards and sensors, these were parts of IoT course homework #1.

1. Print Print your name on virtual terminal using one of the Arduino family microcontrollers. 2. Highway Based on the position of the car in highway,

Nov 3, 2021
A C++11 large integer library with effective high performance, simplistic in nature and also clean in the eyes.

BigIntegerCPP BigIntegerCPP is a C++11 port of large integer library used in CryptoLib4Pascal. It allows mostly parsing of numbers as strings in diffe

Dec 22, 2022
MyOwnBricks - A library for building your own sensors and devices compatible with the modern LEGO PoweredUp system.
MyOwnBricks - A library for building your own sensors and devices compatible with the modern LEGO PoweredUp system.

English version (See at the end for the French version) MyOwnBricks MyOwnBricks is a library for building your own sensors and devices compatible with

Sep 26, 2022
Faster Non-Integer Sample Rate Conversion
Faster Non-Integer Sample Rate Conversion

Non-Integer Sample Rate Conversion This repository contains a comparison of sample-rate conversion (SRC) algorithms, with an emphasis on performance f

Jul 5, 2022
Identify I2C devices from a database of the most popular I2C sensors and other devices

I2C Detective Identify I2C devices from a database of the most popular I2C sensors and other devices. For more information see http://www.technoblogy.

Nov 29, 2022
A guide and set of tools for working with TinyML powered Audio Sensors
A guide and set of tools for working with TinyML powered Audio Sensors

Audio Sensor Toolkit This is a guide on how to build an Audio Sensor using Machine Learning, and helpful tools. Audio Sensor Guide Audio Tools Acceler

Sep 21, 2022
Common Sensor API for the BMA2 family of sensors

BMA2 Sensor API Sensor overview The BMA2 is a triaxial, low-g acceleration sensor with digital output. An ASIC in the sensor converts the output of a

Dec 5, 2022
A hacky e-ink display for Home Assistant sensors
A hacky e-ink display for Home Assistant sensors

This is a hacky PlatformIO project in which Home Assistant data is displayed in an e-ink display. Useful Links Display Hardware on Tindie Official Git

Sep 21, 2022
Linux HWMON sensors driver for ASUS motherboards to get sensor readings from the embedded controller

asus-wmi-ec-sensors Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller Many ASUS motherboards do not publis

Aug 30, 2022