A simple DIY project to create a Digital Clock prototype.
See my video below for how the final result looks and works.
(Note: the Digital pins are on the USB connector side of the board)
See my video below for how the final result looks and works.
What you need
- Arduino Uno R3 or equivalent (link)
- Real Time Clock Module (DS3231) or equivalent 6pin/I2C version (link)
- OLED 0.96 inch display module SPI/7pin version (link)
- Breadboard with male jumper cables
- Power supply - 2400mAh power bank for roughly 3 days running)
Arduino Libraries required
- u8glib https://github.com/olikraus/u8glib
- WireLib (built into Arduino IDE)
Wiring Reference
Connect the RTC Module to Arduino Board
- 32K - no connection
- SQW - no connection
- SCL - Pin A5
- SDA - Pin A4
- VCC - 5V
- GND - Ground
(Note: the A/Analogue pins are on the side that the POWER connector lies on the board)
Connect the OLED Module to Arduino board
- GND - Ground
- VCC - 5V
- D0 - Digital Pin 13
- D1 - Digital Pin 11
- RES - Digital Pin 8
- DC - Digital Pin 9
- CS - Digital Pin 10
Code Snippet:
Important: there is a commented line of code in the 'setup' function that sets the time on the clock. This code must be run once to set the time. Then you must comment that line again and upload the code again as you wont need to set the time again.
Comments
Post a Comment