Intro: $5 Arduino Clock
Create an Arduino compatible clock inexpensively. This project is fun and easy to duplicate. It can be put into the enclosure or project of choice. I used a plastic electronics parts kit box. The base parts cost $5, but it also needs micro USB power. The sketch coded for 24 hour time.
Step 1: Parts
Step 2: Digispark Support
Digispark needs a USB driver installed. Instructions for Windows 7 - 10
Add Arduino IDE board support for Digispark
Go to the "File" menu and select "Preferences"
In the box labeled “Additional Boards Manager URLs” enter: http://digistump.com/package_digistump_index.json and click OK
Go to the “Tools” menu and then the “Board” select “Boards Manager” and then from the type drop down select “Contributed”: Select the “Digistump AVR Boards” package and click the “Install” button.
After install completes, close the “Boards Manager” window and select “Digispark (Default - 16.5mhz)” from the Tools→Boards menu.
Step 3: Program With Arduino IDE
Go to Sketch, Include Library, then Manage Libraries. Make sure the following libraries are installed: tm1637 (Grove 4-Digit Display)
Open the sketch file and set the correct time on the rtc.adjust line. The numbers are: (Year, Month, Day, Hour, Minute, Second)
These Digispark style development boards work differently than Arduino boards. You will first hit upload then plug in the board when prompted. They are programmable for a few seconds after plugged in.
Step 4: Assemble Parts
You will need to do some light soldering to install the pin headers onto the modules.
- Put CR2032 battery in in DS3231 RTC module
- Connect jumper wire from P0 to SDA on the RTC module
- Then connect P2 to SCL on RTC module
- Connect P3 to CLK on TM1637 Display module
- Then P4 to DIO on Display module
- Connect VCC and Ground to RTC module then VCC and Ground on other side to the display module.
All done! You can power it now. You can use a micro USB AC adapter or battery pack.