ChronosMEGA; a Wrist Watch
I've always loved watches; not only are they aesthetic and beautiful, but they are functional, precise and useful. An elegant fusion between engineering and art; two normally opposed perspectives, now joined in harmonic unison. However, all technologies like the dial-up internet, the CVT monitor and the abacus, inevitably will become relics of our past with the advent of advancing technology, and have since become less pragmatic for the typical person to own. Unlike these archaic technologies, the wrist watch still thrives on the wrists of many, standing forever as a testament to one of mankind's greatest inventions: the measurement of time.
I suppose it was inevitable that I would design my very own wrist watch. The name for this wrist watch is the ChronosMEGA, a combination the greek word: chronos for time, and MEGA for the ATmega328P processor used.
The below video is a montage that saturates 4 months of development in 4 minutes.
This short video demonstrates the features of the watch and briefly explains how it functions:
Goals:
- Robust and practical for daily use; long battery life
- "Production ready" and professional; to look, feel and behave like a finished product
- Compact, small form factor
- Assembly SW to drive the system
- To be as aesthetic as possible
Specs:
- Atmel ATmega328P QFP processor
- Binary time encoding using 10 Blue 1206 LEDs
- Buttons to control time, sleep mode and display
- 32.768kHz external crystal and 8MHz internal clock source
- Micro-USB and Charge Management Controller to recharge 400mAh Li-ion battery
- Draws 4uA in its Deep Sleep mode to last up to 11 years on a single charge (see section 5.3.)
- Battery Indicator 0603 LED
- Boost TI Switching Regulator for power regulation
- Low Loss PowerPath Controller IC for power source selection
- Total form factor of 10mm x 40mm x 53mm
- Custom 3D designed case cast in pure polished silver
- Genuine crocodile leather watch band
This Instructable will be broken into two big sections:
I.1.1. Section 1: The Design; the Development
This section will introduce my approach and design considerations, and then dive into each component: explaining in great detail how the ChronosMEGA was constructed from top to bottom. There is even a pre-requisites page for a friendly pointer to what topics you must understand so you may understand the topics covered here.
I.1.2. Section 2: The Cloning Process
All files are included in this Instructable so you can build a ChronosMEGA clone with virtually no work on your part. There is a .zip file below on this page with everything you need, including:
• Gerber files to send directly to a board manufacturer
• STL files to send to a 3D printer
• Assembly ASM files to upload directly to the MCU
• Bill of Materials with links to every single part purchased
In this section, I provide step-by-step instructions with plenty of pictures to guide you in cloning. The process will cost you approximately $100 to $700 depending on the options you choose. The largest factor in price is the case material you choose.
Downloads
Table of Contents/Pre-requisites
1.1. Table of Contents
1.1.1. Section 1: The Design; the Development
- Step 3: Theory of Operation
- Step 4: Schematic Design
- Step 5: Software with Assembly
- Step 6: Animation Feature
- Step 7: Designing the PCB in EAGLE
- Step 8: Exporting the Design to SketchUp
- Step 9: PCB Order and Soldering
- Step 10: Designing the Watch Case in SketchUp
- Step 11: Assembling the ChronosMEGA
1.1.2. Section 2: The Cloning Process
- Step 13: ChronosMEGA Cloning: Introduction and Initial Steps
- Step 14: ChronosMEGA Cloning: Preparing and Uploading Software
- Step 15: ChronosMEGA Cloning: Putting together the Hardware
- Step 16: Closing Statements and Reflections on the ChronosMEGA
1.2. Pre-requisites
This watch wasn't made with beginner experience. If you wish to understand this Instructable, and to construct your own watch like mine with your own interpretation, you must understand at least the following concepts:
- Basic knowledge of passive elements (resistors, capacitors and inductors) and real applications
- Pull-Up Resistors
- Decoupling and loading capacitors
- Knowledge on programming a MCU and setting Fuses (if AVR) and Registers (I programmed with Assembly but you may just use C if you wish)
- PCB layout and design experience
- PCB Editor SW experience for building custom parts and implementing them in circuit designs
- Ability to read datasheets well (must be thorough when reading them)
- A willingness to learn SketchUp (Anyone can figure out to use this SW easily)
- SMD Soldering Experience
Section 1: the Design; the Development
This section is the design and development section. Here the design considerations and approaches of the ChronosMEGA are covered in detail.
Theory of Operation
This step generically describes how the design of the ChronosMEGA came to be, and gives a simple look at how it operates.
3.1. LED Layout and Encoding Time
The layout of the watch is set up in a circular array of 10 LEDs. Four of the LEDs account for the Hours, and six of the LEDs account of the Minutes. The LEDs count in Binary to display the time on the watch face.
The layout of the LEDs on the watch is as shown:
By utilizing a combination of the 10 LEDs, the watch can display any possible time accurate to the minute. For example, the time shown below is 10:13 (dark blue is a lit LED):
This is a very clean and elegant way to display time. I also really like this technique because of its esoteric and mysterious nature. It would be rather difficult for other people to know the time without realizing the pattern, especially those who are not familiar with the binary counting system.
3.2. Power Supply Concerns
Using minimal HW, I can elegantly display any time. However this introduces a caveat: to display a time, up to 8 LEDs may be on simultaneously. For example, the time: 7:31 would have to light up 8 LEDs on the watch. Provided that a single LED will draw at the least 7mA, 8 LEDs would draw 56mA of current alone. This doesn't include the MCU and the power regulation current draw. This is large power drain and would quickly eliminate a battery. A 400mAh battery would only last for approximately 7 hours if 8 LEDs were constantly lit.
The solution was to have an idle animation occur when the user does not need to see the time. There will be a button on the watch that will display the time for approximately 5 seconds so the user may know the time at his or her convenience. After five seconds, the watch will return to its "idle" state where the LEDs light in a circular manner. The circular pattern however will be meaningful. With each lap around the watch face, an exact second will be counted. By doing this, only one LED will be lit at a time:
This will look pretty cool in normal operation, and will give the user confidence that the watch is currently functional.
3.3. Button Layout and Functions
The watch features four buttons, two on each side. Each button has an important function:
• Button 1: Increment the Hours. By pressing this button, the watch will increment the time by one hour.
• Button 2: Increment the Minutes. By pressing this button, the watch will increment the time by one minute.
• Button 3: Toggle Sleep Mode. This will disable or enable the circular flashing from the LEDs and place the watch in a sleep mode to preserve power. Disabling the animation will also avoid possible annoyance from the user when sleeping or at the movies.
• Button 4: Display Time. This button will tell the watch to display the encoded time in binary on the watch face. The time will be shown for approximately five seconds before returning to its idle state.
Schematic Design
Here I discuss the design approach to the schematics and the meaning behind the circuits. The power regulation circuitry is the most involved and where I spent most my time for this step.
4.1. The Power Circuitry
The circuitry handling and regulating the power was the most involved portion. The circuit must take in the power of a 3.7V Li-on battery and boost it with a switching regulator to 5V. The switching regulator is shown here:
The resistors R1 and R2 shown below determine the output voltage seen from the switching regulator.
 The equation for finding the output voltage is:
 R1 should be chosen to be 10K. The voltage reference is equal to 1.255 volts according to the datasheet. Simply choose your output voltage and calculate R2.
