Introduction: Minecraft Watch
This is a functional watch that I made for my nephew based on the Minecraft clock. If you or someone you know is really into Minecraft, this watch is sure to be a welcomed novelty!
The idea is based on the clock item in Minecraft. Essentially it just shows day and night so that if the player is underground, they can know when it is safe to emerge. The watch we will be making is just a replica of the clock that you can set to tic out seconds, minutes, or hours. The code can be customized to choose how you want it to function.
Step 1: Gathering the Parts
On the hardware side, there are a few parts that you will need to build the watch:
- Adafruit 3.3v Trinket
- 3.7v LiPo Battery
- USB LiPo Battery Charger
- Mini Stepper Motor (Alternate Option)
- Mini Switch
- Sun/Moon graphic
- 3D printed case
- Soldering/Hot Glue equipment
Total Cost: Approx $20
On the software side, we will be using the Arduino IDE to load our program to the Trinket, so make sure you have it downloaded and installed. Also, in order to make it communicate with the trinket, there are a few modifications you will need to make, which are covered on the Adafruit website.
Step 2: Getcher' Motor Runnin'
Now that we have are parts, the first thing to do is connect the stepper motor to the Adafruit Trinket. In pretty much every other situation when you are dealing with stepper motors, you will need a stepper motor driver. However, since our stepper motor is extremely tiny and requires very little power, in this rare instance, it can be driven directly by the Trinket.
Your stepper motor should have four output terminals, and depending on the motor you've purchased, those terminals may be different than mine. As you can see in the diagram above, the two top terminals connect one coil, and the two bottom terminals connect the other one. If you are unsure how your stepper is connected, you can use a multimeter to see which ones pass current.
Once you have your terminals established, you can connect it to the Trinket as layed out in the diagram above. The first coil set connects to pins #3 and #1 on the Trinket, while the remaining coil set connects to pins #0 and #4.
With the motor connected, we can now load up the software. The Arduino code is extremely simple. Essentially, you set up a class for the stepper motor, and then tell it how man times you want it to move per second. As a demonstration, I just set mine to delay for 1,000ms or 1 second so that each tic was easily visible. If you want to to be more accurate to day/night revolutions, you can set it to 300,000ms, which is 50 minutes (I didn't use 60 minutes, because the stepper only has 20 steps to make a full revolution). Here is a copy of my code (DOWNLOAD IT HERE):
#define STEPS 720 // steps per revolution (limited to 315°)
#define COIL1 1
#define COIL2 3
#define COIL3 4
#define COIL4 0
// create an instance of the stepper class:
Stepper stepper(STEPS, COIL1, COIL2, COIL3, COIL4);
stepper.setSpeed(30); // set the motor speed to 30 RPM (360 PPS aprox.).
stepper.step(630); //Reset Position(630 steps counter-clockwise).
int pos=0; //Position in steps(0-630)= (0°-315°)
stepper.step(-1); // move one step to the left (change to 1 to move to right).
delay(1000); //1,000ms = 1 sec | 300,000ms will give an accurate day/night tic) pos++;
Step 3: Give It Some Juice
At this point, you should have a tiny stepper that is run by the Trinket at tics at your specified intervals. Now we need to make it mobile. To do that, we need to replace the Trinket's USB power with a battery. We'll be using a small 3.7v rechargable LiPo battery, which means we'll also need a way to charge it. Enter the USB LiPo Battery charger. This charger should allow you to connect the battery and the Trinket to it on one end, and a micro-usb cable on the other end to charge the battery. It also has the added benefit of protecting the battery and the Trinket from power issues.
Since it's not really the best idea to charge the battery while it's being used, you could also add a switch to the circuit to turn the Trinket off and on. Now the trick is to solder all those components together using a minimal amount of wire. You can use the images for this step as guides.
Step 4: Big Power, Little Case
This final step is to take all of the electronics that we've created and cram it into the 3D printed case for the watch. The USB charger and Trinket should snuggly fit perpendicular to each other. then you can just hot glue the rest of the components into place. Print out the day/night image, cut it out, and affix it to the motor head. Place the cover on top, and paint it a nice golden color to match the game version. Now you can add a regular watch band and show it off to your friends!
We have a be nice policy.
Please be positive and constructive.