Minecraft Glowing Furnace Clock W/Arduino Nano
by Dangerously Explosive in Circuits > Clocks
2264 Views, 18 Favorites, 0 Comments
Minecraft Glowing Furnace Clock W/Arduino Nano
We've all seen the glowing ore cube lamps, right? Unfortunately, ore is no good if you can't smelt it to make ingots. And since ore cubes are a somewhat overused idea, I thought I'd modify it a bit and make a Furnace style clock that glows. To make it even more unique, I decided to add an alarm, a digital temperature and humidity sensor, and a photoresistor to auto-dim the LCD I used as a display.
To do this we will use an Arduino Nano. This cuts out the cost of a larger Arduino board, although you could still use a bigger Arduino if you wanted more functions, say capacitative touch activation, flickering effects, and the like. However, I plan on keeping this one fairly simple and cheap so that anyone with a breadboard and soldering iron can build it.
Gathering Materials
Creative mode doesn't apply to the map called 'Life', so you will need to go mining to find the right items to build this.
In your Inventory, you will need:
1x Arduino Nano (or clone)
1x LDR (photoresistor)
2x 220 Ohm resistor
1x 16x2 LCD with back-light
1x DHT11 digital Temp and Humidity sensor
1x DS3231 RTC Module (You can use others, but this one won't lose time where most others will)
7x Yellow or Orange LEDs (clear lens are best)
1x 10k Potentiometer
Jumper wires (male-female and female-female, mostly)
1x Mini breadboard
1x Switch
1x barrel jack
1x Buzzer
1x Pushbutton
Cardboard
Printer paper
Paint:
- Grey
- Black
- White
-Red
-Yellow
Tools:
Hot Glue Gun
Scissors
Paint brush
Soldering Iron
Exacto Knife
Cardboard Cutouts
The first thing you need to do is cut out the cardboard frame. I really wanted to make this 3D printed, but I don't have a printer of my own and I hate outsourcing my fabrication.
Step 1: Measure and cut 6 squares of cardboard, each about 6" tall.
Step 2: Glue 5 squares together to form a cube with one side missing. The missing side will be the front.
Step 3: Print out the Furnace template attached below.
Step 4: Tape the template on top of the last piece of cardboard, and cut out the areas inside the dotted lines.
Step 5: Remove the template when you are finished.
Step 6: Cut a square piece of printer paper 4 inches tall. Glue/tape it to the back of the front of the furnace.
Step 7: Using a ruler or masking tape as a guide, paint the exterior of the cube to look like a furnace from Minecraft. It can be as perfect as you like. I didn't bother with making the exact pixel arrangement, and mine looks fine.
Step 8: Use the red, yellow, and orange paint to paint the paper on the front of the furnace.
Last step: Let everything dry completely.
You are now ready to move on to the next step!
Downloads
Circuit Time!
This circuit is really really complex to explain with words, so I will simply attach the schematic I made in Fritzing as a picture. If you encounter any problems, please comment and I will try to help you as best I can.
Note: I suggest using wires at least 6 inches long to avoid having those 'Gosh-Darn-It' moments when your wires are too short.
Final Assembly and Programming
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.
Results and Final Thoughts
I thought this project turned out rather well. About halfway through is when I decided to make it a clock, using the circuit from one I built previously. One thing I discovered: Avoid making your own crimped connectors whenever possible. They are an absolute pain and introduce glitches, loose connections, and other random problems where they really shouldn't exist.
I still really think the furnace would be better with a 3D printer, as that would make a design with interior access to change and adjust the settings more feasible.
Please vote if you liked this project, and feel free to comment with questions and improvements (e.g. putting a dimmer on the LEDs).
As always, these are the projects of Dangerously Explosive, his lifelong mission: "to boldly build what you want to build, and more."
You can find the rest of my projects here. (Look out for more Minecraft themed projects, I am currently working on designs for 2 more and am almost done with a custom Torch, which I will publish shortly.)