DIY Apple Clock

DIY Apple Clock

OK so thereā€™s no such thing as the Apple Clock.
However, you can make your own retro-style bubble display clock in an Apple earbuds case.

Iā€™m going to show you how to do that just sit tight.

Youā€™re going to need some parts for this project.

  • 1x PCB (not shown)
  • 1x Apple earbuds case (not shown)
  • 1x 74HC595 shift register
  • 1x ATTiny44 or ATTiny84
  • 1x 16MHz crystal oscillator
  • 1x 1N4001 or 4007 power diode
  • 1x USB B mini port
  • 1x Li-Ion rechargeable battery
  • 1x bubble display
  • These two bags of nuts and bolts I bought at RadioShack and I donā€™t know what to call it but its in the pictures
  • 2x pushbutton switches
  • 3x 10 kohm resistors
  • 4x 330 ohm resistors

Youā€™ll of course need some tools like a soldering iron, home PCB manufacturing tools, saw or dremel, drill, screwdrivers, etc.

If you just want to build the project this step isnā€™t too necessary. Iā€™m going to be talking about how the code and hardware work.

Iā€™m going to go through the code line by line now šŸ˜€

The ATtiny24, 44, 84 series only has 1 external interrupt (INT0) [Page 48 of the datasheet]. This is the interrupt that we are most familiar with using on the Arduino. You can simply use this interrupt by saying ā€œattachInterrupt()ā€

While it only had 1 interrupt, I wanted to have two buttons on my clock: one button to increase the time and another to decrease the time. Looking back on the datasheet, the ATtiny has two Pin Change Interrupt ports: PCINT0 and PCINT1 [Page 48].

The difference between External Interrupts and Pin Change Interrupts is that an External Interrupt has its own ISR (interrupt service routine). PCINTerrupts share one ISR for all pins on one port. This means that with Pin Change Interrupts we can make any pin be an interrupt, but then we have to go through the trouble of determining which pin caused the interrupt on the port.

Here are two really good articles to read. This is how I learned:

Each of these variables determines what number is displayed on each of the four digits on the bubble display.
I declared them volatile because they will be changed in the interrupt routines.
Setting them to 0 means when I turn on my clock, the count will start at 00:00 (12:00 AM).

Physical pins 8(A5), 9(A4), and 10(A3) will be used with the 74HC595 shift register.
The shift register will allow us to control segments a, b, c, d, e, f, g, and dp with pins Q0, Q1, Q2, Q3, Q4, Q5, Q6, and Q7 respectively.
To display each digit, we will be multiplexing.

For more detail: DIY Apple Clock


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *