Mirko Pavleski
Published © GPL3+

DIY Arduino 3D Printed gear Clock

In fact, it is not a very precise clock, but a visually interesting device. It consists of a set of gears powered by a small stepper motor.

BeginnerFull instructions provided3,335
DIY Arduino 3D Printed gear Clock

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
ULN2003 Stepper modor driver board
×1
28BYJ-48 Small Stepper Motor
×1
PCBgogo Custom PCB
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free

Story

Read more

Custom parts and enclosures

3D parts

Schematics

Schematic

Code

Arduino Code

C/C++
#include <Stepper.h>
//souce code for 28BYJ-48 (ULN2003)

#define MOTOR_1   (8)
#define MOTOR_2   (9)
#define MOTOR_3   (10)
#define MOTOR_4   (11)
const int NUMBER_OF_STEPS =64;
const int RPM = 10;
const float GEAR_RATIO = 64;
int csec;

Stepper stepper(NUMBER_OF_STEPS,MOTOR_1, MOTOR_3, MOTOR_2, MOTOR_4);
void setup() {
  stepper.setSpeed(RPM*GEAR_RATIO/2.0); // speed for movement
  csec=0;
}

void loop() {
  int  sstep;
  delay(1000-1000/RPM-2);  // delay for 1 min, 1000ms-60000ms/RPM/60-proc.time
  if(csec%7==0){
    sstep=37;
  }else{
    sstep=36;
  }
  stepper.step(sstep);
  stopMotor();
  csec++;
  if(csec==60) csec=0;
}

void stopMotor() {
  digitalWrite(MOTOR_1, LOW);
  digitalWrite(MOTOR_2, LOW);
  digitalWrite(MOTOR_3, LOW);
  digitalWrite(MOTOR_4, LOW);
}

Credits

Mirko Pavleski

Mirko Pavleski

116 projects • 1163 followers

Comments