Arduino Mario Clock
![Arduino Mario Clock](/proxy/?url=https://content.instructables.com/F07/SJ9N/HYY8KDPA/F07SJ9NHYY8KDPA.jpg&filename=Arduino Mario Clock)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FKD/KS3I/HYJY64J7/FKDKS3IHYJY64J7.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FLN/O0IH/HYJY64IR/FLNO0IHHYJY64IR.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FTB/MIOW/HYJY64JU/FTBMIOWHYJY64JU.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FJA/JEA2/HYJY64J6/FJAJEA2HYJY64J6.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FRZ/UUOL/HYJY64HG/FRZUUOLHYJY64HG.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
It's a musical desktop alarm clock with a theme of well-known MARIO game. Actually I like to wake up with the Mario theme instead of my cellphone. Also the LEDs (color tubes) blinking make it more beautiful.
Features:
- Display of Time, Date, Temperature
- Mario image and music on startup theme and alarm time
- Adjustable time, date, alarm
Used parts:
- 1x Arduino ProMini 5v
- 1x Nokia 5110 LCD
- 1x DS1307 module (real-time clock)
- 1x Speaker/Buzzer
- 1x DS18b20 Temp sensor
- 1x Electronic board
- 4x LED (different colors)
- 4x Push button
- 4x Resistor 220 (for LEDs)
- 5x Resistor 1K (4x for buttons, 1x for Temp sensor)
- 1x Hot glue stick (tube) which cut into 4 pieces 2x 6cm and 2x 8cm
- 8x metal rings and cylinders (I used Ferrite beads salvaged from my old printers)
- 1x Plastic box
- 5x mini battery, or 4x AA battery
- Tools: Hot-glue gun, soldering iron, pliers, some wires, ...
Make a Desktop Clock Box
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FHS/K578/HYJY64IG/FHSK578HYJY64IG.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FW7/HY14/HYJY64FT/FW7HY14HYJY64FT.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۴.jpg](/proxy/?url=https://content.instructables.com/FEL/UNUP/HYJY64LH/FELUNUPHYJY64LH.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۴.jpg)
If you want to use it as a real desktop clock, so find a pretty box. I've used the soldering iron to melt the box and making holes for pushh buttons and the lcd.
Make the Circuit
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FAX/0U0K/HYJY64IY/FAX0U0KHYJY64IY.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FX4/GQ13/HYJY64H3/FX4GQ13HYJY64H3.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۴.jpg](/proxy/?url=https://content.instructables.com/F52/OLB4/HYJY64KK/F52OLB4HYJY64KK.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۴.jpg)
Attach the push buttons and resistors on the board. Fit the board in the box via hot-glue. Connect the LEDs under the glue tubes. Use the solderig iron to make a propper hole inside the tubes. Fit the parts like as temp sensor, rtc, batteries and others inside the box via hot-glue.
Arduino Code
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FLN/O0IH/HYJY64IR/FLNO0IHHYJY64IR.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FAM/WM2K/HYJY64IF/FAMWM2KHYJY64IF.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
![۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg](/proxy/?url=https://content.instructables.com/FJA/JEA2/HYJY64J6/FJAJEA2HYJY64J6.jpg&filename=۱۷ ه‍. ش.،‏ ۱۳:۴۳.jpg)
I've made a few images (Mario splash screen, Mario jump, Temperature icon, Alarm icon) with MSPaint which can be converted to binary data via LCDAssistant. All the coed is attached.
I think the code is enough plain and simple but, the following code hints can be helpful.
Classes:
- NokiaFa5110: Nokia LCD driver class.
- Util: Bitmap images.
- DS1307RTC, Time: Used for date time module.
- Wire, OneWire, DallasTemperature: Used for temperature sensor.
- EEPROM, avr/pgmspace: To use the EEPROM memory.
- Narcoleptic: A handy class to lower the battery usage via stand by delays.
Hints:
- A main switch-case and state variable used to handle the different menus and program states.
- The EEPROM memory has used to save the adjusted date and time variables.
- I've tried to partially refresh the LCD when the time, date or temp will change. The LCD is most battery consuming part.
- Narcoleptic class make it easy to lower the Arduino board battery usage, when there is no job to do (delay).