Breadboard Based Weather Station

Hey everybody,

I would like to show you a setup for a basic yet functional weather station on a breadboard. It is a great project for beginnners (as myself).

It uses an Arduino UNO, a BMP085 temperature/pressure sensor on a GY-65 breakout board, a TinyRTC (DS1307 chip), a photoresistor and a HD44780 16x2 LCD display. (I am going to put a DHT 22 humidity sensor in the unused space in the middle of the breadboard.)

It shows temperature, atmospheric pressure, time, date and brightness on the LCD.

This is the code, please feel free to use and modify it:

/*
Breadboard Weather Station
Roman Bock 
Amberg, Germany
June 2014
*/

#include <Wire.h>
#include <LiquidCrystal.h>
#include <Adafruit_BMP085.h>
#include <RTClib.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

Adafruit_BMP085 bmp;
RTC_DS1307 RTC;
  
void setup() {
  Wire.begin();
  lcd.begin(16, 2);
  bmp.begin();
  RTC.begin();
  //RTC.adjust(DateTime(__DATE__, __TIME__));  
 //uncomment above line to set the RTC, upload sketch, then re-comment it and upload sketch again
  delay(10);
  }
  
void loop() 
{
    lcd.print("Temperature:");
    lcd.setCursor(0, 1);
    lcd.print(bmp.readTemperature());
    lcd.print(" ");
    lcd.print((char)223);
    lcd.print("C");    
    delay(2000);
    lcd.clear();
    
    lcd.print("Brightness:");
    lcd.setCursor(0, 1);
    lcd.print(analogRead(A0));
    lcd.print("/1023");    
    delay(2000);
    lcd.clear();
    
    lcd.print("Atm. Pressure:");
    lcd.setCursor(0, 1);
    lcd.print(((bmp.readPressure() + 4050)/100.0),1); // Replace 4050 with what number gives you most accurate results.
    lcd.print(" hPa"); 
    delay(2000);
    lcd.clear();
 
    DateTime now = RTC.now();
    
    lcd.print("Date:");
    lcd.setCursor(0, 1);
    lcd.print(now.year(), DEC);
    lcd.print('/');
    lcd.print(now.month(), DEC);
    lcd.print('/');
    lcd.print(now.day(), DEC);
    delay(2000);
    lcd.clear();
    
    lcd.print("Time:");
    lcd.setCursor(0, 1);
    lcd.print(now.hour(), DEC);
    lcd.print(':');
    lcd.print(now.minute(), DEC);
    lcd.print(':');
    lcd.print(now.second(), DEC);
    delay(2000);
    lcd.clear();
}

However, the project still has some flaws:

-The pressure readings are not adjusted according to the temperature. This makes them rather inaccurate.
-Time is only shown as a snapshot, the seconds do not count on on the display while it shows the time.
-Date and Time are shown without initial zeros (7:8:9 instead of 07:08:09).
-Brightness is shown in fractions of 1023 instead of Lux.
-Most important, I would like it to show sunrise and sunset times, but so far have not figured out how to do this.

Any suggestions, especially on the sunrise/sunset part, would be much appreciated!

Sadly, I do not have the time to describe the project in detail, with schematics, resistor values etc. Please refer primarily to the picture. If there are any questions left, please feel free to ask!