4.2. Handling battery charging
Since the battery must be recharged, I used an IC called the MCP73831 with a micro USB interface to recharge the Li-on battery. The resistor between PROG and VSS is called the programming resistor and determines the current the IC sources to battery to recharge. There are also decoupling capacitors on the input and output voltage sources.
When the USB is plugged in, the voltage passes through diode D1 straight to power the ChronosMEGA. The decoupling capacitors hooked up to the VCC node will smooth out any ripples in the USB source.
4.3. Battery Charging safety HW
I also added a low loss power path controller that automatically selects the power source to power to the wrist watch. The power switch controls an P type MOS-FET that will dis-engage the battery from the system when a USB is plugged in. The power from the USB travels through Diode D1 and bypasses the switching regulator.
The advantage of using this system is to ensure that the battery is not used to power the device during a recharge state. This is gentler on the Li-on battery, improving its potential life span and preventing possible damage.
4.4. ATMEGA328P QFP
The ATmega328P is wired in a straight forward manner. It is connected to power and ground, with a pull up resistor on the RESET pin. The AVR drives all the LEDs from its GPIO. One of the AVR's ADC pin is connected to the battery to detect the voltage level. It also has a small red status LED to indicate when the battery is near dead. When the User places the watch on the charger, the red LED will turn off and turn on again when the battery is fully charged.
The AVR has a 32.768 kHz crystal wired to its XTAL pins. uses the 32.768 kHz crystal to drive its Timer2 module asynchronously for counting the seconds, and uses its internal 1MHz RC clock to drive the SW. 32.768 kHz is a very common frequency to drive Real Time Clock (RTC) systems because 32,768 in decimal is equal to 8000 in hex. Therefore, 32,768 can be evenly divided by multiple powers of 2 including 1024. Dividing 32,768 by 1024 yields 32, so configuring the Timer to count to 32 with a 1024 pre-scaler will equal an exact second.
4.5. The LEDs
The LEDs in the circuit are wired in series with their own resistor for each. They are size 1206 in the Imperial standard and draw a minimum of 7mA. The LEDs are directly driven by the IO of the ATmega328P.
4.6. The Buttons
There are 4 buttons with pull up resistors attached to the IO of the AVR. The buttons will pull the node to ground when the buttons are pressed. Debouncing for the buttons are handled in the Assembly programming.
Software With Assembly
The logic flow of the SW for the Watch is depicted above. Programming was done entirely in Assembly, implementing the Interrupt, ADCs, Power Management, GPIO and Timer features of the ATmega328P. The reasons I choose Assembly for my programming language was to optimize my program the best I could and because I pride myself in working in the more difficult, lower levels for projects.
5.1. Initial Prototype
A video showing the breadboard circuit is shown below:
When the "IncSec10" function is called, the stack appears as below:
After "IncSec10" is finished, the registers are popped back out of the stack to restore their original value.
Animation Feature
The Animation was a feature I was hoping to implement into the ChronosMEGA but due to time constraints, I could not finish integrating the animation with the main logic code.
6.2. Why is this being shown if it's not completed?
I spent hours every day for weeks building the Animation, but later I could not integrate the two Assembly codes together. The Animation code by itself is actually complete and works. I developed the Animation separately from the main code, so I could attempt to integrate the two later. However, during the integration, errors were being tripped everywhere; because the code was in Assembly, it was very very difficult to track down the source of the issue.
The raw animation code is actually included in the .zip you downloaded at the beginning of this Instructable.
Another reason why I'm showing it is just because the Animation looks really cool, and thought you guys might like to see it.
6.3. So what does this Animation even do?
As mentioned before, there are two display modes that the ChronosMEGA can be in:
- Time Display
- Idle Display
However, I thought it would be cool if an Animation was executed from the transition of Idle Display to Time Display.
The Animation starts by lighting the first, right most LED. Then, while lighting one LED at a time, the light travels clockwise around the face and stops at the most counter clockwise LED that needs to be lit in Time Display from the origin point.
This is probably confusing, so I created a cool Animation of the Animation. This will demonstrate what the Animation will look like if the time is 4:52
And this video shows the animation of the ChronosMEGA in action:
Designing the PCB in EAGLE
Quite a bit of thought went into the design of the board; originally I had some plain layouts, but eventually the circular array idea came to me and I ran with it. I tucked the power supply circuits on the bottom of the back of the board. I planned for the battery to sit behind the board, so I avoided overlapping components to give the watch the thinnest profile possible.
I'll cover the most interesting or obscure components of the board and the layout.
7.1. Arranging the LEDs
A huge goal for this watch was to make it as aesthetic as possible, therefore, the LEDs were arranged to be symmetrical horizontally and vertically. I choose a circular ring because the gentle shape and the rotating movement of the LEDs seemed to contrast the otherwise sharply edged traces and ICs.
7.1.1. Subtle offsets in spacing for a Faster/Slower effect
It may be noticeable that the LEDs are not spaced equal distances apart. This was done on purpose to create a very subtle effect. While the ChronosMEGA is in its IDLE state, a light will be traveling around the watch face. Since the LEDs have different spacings, the light appears to travel faster at the top and bottom, and slower on the left and right sides.
7.2. Making the Power Circuitry Tiny
A great obstacle for the power circuitry was the sizing and the board layout, while still providing adequate trace sizes and planes to handle the current and to help dissipate heat. The 3 ICs used in the power circuit were all chosen because they were effective and they were offered in SOT23 packages for a minimal footprint. Every single diode, inductor, resistor and capacitor were carefully chosen to maintain the smallest possible footprint, and to also perform to expectations. These constraints on the project led to many revisions and trials to finally obtain the best product.
All the power circuitry was fitted within 4 tenths of a square inch.
7.3. Fitting the battery to the back
I choose a relatively large: 3.7V 400mAh Li-on battery for my application. The battery is sized at: 25mm x 35mm x 5mm. The watch face had to be made wide enough to accommodate the sets of 2 buttons on either side and the long side of the battery. In the remaining space near the bottom of the watch, the power circuitry was laid out.
In the picture below, you can clearly see the large, grey battery that barely fits between the buttons. The power circuitry below the battery is all shown.
Here is a close up of the copper traces for the power circuitry:
7.4. Adding Chip to my design
Chip is of my own design, I've been using him as an avatar for my online interface. So it seemed fitting to add him to the board that I was designing:
User: ioBridge put together a nice Instructable [1] demonstrating how to do this.
Some notes about adding images to your board. Ideally, it should be a monochrome image, meaning that it only uses two colors. I believe ioBridge used Photoshop or something similar, but I created my image in MS Paint. After you are done drawing your image, "save as" the image as a Monochrome BMP.
In addition, before importing the image, be sure to move your entire project away from the origin. When you import the BMP, it is created at the origin, and is composed of very many, tiny slices. You cannot select the BMP as a whole with a single click. You must group all the slices then move the group to arrange the placement of your image.
If you want to move the image again later, but it's already on the board and you cannot "group" the image without grouping other components. You can alternatively, disable all the layers of the board except for layers: 200-208. This will isolate everything from the image, allowing you to group the image without gathering other components.
7.5. Adding holes for the stand off screws
With the sizing constraints on the watch, there was very little room to add mounting holes so the board could be bolted onto the watch case. I made 2 4mm holes on either side of the watch in between the two buttons, so as to accommodate a 4-40 machine screw.
[1] https://www.instructables.com/id/Adding-Custom-Graphics-to-EAGLE-PCB-Layouts/
Exporting the Design to SketchUp
Using Google's Sketchup CAD tool, one can make an awesome virtual model of his or her board. The plugin is called EagleUp. EagleUp works within EAGLE, by extracting each layer and converting it to a script that can be recognized by SketchUp. SketchUp uses the script to build the board for you.
There are plenty of tutorials on EagleUp's website. Their installation page is incredibly comprehensive and easy to understand. Set up takes a few moments but it is not difficult:
http://eagleup.wordpress.com/installation-and-setup/
8.1. Why use EagleUp to model your board?
I wanted to build a watch case enclosure surrounding the board, so having a virtual board designed would effectively allow me to ensure that the watch case has the tightest and most accurate tolerances possible. Modeling the board also cross checked the accuracy of the wiring and board layout against the virtual ICs, capacitors, resistors and etc. Seeing that the modeled components fit onto the modeled board gave me confidence that the board layout was correct.
8.2. Designing your own Components
You will have to design many of your own components, which can become tedious quickly. The outcome, however is worth it. Shown below is the ATmega328P chip I designed in SketchUp:
EagleUp's webpage has plenty of guides and pointers on creating your components that are placed on your board.
Be sure that the package names of the parts you design in EAGLE have the same name of the SketchUp models you make. For example, to get a resistor placed onto your board, first check the package name:
View this window by right clicking on the part and choose "Properties". You can see that the name of the package for this resistor is "0603-RES". This means that in your "Model" folder that contains SketchUp models should also be named "0603-RES".
PCB Order and Soldering
Using EAGLE's CAM Processor tool, I exported the board layout to Gerber files, I ordered five boards with a white solder mask from Seeedstudio's Fusion PCB[1] service. The boards are only 0.8mm thick.
All the components were soldered by hand.
Shown below is the Component side of the board completely soldered:
And the Solder side of the board:
[1]: http://www.seeedstudio.com/service/index.php?r=site/pcbService
Designing the Watch Case in SketchUp
The case was designed with Google SketchUp and consists of 3 main components:
• The top bezel
• The bottom plate
• The four buttons
These three components were combined into a single model with connecting rods. This saved on time and money when the design was ordered to be manufactured by Shapeways.
The watch case is made of pure polished Silver.
10.1. The Bottom Plate
It is a 1mm thick plate that has 2 mounting holes for the PCB, and 4 holes (2 on each side) on the gull wings for the top bezel to screw onto the bottom plate. The holes on the gull wings also act as the installation method for the leather watch band.
These 6 holes were all tapped by hand with a 4-40 threading pattern.
10.2. The Top Bezel
The top bezel is the shell that surrounds and protects the watch. It has two gull wings that are parallel to the bottom plate and have tapered holes so that the machine screws sit flush. The bezel also features four openings for buttons to fit into, and a single hatch allowing easy access to the Micro USB hub on board the watch.
There is a small bevel to the top of the bezel, which acts as a mounting point for the glass to be added.
10.3. The Four Buttons
The four buttons sit flush in the Top Bezel of the watch case. They act as extensions of the four buttons that are embedded underneath the watch board.
Assembling the ChronosMEGA
Putting the ChronosMEGA completely together proved to be a challenge because the spacial tolerances were incredibly tight.
It also was fun making the final adjustments of the watch and finally seeing my creation in it's complete state.
11.1. Preparing the Watch Case
The watch case arrived to me as a single model unit: with the buttons, and the two case halves connected together with small silver rods. The case was designed this way because it's much cheaper to order one larger model than several smaller models.
Using a dremel, the rods were severed and smoothed down.
Two holes on each gull wing of the bottom plate were drilled and tapped with 4-40 threading by hand. The standoff mounts for the watch board were tapped as well.
The buttons have small flanges that needed to be filed down quite a bit in order to accommodate the size constraints of the case.
Shown below is how the top bezel was prepared before combining the two halves of the watch. Notice how thin the button flanges are, and the tape on the outside of the case to hold the buttons into place.
11.2. The Watch Band
I choose an elegant genuine leather crocodile wrist band. The band was marked for where the gull wings will attach to and then drilled so as to make a path for the machine screws.
11.3. Drilling and Tapping the Additional Holes
The case needed additional holes on the bottom gull wings; after the drilling process, the holes were tapped with a 4-40 threading pattern. Stainless steel bolts hold the case together and pass through the watch band.
11.4. The Glass
Adding the glass was, surprisingly, a challenge simply because finding a product large enough to cover the watch face but thin enough to fit the profile proved to be quite a feat. The glass had to be approximately 1mm thick and at least 36mm by 50mm. Almost all glass products that I found is offered in its thinnest at 1/8 of an inch or over 3mm. I found some glass products that were very thin but would only supply to corporations.
Finally I found the glass I was looking for by searching for "Large Microscope Slides" on Amazon, which returned only a single product measured at 1mm X 2" X 3". Normal microscope slides are 1mm X 1" X 3" and so do not fit my requirements. A link to the slides I purchased are in the Bill of Materials (BOM) that is included in the .zip download on the first page of this Instructable.
Not only did finding glass that was sized correctly was difficult, but also cutting the glass was very hard as well. The glass was not tempered and very thin, so only very little pressure could be applied to the glass while cutting. This introduces an issue, because pressure is needed when etching that line into the glass.
Approximately 20 microscope slides were shattered until I finally had one cut to size successfully.
11.5. Assembling all the pieces together
The glass was epoxied to the top bezel from the inside of the case and allowed to sit for a few hours.
Everything was then cleaned and polished.
After the button flanges were filed down to a desired thickness, they were placed in the spaces of the bezel and tape applied to the outside to hold them in place.
The AVR system board was fastened down with 2 4-40 machine screws onto the bottom mounting plate of the silver case.
Very carefully, the AVR and Bottom Plate unit were inserted USB end first into the top bezel unit. The USB must first sit into its window insert of the top bezel.
The other side of the bottom side was wiggled gently along the edge of the top bezel until the case closed together. The buttons were tested to make sure they didn't stick and function correctly.
The watch band was inserted into the gull wings and then fastened down with 2 4-40 flat head machine screws, thus closing the case and holding the band simultaneously.
Section 2: the Cloning Process
Here, I will show you step by step what to do with plenty of pictures and guidance. I'll step you through the caveats, show you where to install the software, and how to upload the Assembly code to the watch and so on.
The most difficult portions in this section is soldering the surface mount components, and putting the final pieces together. However, if you take your time, and make sure you are patient, you will find success.
ChronosMEGA Cloning: Introduction and Initial Steps
You can build a ChronosMEGA clone for yourself very easily because everything is prepared for you to order right away with no development on your end. The hardest part you will have to do is surface mount solder all the components and put the case together with the watch. Luckily, surface mount soldering looks much more intimidating than it actually is, and I also walk you through the steps when putting the ChronosMEGA together.
Listed here are a majority of the components you will need to buy:
https://www.digikey.com/classic/RegisteredUser/BOM...
The Tactile buttons, USB port and Battery can be found here:
Cost:
The cost to build a clone can be from $100 to $700. This is mostly depending on the type of material you use to make the case and the watch band used.
The steps I will cover here are:
- Manufacturing the Board
- Manufacturing the Watch Case
- Ordering all the parts
- Soldering the Components
Step 1: Manufacturing the Board:
To have the board manufactured is very easy, in the folder: ChonosMega/GerberFiles/ you will see that there are two folders called: "OSHPark" [1] and "SeeedStudio" [2]. These two folders contain a .zip containing Gerber files to directly upload to the corresponding company. Either of these companies will make the boards for a low price. To order, click on one of the links at the bottom of the page and follow the instructions.
Even though I provided Gerbers for OSH Park, I recommend going with SeeedStudio because the OSH Park boards are thicker than SeeedStudio, and I cannot guarantee that the model will fit when you finish!
If you want to go through your own board house, you could cross check the existing Gerber files and make sure they conform to the requirements of your board house. If not, then you can open the .brd file in EAGLE and use the CAM Processor tool to build your own Gerber files from the source.
Here are some specs for the board you may need to know while ordering:
- Board Size: 45mm by 38mm (1.77" by 1.5")
- Layers: 2
- PCB Thickness: As thin as possible, I got 0.8mm
- Surface Finish: Default recommended
The board will cost you anywhere from $30 to $40 depending on the options that you choose with shipping included.
Step 2: Manufacturing the Watch Case
Simply go here for the entire watch case:
https://www.shapeways.com/model/1809825/chronosmega-watch-case.html?li=aeTabs
Order the model in any available material you like, I chose the polished silver ($188) option.
The cost of this case can run from about $16 to $600 depending on the material you choose.
Step 3: Ordering all the parts
Order all the parts from Digikey and Sparkfun from the BOM provided above.
Total Cost estimate: $114
Note about microscope glass: If you're serious about cloning, I'll send you some of the microscope slides for no charge. I have 50 of these things left over now and I have no idea what else to do with them. Just send me a message and as long as it doesn't cost me much to mail, I'll get them to you. It's much cheaper than you buying the box of slides because you only need one.
Unfortunately the slides are currently unavailable. I still have more slides (Mar15), so message me and I'll send about 5 of them. Just be careful because these things shatter for like, no reason. So when you get them, be sure to take them to a professional to get them cut.
Step 4: Soldering the Top Components
Once you get the board and all the components, you should be ready to solder.
Check the "RequiredTools.xlsx" before you start and try to gather the tools you need before you start. I highly recommend the flux syringe, the flux remover, ESD tweezers, helping hands to aid you while you are soldering. These will save you a big headache and will make the soldering process much easier. These tools will greatly increase the probability of success.
Surface mount soldering is not as intimidating as it appears. I'm not going to talk about how to surface mount solder here because there are way too many incredible tutorials and videos online. Just Google it and you'll have a good idea how to do it. Anyway, now that you have the components and the board, here is the layout for the top. Everything is mostly self explanatory.
For now, only solder the top Component side the board and the buttons:
All the resistors you see on the top side here (except for the row of 5) are 2K ohm.
The row of 5 resistors are all 10K ohm.
The two capacitors that are by the crystal are the loading caps that need 12pF.
The crystal shown in the picture above is not the same crystal that is used, however the crystal is just soldered on, and it doesn't matter which way you put it on.
When you solder the buttons, be sure to clip the wings and the nub on the front of the button.
Dab some epoxy on the bottom of the button and apply it to the board. Then solder the button leads on.
Your board should basically look like this for the top (except for the blue light being on). Remember not to do the bottom side yet:
[1]: http://www.seeedstudio.com/service/index.php?r=site/pcbService
[2]: https://oshpark.com/
[3]: https://www.shapeways.com/
ChronosMEGA Cloning: Preparing and Uploading Software
In this section, we will be:
- Installing Atmel Studio
- Prepare to program the ATmega328P
- Uploading the Assembly code to the system
- Soldering the back of the board
Atmel Studio is a very easy to use IDE for Atmel microcontrollers. Go here for the download page:
http://www.atmel.com/microsite/atmel_studio6/
Step 6: Prepare to program the ATmega328P
First, plug the USB end of the AVR-ISP mkII programmer into your computer. The AVRISP mkII is this guy:
Allow Windows to install any drivers necessary for the programmer.
Traditionally, hobbyists will use header pins to upload compiled code to their projects using a programmer like the AVRISP mkII. The header pins are much too bulky for the ChronosMEGA so I soldered wires to vias connected to the ISP pins of the ATmega328P. Here is a picture of the vias with their labels:
Solder wires to the vias and attach header pins to the ends. Obviously if you have the inductor soldered down, then you'll solder to MISO on the top of the board. Stick these ISP wires into a breadboard, and connect the ISP receptacle to the appropriate pins on the ChronosMEGA.
The pinout of the AVR ISP mkII programmer is:
Your setup now should look something like this, except for the board lighting up:
After you have the wires connected, you must supply 5V and ground externally from some outside source. This could be accomplished through a linear voltage regulator or a DC power supply. In the end, the wiring should be like so:
Step 7: Uploading Assembly code to the system
Now that everything is prepared, open up Atmel Studio 6. From the Start Page, select: File => Open => Project/Solution. Here you need to choose the project file that I provided.
The project file to open is in the .zip folder that you downloaded at the beginning of this Instructable. The file is in the folder: "ChronosMEGA\AssemblyCode\ChronosProject\ChronosMEGA\" and open the file called: "ChronosMEGA.atsln".
When the IDE opens the solution, you should see a tab named: "ChronosMEGA.asm". With a window full of Assembly code. If you don't see this tab, open the "ChronosMEGA.asm" file under the "Solution Explorer" window seen here:
Now that you are viewing the "ChronosMEGA.asm" source code (It will also say in the comment header at the top that it is the main source code), make sure some settings are correct. First make sure that you are seeing these options for the tools and devices:
If these are not set, then you can click directly on them and make the changes. Make sure your AVR-ISP mkII is connected to your computer!
Now you must build the code. This is as easy as pushing a button.
The Output window at the bottom of the IDE should read that the build was successful.
Now hit the button in the IDE that has the MCU with the lightning bolt on it. This button is called: "Device Programming".
The following window should appear:
Hit the drop down for "Tool" and select the AVRISP mkII option. Select "ATmega328P" for "Device" and "ISP" for "Interface". Click "Apply".
Under the "Device signature", click "Read". If the MCU signature is read correctly and no errors appear, then that means you have everything set up correctly. If you get an error here, it is 95% of a probability that the ISP from the AVRISP mkII is not wired correctly to the ATmega328P. Check the diagrams again, and be sure.
Now go to the "Memories" tab and click the "..." next to the "Flash (32KB)" drop down box. Make sure you have the "ChronosMEGA.hex" file selected. This file is in the "Debug" folder in your project folder. You should NOT have the .elf file selected.
Click "Program". After it is finished, the watch should start lighting LEDs in a circular motion. If you push the button: "Time", it should display the time to say 5:33. Push the "HR+" and "MIN+" buttons and ensure the lights are changing. Wait until the ChronosMEGA goes back to its idle state and press "SLEEP". The LEDs should turn off. Push "SLEEP" again, the LEDs should turn on.
If you are having problems, please do not hesitate to contact me. I'm on Instructable's almost everyday so I should be able to get back with you very soon.
Step 8: Soldering the back of the board
Now that you successfully uploaded the program to the board, you may want to start soldering the back right away.
However I suggest you take this opportunity to make tweaks to the SW to make sure that it is keeping time correctly. Let it run overnight in idle state, and let it run overnight in its sleep state. Make sure you are satisfied with the SW's performance before moving on. It will be difficult to change things after you commit.
When you're ready to solder the back, then disconnect the board from the external power source and desolder the wires off of the vias.
Then start soldering the back. I highly recommend doing the micro-USB first! When you solder it, make sure it is hanging 2mm off the side of the board like so:
Then solder the SOD123 diode (see image below). Plug a micro USB cord into the ChronosMEGA that supplies 5V, the watch SHOULD turn back on. If it does, then great!
Now, with the USB soldered, place the board into the top bezel of the watch case. Attempt to plug the USB cord into the watch through the case. The connector should connect properly and the watch should turn on again.
Solder the rest of the pieces onto the board, like so:
Solder the Battery last! The red wire of the battery is soldered to the pad closest to the USB. When the battery is soldered on, the ChronosMEGA should be lighting up again.
After you're finished, the back of the board should look like this:
ChronosMEGA Cloning: Putting Together the Hardware
This is the last part for cloning and you're almost finished. This section requires much patience. If you are not confident with a procedure, then wait! Do not get over zealous here, it is critical you are careful because everything is so delicate at this stage.
Here we will be:
- Separating the Case
- Tapping and Drilling
- Cutting the glass and applying
- Drilling the watch band
- Combining everything together
Step 9: Separating the Case
The watch case that you bought off Shapeways is actually a combination of 3 components: the top bezel, the bottom plate and the four buttons. Each of these are connected to the model with silver rods that will need to be eliminated. The pieces should be separated like so:
There is also one more step. For this watch, the battery is sandwiched between the PCB and the bottom plate. The battery also needs to fit in between the two mounting posts, so you will need to eliminate some material of the posts:
Step 10: Tapping and Drilling
Two holes need to be drilled on each gull wing of the bottom plate in such a way that if a machine screw is fed through the top gull wing, then it will enter that hole. The hole must be about 2.3mm or less than the diameter of the 4-40 screw because you will need to tap these holes with 4-40 threading.
You can see in the main image of this page, the holes that I drilled in the gull wings of the bottom plate.
Be sure to take your time and prepare the case well. Give the bottom plate plenty of support and keep the drill very steady. Don't be afraid to purchase additional tools to help you with this.
You will also need to tap the two mounting posts on the bottom plate with 4-40 threading. They hold the board down onto bottom plate.
Step 11: Cutting the glass and applying
At this point you will need to cut the glass to fit inside the case. I would recommend taking the microscope slide to a professional and getting them cut to fit inside the top bezel, as these slides shatter very easily.
When they are cut, apply a small amount of epoxy to the top bezel's lip and gently press the glass in. Allow the top bezel and glass to sit for an extended period of time.
Step 12: Drilling the watch band
Figure out where the watch band will need to be drilled so that when the machine screws pass through it to hold it in place, then it will be secure and straight.
I placed the band in the groove of the top gull wing and marked with a knife where the drill needs to be. I drilled the band with a drill less than 3mm in diameter.
Step 13: Combining everything together
File the flanges of the buttons down so they are very thin. You can see how thin they should be like so:
When you have them filed down, place them into the holes of the top bezel and apply tape to the outside so that they are held still.
Now use the machine screws to screw the board to the bottom plate.
With the two separate components, we'll join them as one by inserting the USB end in first and then wiggling the other end into place.
Here's a video showing how I combined the two pieces:
Now just slide the watch band pieces into place and use the machine screws to hold the whole assembly into place.
Clean and buffer the watch case and leather. Test the buttons and the USB, make sure that the USB cord can connect to the receptacle inside.
Closing Statements and Reflections on the ChronosMEGA
16. Thanks
Special thanks to TJ to pointing out my design flaws in early development stages and his great suggestions to the project.