Semifinal Assembly:

Step 1: After you finish the circuit, glue/mount/stick the breadboard in the middle of the furnace, with the lights facing forwards.

Step 2: Cut slots for and insert the button, Temp and Humidity sensor, switch, Power jack, and USB port on the Nano, gluing each in place. (except maybe the Nano; I didn't due to various issues I was having.

Step 3: Cut a small divet at the center of the side of the top panel and glue the photoresistor in place. (see the pics if you are confused)

Step 4: Glue the LCD in the top slot of the front of the furnace, with a slight upwards tilt.

Programming:

Step 1: Download the libraries attached here, and install them to your IDE.

Note: Because the DS3231 and DS1307 RTC modules are so similar, the libraries for each are usually interchangeable. The only real difference is that the DS3231 is much more accurate and won't lose time.

Step 2: Upload the RealTimeClockDS1307_Test example code to set the proper time on your RTC module through the Serial Monitor.

Step 3: Upload the furnaceClock code.

#include <LiquidCrystal.h> #include <Wire.h> #include <RealTimeClockDS1307.h> #include <SimpleDHT.h> LiquidCrystal LCD(3, 4, 5, 6, 7, 8); int pinDHT11 = 9; SimpleDHT11 dht11; int buzzerPin = 11; int lightPin = 10; int buttonPin = 2; int buttonState; int lastButtonState = HIGH; unsigned long lastDebounceTime = 0; unsigned long debounceDelay = 50; int brightVal; int bright = 200; int button = 0; int state = 0; int frequency1 = 1000; int HOUR, MINUT, SECOND; const int alarmHour = 7; const int alarmMinute = 45; const int resetMinute = 46; void readLight() { int lightVal = analogRead(A3); if (lightVal <= 1){ lightVal = 2; }; if (lightVal >= 127.5){ lightVal = 127; }; bright = lightVal * 2; } void getState(){ int reading = digitalRead(buttonPin); if (reading != lastButtonState) { lastDebounceTime = millis(); } if ((millis() - lastDebounceTime) > debounceDelay) { if (reading != buttonState) { buttonState = reading; if (buttonState == LOW) { if (state == 1){ state = 0; } else { state = 1; }; } } } lastButtonState = reading; } void setup () { pinMode(A3, INPUT); pinMode(13, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); pinMode(6, OUTPUT); pinMode(7, OUTPUT); pinMode(8, OUTPUT); pinMode(10, OUTPUT); pinMode(11, OUTPUT); Serial.begin(9600); LCD.begin(16, 2); Wire.begin(); pinMode(2, INPUT_PULLUP); } void loop() { RTC.readClock(); HOUR = RTC.getHours(); MINUT = RTC.getMinutes(); SECOND = RTC.getSeconds(); // Serial.println(MINUT); readLight(); getState(); /* Serial. print("light"); Serial.println(bright); Serial.print("State"); Serial.println(state); */ analogWrite(lightPin, bright); if (HOUR <= 9) { LCD.setCursor(4, 0); LCD.print("0"); LCD.setCursor(5, 0); LCD.print(HOUR); } else { LCD.setCursor(4, 0); LCD.print(HOUR); }; LCD.setCursor(6, 0); LCD.print(":"); if (MINUT <= 9) { LCD.setCursor(7, 0); LCD.print("0"); LCD.setCursor(8, 0); LCD.print(MINUT); } else { LCD.setCursor(7, 0); LCD.print(MINUT); }; LCD.setCursor(9, 0); LCD.print(":"); if (SECOND <= 9) { LCD.setCursor(10, 0); LCD.print("0"); LCD.setCursor(11, 0); LCD.print(SECOND); } else { LCD.setCursor(10, 0); LCD.print(SECOND); }; // LCD.setCursor(0, 0); // LCD.print(" "); //temp & humid byte temperature = 0; byte humidity = 0; if (dht11.read(pinDHT11, &temperature, &humidity, NULL)) { // LCD.setCursor(0, 1); //LCD.print("Read DHT11 failed."); return; }; LCD.setCursor(4, 1); LCD.print((int)temperature); LCD.setCursor(6, 1); LCD.print("C"); LCD.setCursor(9, 1); LCD.print((int)humidity); LCD.setCursor(11, 1); LCD.print("%"); LCD.setCursor(0, 1); delay(400); getState(); //alarm section if (state == 0){ //tell me if alarm is on LCD.setCursor(14, 1); LCD.print("al"); } else{ LCD.setCursor(14, 1); LCD.print(" "); }; if (!RTC.isPM()) { //only works in morning LCD.setCursor(12, 0); LCD.print("am"); //tell me when morning if (HOUR == alarmHour && MINUT == alarmMinute && state == 0) { //when the time is right, go off digitalWrite(13, HIGH); tone(buzzerPin, frequency1); delay(500); //pulsing beep noTone(buzzerPin); } else { digitalWrite(13, LOW); //otherwise turn off noTone(buzzerPin); }; if (HOUR == alarmHour && MINUT == resetMinute && state == 1){ //reset state afterwards (so it goes off tomorrow) state = 0; digitalWrite(13, HIGH); delay(100); digitalWrite(13, LOW); //blink to tell me reset occurred }; } else { LCD.setCursor(12, 0); LCD.print("pm"); //if it ain't mornin', it gotta be post-mornin', if ya know what I mean. }; }

Step 4: Carefully adjust the Potentiometer until you can see the text on the LCD at an acceptable contrast.

Step 5: Test to see that the Temp, Humidity, and Light sensor all work properly. The Temp and Humidity will appear as values on the LCD, and the Photoresistor will cause the LCD to dim in low light environments (so you can sleep at night).

Final Assembly:

Step 1: Glue the front of the furnace in place.

(Optional) Step 2: Cut a slot in the backside for access to the circuitry.

And Done! Enjoy your Furnace Clock!

Please Comment if you have issues with the code.