2021-01-29 12:31:58 +01:00
|
|
|
|
|
|
|
[![Arduino CI](https://github.com/RobTillaart/DHT_Simulator/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
2021-12-16 17:29:43 +01:00
|
|
|
[![Arduino-lint](https://github.com/RobTillaart/DHT_Simulator/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/DHT_Simulator/actions/workflows/arduino-lint.yml)
|
|
|
|
[![JSON check](https://github.com/RobTillaart/DHT_Simulator/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/DHT_Simulator/actions/workflows/jsoncheck.yml)
|
2023-10-24 15:56:14 +02:00
|
|
|
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/DHT_Simulator.svg)](https://github.com/RobTillaart/DHT_Simulator/issues)
|
|
|
|
|
2021-01-29 12:31:58 +01:00
|
|
|
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/DHT_Simulator/blob/master/LICENSE)
|
|
|
|
[![GitHub release](https://img.shields.io/github/release/RobTillaart/DHT_Simulator.svg?maxAge=3600)](https://github.com/RobTillaart/DHT_Simulator/releases)
|
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
```
|
|
|
|
when converted to a simulation class
|
|
|
|
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/DHT_Simulator.svg)](https://registry.platformio.org/libraries/robtillaart/DHT_Simulator)
|
|
|
|
```
|
2021-12-16 17:29:43 +01:00
|
|
|
|
2021-01-29 12:31:58 +01:00
|
|
|
# DHT_Simulator
|
|
|
|
|
|
|
|
Arduino sketch to simulate a DHT22 temperature and humidity sensor.
|
|
|
|
|
2021-12-16 17:29:43 +01:00
|
|
|
|
2021-01-29 12:31:58 +01:00
|
|
|
## Description
|
|
|
|
|
|
|
|
The DHT22 is an often used sensor and many libraries are written for it
|
|
|
|
including my own https://github.com/RobTillaart/DHTNew library.
|
|
|
|
To better understand the protocol and to be able to debug my library
|
|
|
|
I wrote a simulator for the DHT sensors in 2014.
|
|
|
|
|
|
|
|
The simulator can be used to test applications to that use a DHT sensor,
|
|
|
|
e.g. to get high alarm temp or whatever.
|
|
|
|
|
2021-12-16 17:29:43 +01:00
|
|
|
Currently the code uses two analogue ports to get a value for temperature
|
|
|
|
and humidity. Just connect two potentiometers to play and simulate increase and
|
2021-01-29 12:31:58 +01:00
|
|
|
decrease of the temperature and humidity.
|
|
|
|
|
2021-12-16 17:29:43 +01:00
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
The simulator is not tested extensively so please report bugs.
|
2022-11-01 21:08:53 +01:00
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
#### Related
|
2021-01-29 12:31:58 +01:00
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
- https://github.com/RobTillaart/DHTNew
|
|
|
|
- https://github.com/RobTillaart/DHTStable
|
|
|
|
- https://github.com/RobTillaart/DHT_Simulator
|
2021-01-29 12:31:58 +01:00
|
|
|
|
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
## Operation
|
2021-01-29 12:31:58 +01:00
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
- adjust the pins in the head of the program to meet your setup
|
|
|
|
- compile, connect, run
|
2021-01-29 12:31:58 +01:00
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
And have fun.
|
2021-01-29 12:31:58 +01:00
|
|
|
|
2021-12-16 17:29:43 +01:00
|
|
|
|
2021-01-29 12:31:58 +01:00
|
|
|
## Future
|
|
|
|
|
|
|
|
1) use the simulator-core as a bridge to other sensors.
|
|
|
|
Idea is to use the code of the simulator in combination with a
|
2021-12-16 17:29:43 +01:00
|
|
|
Sensirion or two separate sensors (DS18B20 + ? ) to provide an
|
2021-01-29 12:31:58 +01:00
|
|
|
accurate temperature and humidity. These could then be readable
|
|
|
|
with any DHT library with the performance of a DHT (~ 5ms).
|
|
|
|
(when time permits)
|
|
|
|
|
|
|
|
2) implement a recorder mode, to be able to replay a certain
|
2021-12-16 17:29:43 +01:00
|
|
|
behaviour time after time.
|
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
3) make a SHT Simulator class?
|
2021-01-29 12:31:58 +01:00
|
|
|
|
|
|
|
|
2023-10-24 15:56:14 +02:00
|
|
|
## Support
|
|
|
|
|
|
|
|
If you appreciate my libraries, you can support the development and maintenance.
|
|
|
|
Improve the quality of the libraries by providing issues and Pull Requests, or
|
|
|
|
donate through PayPal or GitHub sponsors.
|
|
|
|
|
|
|
|
Thank you,
|
2021-01-29 12:31:58 +01:00
|
|
|
|