# Tiny Calendar and Clock Featuring Moon Phase in a LED Matrix

2,862

25

1

Hello, all !!

This is my project with more features than my Binary Clock that you can see also on my another Instructables.

Main concept is apply into a simple LED Matrix Display a lot of features including a complete monthly calendar with day, month, year, number of the week and the Moon Phase !!

The number of week, the month and the year are shown in binary notation on the LED Matrix.

Hardware features are the RTC (Real Time Clock), rotary encoder, LED Matrix with MAX7219 controller and Arduino UNO in the charge of everything.

See the VIDEO.

I hope you enjoy it !!

LAGSILVA

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: Bill of Material

What you need is:

• Kit of Jumpers Macho-Macho e Fêmea-Fêmea

• 01 Protoboard (small size)

• 01 Encoder Decoder Module KY-040 Rotational with push button

• 01 Real Time Clock Module RTC DS1307

• 01 LED Matrix Display 8x8 Module with MAX7219

• 01 Arduino UNO R3

## Step 2: Assembly

The assembly is very easy due the modular components.

Just follow the schematics and take care with wiring positioning.

Print the template, cut and put it over the LED display according with position shown in the picture.

## Step 3: Programming

The first challenge of this project was to find out the way to put all information on a single display 8x8 and also manage all the LEDs to achieve the results of blinking, turn on or turn off on right position.

First of all, I did a model on an Excel Worksheet simulating this operation with a Visual Basic program.

After that, I moved to the logic related to Arduino, thinking about the libraries that would help me, mainly related to timers that support the paging between the calendar display and the digital clock display and also related to the timer to read the encoder.

My option to use the encoder is due to its accuracy. I tried to use potentiometers, but the result was not satisfactory because the signal analogic is not constant causing variation in the calculation of results to be shown in the display.

For the timer, I decided to apply the TimerOne library to read the encoder each 1 milisecond and the results were really very good.

To manage the paging feature, I used the functions while() and millis() to control the loop of calendar during 30 seconds and then the display is cleaned to present the digital clock.

These are the libraries that you need the put in your Arduino IDE:

• Time.h - Library with date and time functions
• LedControl.h - Library to control the LED Matrix
• Wire.h - Library to support the DS130RTC
• DS130RTC,h - Library of Real Time Clock
• Bounce2.h - Library to read the button of encoder
• TimerOne.h - Library of the Timer 1 to read the encoder.

Related to Lunar Phases calculation, my option was to apply an algorithm that would be good enough but without the scientific precision of an extensive calculation method.

## Step 4: Operation

The operation of Binary Calendar is really simple and the control is done only using the encoder.

First you need to select what feature you will use such as the day, month or year using the push button of encoder.

The feature selected will be highlighted with a short blink of its LED.

Years are on the range between 2000 until 2063.

To read the week, month and year, you need to add all numbers shown with the LEDS that were turned on.

To read the monthly calendar, take the Sunday blinking as reference and then you start to count the remaining days of the week like Monday, Tuesday and so on.

## Step 5: Conclusion

This project envolved many diferent subjects to be developed and for me were interesting tasks that help me to learn more about programming, hardware and science too.

I hope you have liked it !!

Best regards,

LAGSILVA

23.Mar.2015

## Recommendations

• ### Internet of Things Class

21,627 Enrolled