Ashphiar Raihan
Published

Personal Weather Station

Personal weather station using Arduino Pro Mini and Nokia 5110 display.

IntermediateShowcase (no instructions)5,058
Personal Weather Station

Things used in this project

Hardware components

Arduino Pro Mini 328 - 5V/16MHz
SparkFun Arduino Pro Mini 328 - 5V/16MHz
×1
Graphic LCD 84x48 - Nokia 5110
×1
DHT11 Temperature & Humidity Sensor (4 pins)
DHT11 Temperature & Humidity Sensor (4 pins)
×1
Photo resistor
Photo resistor
×1
Li-Ion Battery 1000mAh
Li-Ion Battery 1000mAh
×1
DC-DC boost module 0.9V ~ 5V
×1
TP4056 5 Volt Mini USB Charger Module
×1

Story

Read more

Code

TEMPERATURE_STATION.ino

Arduino
Just download the (LCD5110_Graph.h) and (dht.h) LIBRARY from internet and include the LIBRARY with Arduino ide and upload the code.
//TEMPERATURE STATION
//MADE BY RUMMAN ISLAM BD
//DATE:24.12.16

#include <LCD5110_Graph.h>                                      //LIBRARY
#include<dht.h>
#define TS 7                                                //TEMPERATURE SENSOR PIN NUMBER

dht DHT;
LCD5110 myGLCD(8,9,10,12,11);
//      LCD PIN NUMBER       
//      SCK  - Pin 8
//      MOSI - Pin 9
//      DC   - Pin 10
//      RST  - Pin 12
//      CS   - Pin 11

extern unsigned char SmallFont[];                               //FRONT SIZE
extern unsigned char TinyFont[];

char lightString [4];     
char tempString [5];
char humiString [4];

String Ttr;
String str;                                                //INITILIZE STRING 
String htr;

int lightIntensity ;                                       //INITILIZE VALUE
int Tempsensor;

void setup()                        
{
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
  randomSeed(analogRead(7));
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop()
{
   
  digitalWrite(LED_BUILTIN, HIGH);                          //FOR BLINKING LED
  delay(100);                       
  digitalWrite(LED_BUILTIN, LOW);    
  delay(100); 
  
  Tempsensor=DHT.read11(TS);                                    // 1ST SENSOR
  int t=DHT.temperature;                                        // 2ND SENSOR   
  int h=DHT.humidity;                                           // 3RD SENSOR 
  lightIntensity = analogRead(A0);   
  lightIntensity = map(lightIntensity, 0, 1000, 0, 100);       //CONVERT THE VALUE INTO %
  delay(1000);



  Ttr =String(t)+"*c";                                //FOR CONVERT THE VALUE   
  htr =String(h)+"%"; 
  Ttr.toCharArray(tempString,5);
  htr.toCharArray(humiString,4);
  str = String(lightIntensity)+"%";
  str.toCharArray(lightString,4);                     //FOR CONVERT THE VALUE  
  delay(1000);
  
  myGLCD.clrScr();
  myGLCD.update();
  myGLCD.setFont(TinyFont);
  myGLCD.print("**WEATHER STATION**",CENTER,0);
  myGLCD.print("MADE BY RUMMAN",CENTER,7);
  myGLCD.print("-------------------------",CENTER,12);
  myGLCD.setFont(SmallFont);
  myGLCD.print("CELCIOUS:",LEFT,18);                    // FOR PRINT IN SCREEN  
  myGLCD.print(tempString,RIGHT,18);
  myGLCD.setFont(TinyFont);
  myGLCD.print("------------------------",LEFT,25);
  myGLCD.setFont(SmallFont);
  myGLCD.print("HUMIDITY:",LEFT,29);
  myGLCD.print(humiString,RIGHT,29);
  myGLCD.setFont(TinyFont);
  myGLCD.print("------------------------",LEFT,36);
  myGLCD.setFont(SmallFont); 
  myGLCD.print("SUN:",LEFT,41);
  myGLCD.print(lightString,RIGHT,41);
  
 
  myGLCD.update();  
  delay(1000);
}

Credits

Ashphiar Raihan

Ashphiar Raihan

2 projects • 16 followers

Comments