Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Simple LED Analog Clock Idea

For The Popcorn

Well-Known Member
Most Helpful Member
As one of the members here struggles with an LED analog clock project, an idea for a simple LED clock design came to mind. This is somewhat similar to my servo Clock For Geeks idea. Usually, when you look at a wall clock, you don't need to know the exact time. "About" is close enough. On my servo clock, resolving quarter hours was easy but it could be read fairly accurately.

LEDs don't easily replicate the hands of an analog clock, at least without a multitude of them. Following the theme of my analog clock, an easy-to-understand "about" clock is pretty simple. A ring of 60 LEDs (60 to preserve the ability to display minutes, but 48 works better for this idea) displays not minutes, but hours. As the hours progress from noon to midnight, the ring is progressively illuminated (and repeated from midnight to noon). The ring of LEDs can be controlled by eight 74HC595 shift registers.

Inside the ring of 60 (or 48) LEDs are 12 LEDs to indicate the hour positions. These LEDs will always be illuminated, probably dimmer than the outer ring. To maintain flexibility, I would operate these 12 LEDs from two separate 74HC595s, with the enable input controlled by a pwm pin.

So why didn't I post that in the existing thread? That thread has reached 20 pages and the member is still lost in the woods. I didn't want to provide further distraction or have this idea buried in the weeds.

servo clock.jpg
Servo Clock - Yes. Yes It Does Indicate 4:20


noon.jpg
Noon

1-36.jpg
1:36

6-00.jpg
6:00

9-24.jpg
9:24
 
Last edited:
64 bit SR in one part, but not much other I/O left. Could do a muxed matrix to get
around that, that then would allow all the other analog and digital stuff on this part
to be used.

Part does have RTC in it....but non muxed I dont think enough I/O to add xtal....

1750463385686.png



Was done with simple Verilog code, could have been done just with schematic capture
in the tool.

Code:
//`#start header` -- edit after this line, do not edit this line
// ========================================
//
// Copyright YOUR COMPANY, THE YEAR
// All Rights Reserved
// UNPUBLISHED, LICENSED SOFTWARE.
//
// CONFIDENTIAL AND PROPRIETARY INFORMATION
// WHICH IS THE PROPERTY OF your company.
//
// ========================================
`include "cypress.v"
//`#end` -- edit above this line, do not edit this line
// Generated on 06/08/2021 at 10:16
// Component: Shift64
module Shift64 (
    output [63:0] dataout,
    output  serout,
    input   clkin,
    input   clrall,
    input   loadall,
    input   serin,
    input   setall
);
    parameter InitPatt = 0;

//`#start body` -- edit after this line, do not edit this line


//    wire [63:0]paraout64;
    reg  [63:0] sreg;                              // actual register

    assign dataout = sreg;
    assign serout = sreg[0];
   
    // reset and load are both syncronous
    always @ (posedge clkin )
   
    begin
   
        if (clrall == 1'b1)                         // clear / reset has precedence
   
            sreg <= 64'h0000000000000000;
       
        else
       
        if (setall == 1'b1)
       
            sreg <= 64'hFFFFFFFFFFFFFFFF;           // set shift reg to all 1's
       
        else
       
        if (loadall == 1'b1)                        // Load user preset/config data
       
            sreg <= InitPatt;
           
        else
       

            sreg <= { serin, sreg[63:1] };          // Do a one bit shift and take in SerIn bit
   
    end

//`#end` -- edit above this line, do not edit this line
endmodule
//`#start footer` -- edit after this line, do not edit this line
//`#end` -- edit above this line, do not edit this line
 
Last edited:
My preferred weapon of choice is Swordfish Basic and PIC18F-series chips. In fact, the servo clock was what got me started with microcontrollers.

The full version of Swordfish Basic has recently been made available free of charge by its developer. Swordfish is a fast compiled Basic supporting all PIC18F devices. tumbleweed is instrumental in keeping Swordfish up to date with the latest devices. His talents are greatly appreciated.

The suggestion to use 74HC595s comes from a project in the aforementioned thread by Beau Schwabe to make a large diameter analog clock/general purpose display from segments using cheap Chinese boards. He posted a couple amazing videos showing the '585s in action.

Beau Schwabe's MQTT Analog Clock / VU Meter / Multipurpose Display
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top