Giter Site home page Giter Site logo

raphael-boichot / a-penultimate-arduino-dht22-recorder Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 10.46 MB

An Arduino based DHT22 recorder with RTC and SD card support and with some Matlab stuff to plot the data

License: GNU General Public License v3.0

C++ 73.77% MATLAB 26.23%

a-penultimate-arduino-dht22-recorder's Introduction

Yet another Arduino DHT22 recorder on SD card (but with RTC)

Why ?

Because I was not satisfied by other similar projects for my particular need: recording temperature and humidity every minute for very long periods of time (typically weeks) in remote parts of buildings. This device is so intended to be lost somewhere and survive power failures without much consequences on data stored. I've used it for recording two consecutive weeks of temperature and humidity without touching it, it worked. Current draw is very minimal and it can run for days on a powerbank. The whole price with 5 custom PCBs included should stay below 20โ‚ฌ shipped to your door direct through the silky road.

How to use it ?

  • Install the Arduino IDE, the Adafruit DHT library and the Adafruit RTClib library from the IDE library manager;
  • Flash the DHT22_SD_Set_RTC.ino code to the device, it will set the date/time of the RTC module from the computer. The green LED stays ON if everything is OK;
  • Then flash the DHT22_SD_Recorder.ino code. It immediately starts recording. You can follow what happens on the Arduino IDE serial or use Read_from_Serial.m to plot temperature and humidity in live from Matlab;
  • As long as green LED flashes only, everything is OK with the 3 modules. Any failure of one of them and the red LED flashes instead;
  • SD card can be removed at any time to plot data, the device does not care, no need to power cycle it to plug the SD card back;
  • When finished, data can be plotted from the SD card with Read_from_txt_file.m, the Matlab code provided, but any other code would work as the data format is very simple;

Parts needed

  • An Arduino Uno, the cheaper the better;
  • A generic microSD shield or any other size if you do not use the custom PCB provided;
  • A DHT22 module with everything integrated. The red AM2302 stuff is the one I used;
  • A DS3231 RTC module. The extra chip on this board is just an independant 4kB flash chip that is not in use in this application (no idea what's the purpose in fact). It is recommended to remove the resistor like in this image used for the janky charging circuit as the backup battery is not meant to be charged in fact;
  • Some male pin headers. The clearance with the Arduino Uno shield is tight, but triming the pins below the PCB is enough to go with regular 11 mm pin headers for the short board. The long one requires 15 mm pins headers at least;
  • If you want to make the board entirely dismountable, use some female regular pin headers to connect the SD, RTC and DHT22 modules instead of soldering them directly;
  • A Custom PCB if you want to stay on the neat side. Order at JLCPCB, it's cheap and custom clean for Eu citizens contrary to PCBWay or OSHPark;
  • 2 regular 5 mm LEDs (red and green) and two through hole resistors of about 220 Ohms (low value = high brighness).

To what I understand, pinout for SD card must be strict on Arduino and only Chip Select pin (CS) can be moved, so refer to the pinout given in the project. If you use an SD shield with included prototyping board, CS may differ (it's generally 4, 6 or 10 by default and sometimes even not indicated on the board...).

My own experience is that the backup battery has to be considered relevant for short accidental power loss only. The DS3231 RTC module is very seriously drifting if powered by its battery only (something like 90 minutes per day with a fresh battery !). It is meant to be continuously powered by VCC pin to keep on time, which is written nowhere...

The pinout (yes I like Powerpoint)

The PCBs that come with the project (Two flavors)

The device as you will get it (Short version)

The PCB comes with its json sources that can be edited with EasyEDA std Edition if you want to customize it. It comes very pretty in blue I think. Two models of PCB are proposed: a short that do not hide the RESET button and a long with a deported RESET button. They both work the same.

Example of plot output

Funfact

This device proved that the energy saving closure of a certain French university during two consecutive winters was only a political display since the heating remained on full blast during the entire closure. Thanks to this crap device I made new friends !

a-penultimate-arduino-dht22-recorder's People

Contributors

raphael-boichot avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.