Ardumotive Arduino Greek Playground
  • Home
    • About us
    • License
  • Arduino
    • Tutorials
    • Workshop
  • Raspberry Pi
  • DIY 3D Printer
  • News
    • Events >
      • Unboxing & Review
    • Blog
The 1st Arduino Playground in Greece - Open Source Hardware

Arduino 3D Printed Digital Thermometer with DHT-22 Sensor

Available Languages
Picture
Picture

Introduction 

Published date: 18/6/2017
Picture
Σε αυτόν τον οδηγό θα σας δείξουμε πως να φτιάξετε και εσείς το δικό σας ψηφιακό θερμόμετρο με το Arduino Pro Mini board χρησιμοποιώντας τον αισθητήρα θερμοκρασίας και υγρασίας DHT-22. 
​
Παρακάτω θα βρείτε επίσης και τα σχέδια για τον 3D εκτυπωτή.
To DHT-22 (γνωστό και ως AM2302) είναι ένα αισθητήριο που χρησιμοποιείτε για την εύρεση της σχετικής υγρασίας και θερμοκρασίας στον χώρο.

Το DHT-22 είναι ένας βασικός, χαμηλού κόστους, αισθητήρας για την εύρεση υγρασίας και θερμοκρασίας στον χώρο. Στο εσωτερικό του κρύβει έναν αισθητήρα υγρασίας και ένα θερμίστορ (μεταβλητή αντίσταση που η τιμή της αλλάζει σε σχέση με την θερμοκρασία) 'διαβάζοντας' έτσι τον αέρα που το περιβάλει. 

Τεχνικές αναφορές:
  • Τροφοδοσία : 3-5V
  • Μέγιστο ρεύμα: 2.5mA
  • Υγρασία: 0-100%, 2-5% ακρίβεια
  • θερμοκρασία: -40 to 80°C, ±0.5°C ακρίβεια
​

Τα υλικά που θα χρειαστούμε

Για την κατασκευή αυτή θα χρειαστείτε:
  • Arduino Pro Mini (5V)​​
  • Nokia 5110 display (pcb version)
  • DHT-22
  • On/off κουμπί (με διάμετρο οπής Ø12.5mm)
  • USB καλώδιο για την τροφοδοσία
  • TTL to USB Arduino board to program it​
Επίσης θα χρειαστείτε βίδες 4x 3mm και κόλα.

3D εκτύπωση

Picture
Picture
Εδώ μπορείτε να κατεβάσετε τα 3D αρχεία .stl . here.  

Το κύκλωμα

Η συνδεσμολογία είναι αρκετά απλή, ακολουθήστε τα παρακάτω βήματα:

DHT-22:
  • Vcc στο Pin Vcc του Arduino Pro mini Vcc (ή 5V)
  • GNG στο GND
  • Αναλογικό σήμα στο Pin 10 του Arduino 

LCD Οθόνη
  • Vcc στο Pin Vcc του Arduino Pro mini Vcc (ή 5V)
  • GND στο GND του Arduino Pro mini 
  • CS στο Pin 4 του Arduino 
  • RST στο Pin 3 του Arduino 
  • DC στο Pin 5 του Arduino 
  • DN στο Pin 6 του Arduino 
  • SCLK στο Pin 7 του Arduino 
  • BL στο Vcc - 5V

USB Καλώδιο:
Κόψτε το καλώδιο και βρείτε τα + και  - καλώδια με την βοήθεια ενός βολτόμετρου ή πολύμετρου. Αμέσως μετά κάντε την σύνδεση :
+ καλώδιο στο Κουμπί και από εκεί στο Pin Vcc του  t Arduino Pro Mini 
- καλώδιο στο GND του Arduino Pro mini 


Ο κώδικας

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* Arduino 3D printed Digital Thermometer
   using nokia 5110 screen and DHT-22 sensor
   Ver. 1.0 / Date:21/5/2017 */

//Include libraries
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>      //for graphics
#include <Adafruit_PCD8544.h>  //for Nokia 5110 lcd 
#include <dht.h>
dht DHT;
//Constants
#define DHT22_PIN 10     // DHT 22  (AM2302) - what pin we're connected to



//Init Display (SCLK, DIN, D/C, CS, RST)
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);

//Variables
int hum;  //Stores humidity value
int temp; //Stores temperature value
int maxTemp=0;
int minTemp=100;
int maxHum=00;
int minHum=100;

void setup() {

  Wire.begin();
  display.begin();
  display.setContrast(45);
  //Print a welcome message in startup for 6sec.//////////
  display.clearDisplay();   // clears the screen and buffer
  display.setTextColor(BLACK);
  display.setCursor(0,2);
  display.print("  ARDUMOTIVE  ");
  display.setCursor(0,13);
  display.print(" ArduinoBased ");
  display.setCursor(0,23);
  display.print("    Digital   ");
  display.setCursor(0,33);
  display.print("  Thermometer ");  
  display.display(); // show splashscreen
  delay(3000);
  /////////////////////////////////////////////////////////
  display.clearDisplay();   // clears the screen and buffer
}

void loop() {
  
  int chk = DHT.read22(DHT22_PIN);
  //Read data and store it to variables hum and temp
  hum = DHT.humidity;
  temp= DHT.temperature;

  if (temp>maxTemp){
    maxTemp=temp;
  }
  if (temp<minTemp){
    minTemp=temp;
  }
  if (hum>maxHum){
    if (hum==100){
      maxHum=99;
    }
    else{
      maxHum=hum; 
    }
  }
  if (hum<minHum){
    if (hum==100){
     minHum=99; 
    }
    else{
      minHum=hum;
    }
  }
  
  display.clearDisplay();   // clears the screen and buffer
  display.setCursor(0,0);
  display.setTextSize(1);
  display.println("   HUMIDITY  ");
  display.println("-------------");
  display.print("MAX ");
  display.print(maxHum);
  display.print(" MIN ");
  display.println(minHum);
  display.print("   ");
  display.setTextSize(3);
  display.print(hum);
  display.setTextSize(2);
  display.print("%");  
  display.display();
  
  delay(5000);
  display.clearDisplay();   // clears the screen and buffer
  display.setCursor(0,0);
   display.setTextSize(1);
  display.println(" TEMPERATURE ");
  display.println("-------------");
  display.print("MAX ");
  display.print(maxTemp);
  display.print(" MIN ");
  display.println(minTemp);
  display.print("  ");
  display.setTextSize(3);
  display.print(temp);
  display.setTextSize(2);
  display.print("oC");  
  display.display();
  delay(5000);
}
Κατεβάστε τον κώδικα απ' εδώ και ανοίξτε το αρχείο με το Arduino IDE. Μέσα θα βρείτε όλες τις απαραίτητες βιβλιοθήκες.
digital_thermometer_3dprinted.zip
File Size: 304 kb
File Type: zip
Download File

​Συγχαρητήρια!  ​​

Picture
Picture
Τέλεια! Μόλις ολοκληρώσατε άλλον έναν οδηγό του Ardumotive.com!

Περιμένω φωτογραφίες και σχόλια παρακάτω! ​
Picture

Search Engine

Picture

Licence 

Picture

Help us to grow up!

Picture


Donate us
About us
License
Cookies policy

Visit the biggest Arduino Shop in Greece!

Picture
find us on dwrean.net
find us on Codebender
find us on Instructables
Developed and designed by Vasilakis Michalis Copyright © 2013 Ardumotive All Rights Reserved
All trademarks referenced herein are properties of their
Powered by Create your own unique website with customizable templates.
Design by DivTag Templates
Ardumotive Arduino Greek Playground