A Project In Weather Analysis

FEATURES

Project Overview


Equipment Checklsit

  • Arduino Nano v3 (clone)
  • Mini USB Cable

Aims

Project Aims.

Future

Where to now?

Features


LCD

LCD for viewing data with customised graphics/characters and screen refresh every 30 seconds.

BME280 Sensor

BME280 Temp, Humidity & Barometer used for collecting the data to display.

Battery or Mains

5v mains or lithium 18650 with charging board, solar power unit could be added.

Real Time Clock

DS3231 for keeping accurate time, even when no power is available, also required for displaying time.

PIR Sensor

Infra red sensor, which activates screen when an object passes the sensor for intelligent battery control.

LED Temp Warning

2 LED which illuminate if the temp goes over a specific value or drops below a set value.

Code


Arduino Code

/* YourDuino.com Example Software Sketch DHT11 Humidity and Temperature Sensor test Displayed on I2C LCD Display Credits: Rob Tillaart http://arduino-info.wikispaces.com/PROJECT-Temp-Humidity-Display terry@yourduino.com Combined with: Mark Johnson's code http://uControlIt.tv December 2012 License: GNU General Public License Modified by Timofte Andrei ( http://timofteandreidiy.wordpress.com ) January 2014 Modified by Aaron Whitney ( http://www.nanonix.net ) June 2016 */ /*-----( Import needed libraries )-----*/ #include #include #include #include #include //const char* zile[] = // { "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}; //days of the week const char* Mon[] = {"Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov" }; //months of the week byte thermometer[8] = //icon for thermometer { B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110, }; byte waterdrop[8] = //icon for water droplet { B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110 }; byte tlOkt[8] = //Oktopus Top Left { 0B11111, 0B11111, 0B11111, 0B11111, 0B11110, 0B11110, 0B11011, 0B11100, }; byte tclOkt[8] = //Oktopus Top Centre Left { 0B11111, 0B11100, 0B11000, 0B01010, 0B11000, 0B01000, 0B00100, 0B10000, }; byte tcrOkt[8] = //Oktopus Top Centre Right { 0B11111, 0B00111, 0B00011, 0B01010, 0B00011, 0B00010, 0B00100, 0B00001, }; byte trOkt[8] = //Oktopus Top Right { B11111, B11111, B11111, B11111, B01111, B01111, B11011, B00111, }; byte blOkt[8] = //Oktopus Bottom Left { B11111, B11110, B11101, B11101, B11101, B11110, B11111, B11111, }; byte bclOkt[8] = //Oktopus Bottom Centre Left { B00100, B01001, B00011, B11011, B01101, B11101, B11011, B11101, }; byte bcrOkt[8] = //Oktopus Bottom Centre Right { B00100, B10010, B11000, B11011, B10110, B10111, B11011, B10111, }; byte brOkt[8] = //Oktopus Bottom Right { B11111, B01111, B10111, B10111, B10111, B01111, B11111, B11111, }; /*-----( Declare objects )-----*/ // set the LCD address to 0x3f for a 16 chars 2 line display // Set the pins on the I2C chip used for LCD connections: // addr, en,rw,rs,d4,d5,d6,d7,bl,blpol LiquidCrystal_I2C lcd(0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address dht11 DHT11; /*-----( Declare Constants, Pin Numbers )-----*/ #define DHT11PIN 2 //dht11 signal pin connected to D2 #define DS1307_ADDRESS 0x57 void setup() /*----( SETUP: RUNS ONCE )----*/ { Wire.begin(); lcd.begin(16,2); // initialize the lcd for 16 chars 2 lines, turn on backlight lcd.backlight(); lcd.createChar(1,tlOkt); lcd.createChar(2,tclOkt); lcd.createChar(3,tcrOkt); lcd.createChar(4,trOkt); lcd.createChar(5,blOkt); lcd.createChar(6,bclOkt); lcd.createChar(7,bcrOkt); lcd.createChar(8,brOkt); lcd.clear(); lcd.setCursor(0, 0); lcd.write(1); lcd.write(2); lcd.write(3); lcd.write(4); lcd.setCursor(0, 1); lcd.write(5); lcd.write(6); lcd.write(7); lcd.write(8); lcd.setCursor(6,0); //Start at character 8 on line 0 lcd.print("NANONIX"); lcd.setCursor(4,1); //Start at character 8 on line 0 lcd.print("OKTI WEATHER"); delay(4000); lcd.clear(); lcd.setCursor(0,1); //Start at character 1 on line 1 lcd.print("www.nanonix.com"); delay(4000); lcd.clear(); // part code from http://tronixstuff.wordpress.com/ Wire.beginTransmission(0x57); Wire.write(0x07); // move pointer to SQW address Wire.write(0x10); // sends 0x10 (hex) 00010000 (binary) to control register - turns on square wave Wire.endTransmission(); // end part code from http://tronixstuff.wordpress.com/ setSyncProvider(RTC.get); }/*--(end setup )---*/ void loop() /*----( LOOP: RUNS CONSTANTLY )----*/ { readTemp(); //displaying temperature readTime(); //displaying date and time } void readTemp() { int chk = DHT11.read(DHT11PIN); lcd.createChar(1,thermometer); lcd.createChar(2,waterdrop); lcd.setCursor(1, 1); lcd.write(1); lcd.setCursor(3, 1); lcd.print((float)DHT11.temperature, 0); lcd.setCursor(5, 1); lcd.print((char)223); //degree sign lcd.print("C"); lcd.setCursor(9, 1); lcd.write(2); lcd.setCursor(11, 1); lcd.print((float)DHT11.humidity, 0); lcd.print("%"); delay(30000); lcd.clear(); lcd.createChar(1,tlOkt); lcd.createChar(2,tclOkt); lcd.createChar(3,tcrOkt); lcd.createChar(4,trOkt); lcd.createChar(5,blOkt); lcd.createChar(6,bclOkt); lcd.createChar(7,bcrOkt); lcd.createChar(8,brOkt); lcd.setCursor(0, 0); lcd.write(1); lcd.write(2); lcd.write(3); lcd.write(4); lcd.setCursor(0, 1); lcd.write(5); lcd.write(6); lcd.write(7); lcd.write(8); lcd.setCursor(6,0); //Start at character 8 on line 0 lcd.print("NANONIX"); lcd.setCursor(4,1); //Start at character 8 on line 0 lcd.print("OKTI WEATHER"); delay(5000); lcd.clear(); } void readTime() { tmElements_t tm; (RTC.read(tm)); lcd.setCursor(0, 0); dispTime(tm.Hour); lcd.print(":"); dispTime(tm.Minute); lcd.setCursor(7,0); dispTime(tm.Day); lcd.print(" "); lcd.print(tm.Month[Mon]); lcd.print(" "); lcd.print(tmYearToCalendar(tm.Year)-2000); // lcd.setCursor(12,1); // this code is used for displaying day of the week // lcd.print(tm.Wday[zile-2]); //it's disabled because for some reason it doesn't work on i2c display } void dispTime(int number) { //this adds a 0 before single digit numbers if (number >= 0 && number < 10) { lcd.write('0'); } lcd.print(number); } /* ( THE END ) */

DATA


Okti Fritzing Diagram

Fritzing Diagram

Early Breadboard Prototype

 

Sunrise | Sunset

Team Members


Aaron Whitney

Developer & Designer

Contact Details


I am Social

Check me out on social media

Quick Contact

Email : admin@nanonix.net

Attributions