Skip to content

ziaul55/DHT22_Logger

Repository files navigation

Introduction

  • In this project we have sensed temperature and humidity data using DHT22 and stored the sensed data into InfluxDB and then visualized in Grafana.
  • We built this project by implementing CoAP protocol with txThings framework using Python 2.

Requirements

Hardware

  • Adafruit DHT22 sensor (+ ribbon cables)
  • Raspberry Pi 3 (+ power adapter)
  • Monitor

Software

  • Python 2
  • InfluxDB (time series database)
  • Grafana (visualization tool)
  • Browser

Configuration

DHT22 sensor read data through the BCM pin 23. Configurations are available at docker_compose.yml and src/config.py files.

How to run

# clone the project
git clone https://github.com/ziaul55/dht22_logger.git

# install docker and docker-compose
sudo su
chmod +x shell-scripts/install_docker_compose.sh
sh shell-scripts/install_docker_compose.sh
exit
[reboot the Raspberry Pi]

# build the project
cd dht22_logger
docker-compose build

# run the project
# stop influxdb and grafana-server if these are already running 
# into the Raspberry Pi with 'sudo service influxdb stop' and 
# 'sudo grafana-server stop'
docker-compose up

Visualization

  • We built this project with a single Raspberry Pi 3 having IP address 192.168.1.125. Visualization is done with Grafana which is running on port 3000. So, complete URL for Grafana will be 192.168.1.125:3000.
  • Now browse 192.168.1.125:3000 URL and provide the username and password as admin admin. Reset password or skip.
  • Press on Gear icon to add the Data Source. In this project, we configured our influxdb credentials on docker-compose.yml file. So, add an InfluxDB Data Source with following configuration
  * HTTP URL: 192.168.1.125:8086
  * InfluxDB Details
    - Database: strawberry_factory
    - User: influxDBuser
    - Password: influxDBpass
  * Press on 'Save & Test'
  • Press on + icon to add a new panel. Add temperature and humidity with two separate queries and save the panel.

About

Sensing temperature and humidity data using DHT22, store sensed data into InfluxDB: and visualizing in Grafana.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors