John Bradnam
Published © GPL3+

Holo Clock

3D printed and run by a single stepper motor, this unique clock's hands float in a hollow frame.

AdvancedFull instructions provided12 hours1,225
Holo Clock

Things used in this project

Hardware components

Stepper Motor
Digilent Stepper Motor
×1
Microchip ATtiny1614 Microprocessor
×1
Tactile Switch, SPST
Tactile Switch, SPST
×1
AO3400 N-Channel MOSFET
×4
78M05 5V SMD regulator
×1
LED 0805 SMD
×1
Passive Components
4 x 1K 0805 resistors, 4 x 10K 0805 resistors, 1 x 330 ohm 0805 resistor, 1 x 0.1uF 0805 ceramic capacitor, 1 x 100uF/10V 6032 Tantalum capacitor
×1
DC Power Connector, Socket
DC Power Connector, Socket
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

STL files

Additional and updated STL files
Other STL files can be downloaded from https://www.thingiverse.com/thing:570797/files

Clock assembly instructions

Schematics

Schematic

PCB

Eagle Files

Schematic & PCB in Eagle format

Code

HoloClockV3.ino

C/C++
/**
 * HOLO CLOCK V3
 * 
 * 2022-19-02 John Bradnam (jbrad2089@gmail.com)
 * 
 * ATTiny1614 Pins mapped to Ardunio Pins
 *
 *             +--------+
 *         VCC + 1   14 + GND
 * (SS)  0 PA4 + 2   13 + PA3 10 (SCK)
 *       1 PA5 + 3   12 + PA2 9  (MISO)
 * (DAC) 2 PA6 + 4   11 + PA1 8  (MOSI)
 *       3 PA7 + 5   10 + PA0 11 (UPDI)
 * (RXD) 4 PB3 + 6    9 + PB0 7  (SCL)
 * (TXD) 5 PB2 + 7    8 + PB1 6  (SDA)
 *             +--------+
 *             
 * BOARD: ATtiny1614/1604/814/804/414/404/214/204
 * Chip: ATtiny1614
 * Clock Speed: 20MHz
 * Programmer: jtag2updi (megaTinyCore)
 *
 * Teeth in big gear 178
 * Teeth in small gear 20
 * Gear ratio 8.9
 * Motor steps per revolution 400 (28BYJ-48 is 2037.8864)
*/

#include <Stepper.h>

#define IN_1 0        //PA4
#define IN_2 1        //PA5
#define IN_3 2        //PA6
#define IN_4 3        //PA7
#define SWITCH_PIN 4  //PB3
#define LED_PIN 5     //PB2

#define GEAR_RATIO 8.9
#define NUMBER_OF_STEPS 2038
//STEPS_PER_MINUTE (int)((GEAR_RATIO * NUMBER_OF_STEPS) / 60) = 302.303
//Add extra step every 3 seconds
//Add extra step every 10 seconds
#define STEPS_PER_MINUTE 302
#define BLINK_DELAY 1000
#define MOVE_DELAY 60000

Stepper myStepper(NUMBER_OF_STEPS, IN_1, IN_3, IN_2, IN_4);

bool ledState = false;
unsigned long previousMillis = 0;
unsigned long previousMillisMotor = 0;
int moveCount = 0;

//---------------------------------------------------------------------
//Set up clock
void setup() 
{
  myStepper.setSpeed(15); // speed for movement
  pinMode(SWITCH_PIN,INPUT_PULLUP);
  pinMode(LED_PIN, OUTPUT);
}

//---------------------------------------------------------------------
//Main program loop
void loop() 
{
  blink();
  if (digitalRead(SWITCH_PIN) == LOW)
  {
    digitalWrite(LED_PIN,HIGH);
    //myStepper.step(60 * STEPS_PER_MINUTE + 20);
    myStepper.step(STEPS_PER_MINUTE + (((moveCount % 3) == 2) ? 1 : 0) + (((moveCount % 10) == 9) ? 1 : 0));
    motorOff();
    moveCount = (moveCount + 1) % 60;
    digitalWrite(LED_PIN,HIGH);
    //delay(2000);
    delay(10);
  }
  else
  {
    unsigned long currentMillisMotor = millis();
    if ((unsigned long)(currentMillisMotor - previousMillisMotor) >= MOVE_DELAY) 
    {
      myStepper.step(STEPS_PER_MINUTE + (((moveCount % 3) == 2) ? 1 : 0) + (((moveCount % 10) == 9) ? 1 : 0));
      motorOff();
      moveCount = (moveCount + 1) % 60;
      previousMillisMotor = currentMillisMotor;
    }
  }
}

//---------------------------------------------------------------------
//Turn off the motor

void motorOff()
{
  digitalWrite(IN_1, LOW);
  digitalWrite(IN_2, LOW);
  digitalWrite(IN_3, LOW);
  digitalWrite(IN_4, LOW);
}

//---------------------------------------------------------------------
//Blink the LED

void blink()
{
  unsigned long currentMillis = millis();
  if ((unsigned long)(currentMillis - previousMillis) >= BLINK_DELAY) 
  {
    ledState = !ledState; 
    digitalWrite(LED_PIN, ledState); 

    previousMillis = currentMillis;
  } 
}

Credits

John Bradnam

John Bradnam

141 projects β€’ 167 followers
Thanks to ekaggrat.

Comments