Introduction: RoboClock

An overly complicated, exceptionally loud, and fairly finicky robot clock to help you keep track of time! ⏰🦾🤖


Skills and Prerequisites

  • 3D Printing (familiar with a slicing software, like CURA, and the 3D printing process)
  • Arduino IDE (compile and upload sketch onto an Arduino)
  • Basic understanding of electrical circuits

Tools (to make your life easier)

  • 3D Printer (w/ print bed >= 100mm^3) (I used the Monoprice Select Mini)
  • Computer (w/ Windows or Linux and usb port)
  • Pliers
  • M3 & M4 Allen Keys
  • Soldering Iron (optional)
  • Multimeter (optional)

Total Cost (~ $150 and way too much of your time) (all prices in USD)

Electronics (~ $115)

  • 1 x Arduino MKR1000 Wifi ($36, w/ pre-soldered headers [if you don't want to worry about soldering])
  • 1 x 28BYJ (and the included ULN2003 Driver) ($12 for 5, great for other projects as well [like the EBA3])
  • 4 x MG90S Servo (metal gear version) (~ $24 pack of 8)
  • 1 x Pololu Micro Maestro (~ $16)
  • 1 x 3v -> 5v Level Shifter (~ $5.50 for 2 pack)
  • 1 x 5v ~3 Amp Power Supply (~ $10)
  • 1 x DC Female Breakout Barrel Jack (included with power supply)
  • 1 x Electronic bread board (prototype board)
  • Jumper wires (~ $10)

Hardware (~ $35)

  • 46 x Magnets (3x1mm) (~ $12 for 300)
  • 1 x 608zz Bearing
  • 1 x 4mm Outer Diameter, 3mm Inner Diameter brass rod
  • 1 x Small bottle of super glue
  • 1 x Wood plank / shelf (at least 24"x5")
  • 14 x Wood Screws (~3/4 inch)
  • Various M3 - M5 Nuts and Bolts (~ $14 for variety pack)
  • Various M3 - M5 Lock Nuts (optional)
  • Rubber bands (optional, for better grip)

For a more accurate / reliable chain consider adding sensors... (optional)

  • 2x Hall Effect Sensors (A3144) (~$8 for pack of 20)
  • 2x 0.1uF Capacitors
  • 2x 10k Resistors

Step 1: Order Everything

First step is to order all the electronics and hardware you don't have yet!

Once you're done ordering everything we can start printing! It'll probably take you longer to print everything than the 2-3 day delivery estimates.... haha, but seriously... there's a lot to print :)

Step 2: Print & Assemble the EEZYBotArm

Print and assemble the EEZYBotArm from Thingiverse by the amazingly talented daGHIZmo

  • Download the modified gripper assembly from the RoboClock Thingiverse
    • EBA_Right_Finger_Extended.stl
    • EBA_Left_Finger_Extended.stl
  • Slice 'em up with CURA (or your favorite slicer)...
  • Print everything
  • Assemble the arm following this instructable by daGHIZmo

Step 3: Print and Assemble Chain

  • Download the following files from the RoboClock Thingiverse
    • Chain_Link.stl
    • Chain_Link_Tray.stl
    • Chain_Bracket.stl
    • Chain_Spacer.stl
  • Slice 'em up with CURA (or your favorite slicer...)
  • Print 2 or 3 segments, assemble and check the tolerances of the parts
  • You want the main chain links to 'snap' into place (you'll probably need pliers)
  • You want the chain to be able to freely rotate, but not sag too much
  • Adjust the height of the Chain_Spacer.stl file until you reach the desired tolerances
  • Print a total of 18 segments
    • 36 Brackets
    • 18 Links
    • 18 Tray Links
    • 36 Spacers
  • Assemble each link, we need a total of 18 trays in our chain!
  • Place all of the magnets north side up, super glue in place with a small drop of glue

All credit for the original chain design goes to mlfraser

Step 4: Print Remaining Parts

Download and print the following parts from the RoboClock Thingiverse

  • 1 x 17 tooth sprocket and sand / smooth the teeth down a little
  • 1 x 12 tooth sprocket and sand / smooth the teeth down a little
  • 1 x Front motor housing
  • 1 x Rear chain tensioner
  • 1 x Rear chain standoff
  • 1 x Podium
  • 2 x Chain guide towers (only needed if your chain sags a little between the sprockets, you'll probably need to cut these down to the correct height)
  • 2 x Chain guide rails
  • 1 x Chain Sensor Housing ( optional )

Numbers (19 total)

  • 3 x Zeros (0)
  • 3 x Ones (1)
  • 2 x Twos (2)
  • 2 x Threes (3)
  • 2 x Fours (4)
  • 3 x Fives (5)
  • 1 x Six (6)
  • 1 x Seven (7)
  • 1 x Eight (8)
  • 1 x Nine (9)

Install magnets on Numbers

  • South side facing down (make sure they're attracted to the chain/tray magnets)
  • If the tray magnets are both north up and the numbers magnets are both south down then the number should 'snap' to the tray no matter the direction.

Install magnets on Podium

  • North side facing up (just like the chain trays) so the numbers are attracted to them.

Step 5: Assemble Components on Shelf / Platform

  • Locate the center of the shelf / platform you'll be mounting the clock to
  • Place the EEZYBotArm directly over the center and drive 3 wood screws into the shelf to hold it in place
  • Measure 6 inches from the Arm's center and place the front chain motor mount
  • Then measure an additional 6 1/4 inches from the front chain motor mount to place the rear chain platform
  • The rear chain platform is designed with a moveable sprocket so you can tighten the chain afterwards
  • Measure 4 inches from the Arm's center to the right and place the left side of the podium using double sided sticky tape (you might need to move it later)

Note: The red circles in the picture above should be the first holes you drill, then center the parts and mark the blue holes through the parts to make sure the holes match your 3D printed parts

Step 6: Install the Chain Mechanism (Part 1)

  • Install the front motor
  • Assemble the front 12 tooth sprocket
  • Install the sensor housing (optional, but recommended if you're comfortable with soldering)

Step 7: Install the Chain Mechanism (Part 2)

  • Assemble the rear chain tensioner
  • Assemble the rear 17 tooth sprocket

Step 8: Install the Chain Mechanism (Part 3)

  • Install the chain guide rails (cut down to proper length)
  • Pass the motor cables under the guide rail to hold them in place

Step 9: Install the Chain Mechanism (Part 4)

  • Install the chain
  • Tighten the front 12 tooth sprocket
  • Pull the rear 17 tooth sprocket until chain is taught and then tighten the nut to secure in place

Step 10: Wire Up the Electronics

Note: Use the Fritzing diagram as ground truth (photos are just for reference and some cable colors don't match)

Using jumper cables, wire up the circuit by making the following connections...

Arduino MKR1000 Power

  • 5v from power supply -> MKR1000 VIn
  • Ground from power supply -> MKR1000 GND

Level Shifter Power

  • 5v from power supply -> Level Shifter High Voltage (HV)
  • Ground from power supply -> Level Shifter High Ground
  • 3.3v from MKR1000 (Vcc) -> Level Shifter Low Voltage (LV)
  • Ground from power supply -> Level Shifter Low Ground

Micro Maestro Power

  • 5v from power supply -> Servo Power +
  • Ground from power supply -> Servo Power -
  • 5v from power supply -> Maestro VIN
  • Ground from power supply -> Maestro GND

ULN2003 Power

  • 5v from power supply -> ULN2003 VIn (+)
  • Ground from power supply -> ULN2003 GND (-)

Arduino MKR1000 -> Level Shifter

  • MKR1000 RX -> Level Shifter LV1
  • MKR1000 TX -> Level Shifter LV2

Level Shifter -> Micro Maestro

  • Level Shifter HV1 -> Pololu Maestro TX
  • Level Shifter HV2 -> Pololu Maestro RX

Micro Maestro -> Servos

  • Base Servo -> Maestro Servo 0
  • Horizontal Arm -> Maestro Servo 2
  • Vertical Arm -> Maestro Servo 3
  • Gripper -> Maestro Servo 5

Arduino MKR1000 -> ULN2003

  • MKR1000 GPIO D2 -> ULN2003 in1
  • MKR1000 GPIO D3 -> ULN2003 in2
  • MKR1000 GPIO D4 -> ULN2003 in3
  • MKR1000 GPIO D5 -> ULN2003 in4

Step 11: Chain Sensor Circuit (Optional)

If you've decided to use the hall effect sensors...

  • Recreate the above circuit on a breadboard
  • Attach sensor outputs to MKR1000 GPIO pins 6 & 7 (order doesn't matter)

Important: Before gluing the sensors into the housing, make sure you orient the sensors correctly relative to the magnets. You can use the DigitalRead example sketch in the Arduino IDE to ensure the sensor can sense the magnet before installing. Orientation matters!

  • Insert the hall effect sensors into the sensor housing and solder the ends to a 4 wire cable (v+, gnd, out1, out2)
  • The pinout is V+, GND, Output (left to right) when looking at the branded side of the sensor.

Note: The reason I chose to add these sensors is due to the chain and sprockets periodically binding causing the stepper motor to loose steps. Once this happens the software can't recover without a closed loop system. Adding the sensors lets the software know when a bind has occurred and attempts to fix it by driving the motor backwards for a bit, then proceeding forward again until the sensor trip. The closed loop system that these sensor create makes the chain / Inventory system much more reliable and robust. I strongly recommend adding the sensors if you're up for the additional work.

Step 12: Software (Pololu Maestro)

All files mentioned are available in the RoboClock GitHub Repository

  • If you've never worked with a Pololu Maestro before, I suggest checking out their introduction guide, it's a very informative and well written guide (and their getting started video)
  • Install Pololu Maestro Command Center software (windows, linux)
  • Import the maestro_settings.txt and navigate to the sequences tab
  • Select the 'PickTray' sequence from the drop down menu and press 'play sequence'
  • Ensure that the gripper is located above the active (front) inventory tray when the fingers close.
  • If the arm isn't in the correct location then you'll have to step through the sequence and update the servos to provide the correct movements.
  • Repeat this method for the other sequences
    • PlaceTray
    • Pick0
    • Pick1
    • Pick2
    • Pick3
    • Place0
    • Place1
    • Place2
    • Place3

Note: Each sequence should begin and end in the same `ActiveHome` position. This lets the maestro smoothly interpolate between your sequences

Once all sequences result in the arm navigating to the correct places...

  • Save your work (File -> save/export settings)
  • Click 'copy all sequences to script'
  • Upload the sequences to the micro maestro

Step 13: Software (Arduino)

  • Install the Arduino IDE if you don't already have it installed
  • Download the RoboClock_MKR1000 directory from the github repo
  • Open the sketch in the Arduino IDE
  • Using the Arduino Library Manager (Sketch -> Include Library -> Manage Libraries...) install the following dependencies
    • Pololu Maestro
    • CheapStepper
    • WiFi101
  • Input your Wifi's credentials into the `arduino_secrets.h` file (uuid and password) (RED arrow in the above image)
  • Change the `wt.timezoneOffset` to match your current timezone (line 19) (BLUE box in the above image)
    • -8 = PST
    • -5 = EST
    • 2 = Paris
    • etc...
  • Set the `myClock.inventory.usingSensors` flag to `true` if you're using the hall effect chain sensor, otherwise set this to `false` (line 22) (GREEN box in the above image)
  • Select MKR1000 from Tools -> Board (if it's not listed, then use the Board Manager to download it)
  • Press the Check Mark in the upper left corner to compile to code
  • Fix any errors that may have appeared

Prepare the Podium and Inventory

  • The Arduino code expects the inventory numbers to be in the following counter-clockwise order
    • 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 7, 8, 9
    • pictured above with a guest star
  • The Arduino code also expects the Podium to be empty except for a zero in the last spot
    • _, _, _, 0 (in software -1 == empty)
    • pictured above

Send It!!

  • Connect the MKR1000 to your computer and hit `Upload`
  • Cross your fingers and hope that everything works.
  • You can also open the Serial Monitor (by clicking the magnifying glass in the top right corner of the IDE) to read what the Arduino is doing and be notified if it encounters an error.

Step 14: Tune

Tips and Tricks to improve the reliability of the RoboClock

  • If your robots movements aren't working the way you expect them to, you can use the Maestro Control Center software to edit the default sequences.
  • The servos aren't super powerful, so it's important that the EEZYbotARM have very little moving resistance. At the same time, you don't want the arm's linkages to be so loose that there's a lot of mechanical play.
  • You might have to reinstall your servos if the EEZYbotARM doesn't have the required range of motion. Using the Maestro Control Center, set the servo to an extreme (either left or right) and then reinstall the servo with the robot's arm in the same extreme position.
  • If the robot's gripper is having a hard time grabbing or holding onto the numbers, try adding more rubber bands to the gripper fingers.
  • If the chain and sprockets are binding, try increasing, decreasing the height of the sprockets (using washers) and adjusting the guide rails height (by cutting them down to the desired length)
  • If using the chain sensor, ensure that it's as close to the chain trays you can get without touching them. The small magnets are only sensed within a few millimeters.

Finally, feel free to play with the code and make any optimizations you can think of! Tinker with everything and let's make a better RoboClock together!

Hope you've had fun building this project and learned some cool new techniques you can apply to future projects.

Thanks for building!

Take care and stay healthy ♥️

First Time Author Contest

Participated in the
First Time Author Contest