Skip to main content

How to build and Arduino based Clock prototype with a mini OLED display

A simple DIY project to create a Digital Clock prototype.

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)
Note: once the time is set on the RTC chip, the onboard battery will ensure that the time keeps updating when there is no more power to the breadboard.

Arduino Libraries required


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
(Note: the Digital pins are on the USB connector side of the board)

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

Popular posts from this blog

Breadboard Power Supply Module 3.3V 5V MB102

Breadboard Power Supply Module 3.3V 5V MB102 Solderless Product page: http://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20160425070700&SearchText=Breadboard+Power+Supply

Nokia5110 LCD with Arduino Review and Example Sketch

Video Overview: Important note: Arduino Pro Mini 3.3V was used for this Demo which makes it easier to interface with the LCD. If you're using a 5V Arduino, make sure to follow the guide below. Sketch and Guide: https://learn.sparkfun.com/tutorials/graphic-lcd-hookup-guide#example-code-2-drawing-bitmaps Wiring: DIG LINES: RST (any digital pin) CE (any digital pin) DC (any digital pin) SPI LINES: DIN - MOSI Pin 11 (S)CLK - Pin 13 Power Lines: VCC 3.3V recommended GND Back-light (Recommend 5V for blue LEDs, or any PWM/Digial Pin to control brightness) Product Page: www.aliexpress.com/item/1pcs-New-84-48-84x84-LCD-Module-White-backlight-adapter-PCB-for-Nokia-5110-for-Arduino/1898293552.html Note:  I would recommend the LCD with a White back-light as opposed to the blue one. The product page above leads to the blue backlight version.