Duncan Birdsall
Published © GPL3+

Temperature And Humidity Notifier

It is a notifier with temperature and humidity sensor in it. The LED screen will show the temperature and humidity at present.

AdvancedShowcase (no instructions)10 hours388
Temperature And Humidity Notifier

Things used in this project

Hardware components

Photon
Particle Photon
×1
Breadboard (generic)
Breadboard (generic)
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
for power
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1

Software apps and online services

Maker service
IFTTT Maker service

Story

Read more

Code

Untitled file

C/C++
#include <Adafruit_DHT.h>
#include "application.h"
#include "LiquidCrystal/LiquidCrystal.h"
#include "Adafruit_DHT/Adafruit_DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
int HT = 1;
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(D0, D1, A2, D3, D4, D5);
void setup() {
  lcd.begin(16,2);
  dht.begin();
  Particle.function("T-H", ReadHT);
  lcd.print("Temp:          F");
}
void loop() {
    if (HT == 1) {
    lcd.setCursor(10,0);
    lcd.print(dht.getTempFarenheit());
    }
    if (HT == 0) {
    lcd.setCursor(10,0);
    lcd.print(dht.getHumidity());
    }
}
int ReadHT(String command) {
    if (command=="Temperature") {
        lcd.setCursor(0,0);
        lcd.print("Temp:          F");
        HT = 1;
    }else
    if (command=="Humidity") {
        lcd.setCursor(0,0);
        lcd.print("Humidity:      %");
        HT = 0;
    }else
    {
        return -1;
    }
}

Credits

Duncan Birdsall

Duncan Birdsall

1 project • 0 followers
Contact

Comments

Add projectSign up / Login