Arduino Mario Clock




Introduction: Arduino Mario Clock

About: Programmer, Arduino Fan

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.


- 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, ...

Step 1: Make a Desktop Clock Box

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.

Step 2: Make the Circuit

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.

Step 3: Arduino Code

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.


- 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.


- 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).

Be the First to Share


    • Fandom Contest

      Fandom Contest
    • Halloween Contest

      Halloween Contest
    • Microcontroller Contest

      Microcontroller Contest



    what pin does the 5110 led go to is it just grounded or does it have a pin to flash or turn off etc


    Thanks,its all done now,it works a treat,now all you need to do is try a nice oled display.


    7 years ago

    The pin outs are in the sketch file.
    Pins 8, 12, 13 have used for menu buttons. The fourth button is a direct reset signal which not depend on sketch code.
    For the sensors it's better to use their manual. I'm sorry that I couldn't draw circuit when the project was done.


    do i tie buttons to ground or 3v sink or source? the speaker doesnt matter that works eather way round,i love how arduino auto does that.


    7 years ago

    I used the IDE 1.5.2 to compile the project.
    Copy any lib to libraries folder of Arduino installation path.
    Libs with "" (double quote) are located in sketch folder.
    Narcoleptic is not necessary, if you have any problem with it. It's just to save battery.
    Have fun


    7 years ago on Step 3

    the only way i get it to compile is to delete this line -



    7 years ago on Step 3

    Hi now i get narcoleptic was not declaired in this scope,also where does the util.h file go?do i put it in the mario sketch folder?we will get there,its best to try sort it so other people dont get the same problem,thanks


    Reply 7 years ago on Step 3

    Also witch ide version was this compiled on?


    Great project,although half the librarys are missing,I cant get it to compile,theres endless errors,

    Narcoleptic gives error,ive added a library for it but its probly the wrong one,would be great if you could attach all files so we can comile the code,Ive built the clock, its a shame to wast it due to code,thanks for any help.


    Reply 7 years ago on Introduction

    ohhhh great stuff,thanks,cant wait to see it running, happy man now,the clock is for my little lad.