I’d like to show my maker spirit by building a smart watch, aka the Xadow Watch. As to the functions of this watch, I thought about it at lengths before reaching this decision: do not confine the function, make it easier to change the functions to meet different requirements. Without restraints, there will be infinite possibilities. Thus here comes the Xadow Watch!
To make a wearable demo of small form factor and with rich functions, the first idea that came to mind was Xadow. No more explanations here (What is Xadow?). Then I need to consider the sizes of Xadow and a wristband. The combination of 4 modules and a battery is great. Actually I’d like to add more modules, but my wrist isn’t that big. Let’s make it simple with the following functions:
- Displaying time
- Showing the time according to gestures
- Showing hourly chime
- Set time via buttons
- Simple gesture to wake up the system
- Hourly vibration as reminders
You might think this smart watch is not that smart. I agree! But this is just the starting point; you’ll surely have better ideas and can come up with a much smarter watch or some other wearable projects.
Step 1 - Materials
As a watch, we want a cool shell, but there’s none that are ready-made: we'll 3D-print one.
What we need:
-
Xadow - Main Board
The module is a microcontroller board based on the controller ATmega32U4 with a 32k flash. The board can be powered either from a USB connection or a Lithium battery (80mA output current). And the board can charge the Lithium battery through a USB port. The USB port on the board can be also used to upload programs. When you upload a program to the Xadow Main Board (as you do with other Arduino boards), select "Seeeduino Xadow" from the Tools > Board menu.
-
Xadow - OLED 0.96''
The advantage of OLED is its power consumption. In addition to E-ink, The OLED might be the most energy-efficient screen. The 128x64 OLED screen is very cool. This module is equipped with the most comprehensive software support, you can effortlessly draw the pattern on this screen what you want. When you look it like the all-metal Xadow clock , you know I did not lie to you.
-
Xadow - Vibration Motor
This small vibrator motor can vibrate like your phone. When using it, You only need to power for the module and then send "Vibration" command. In fact, The "Vibration" command is setting control pins to high level, then it will work. I like this module because it can create a short-term shock to prompt me whether one operation was successful, such as shaking my arm to switch my iPhone songs, which sound terrible, and it is not like the buzzer which sound terrible.
-
Xadow - 3-Axis Accelerometer
This high resolution digital accelerometer with large ±16g measurement range through IIC interface will monitor the motion state. With this module, you can easily add monitoring movements function in your design, Such as arms, legs shaking. If you want to switch your iPhone songs through arm shake, then this module is just for you.
-
Battery – 170mAh
To power the system.
Step 2 - Hardware Connection
Connect the four modules via FPC wire: remember that every Xadow modules has direction, you need to keep the four modules int the same direction. That means, head to tail and tail to head. As shown in the following image:
MISSING PICTURE ?
Step 3 - Programming and Test
Only start working on software after finishing the hardware connection.
- Download the code here, then unpack it to anywhere, it’s not a library but a sketchbook
- Click here to get more details about sketchbook
- Open Arduino IDE, File -> Preference, write down the path of the sketchbook in Sketchbook location
- Click OK, and re-open Arduino IDE, check if the sketchbook location set ok
- If so, click File -> Sketchbook -> Xadow_Smart_Watch_T5:
And we open the code:
- Connect Xadow – Main Board to your PC
- Upload the code to Xadow – Main Board
If you are not familiar with this, click here to get more information.
- Open Tools -> Board -> Seeeduino Xadow. If you can’t find Seeeduino Xadow in your Arduino IDE, click here if get help
- Then choose the right Serial port number, click Upload, and we finish the code uploading, after that you can find the OLED will display time
- We can set the time via the 2 buttons on Xadow – Main Board. Long press the left one can set Hour while the right on set Minutes
To save energy, OLED will turn off after 10 seconds, you can shake the watch to awake it.
Step 4 - Print the Shell
Download the Shell file here.
Enclosure model file (stl): MISSING LINK?
Enclosure 3D printing file (3xg):MISSING LINK?
Download the Enclosure 3D printing file and import it to the SD card, then you can printing the Enclosure with the SD card.
Installation
Enclosure parts make:
Tools:Burin
Necessary materials:2056 white rivet*12pcs,H20mm D1mm steel column*5pcs
3D printing enclosure rough and burrs, have to fix them by burin (otherwise it affects the installation structure and architecture and hardware).
The hole on the box, need to penetrate by M1.2 drill. Then install the box and lid with a steel column. According to this method, this makes 5 enclosures.
Assembled all enclosures by the R2056 white rivet.
Assembled.
Put the hardware modules into the enclosure.
Your smart watch is now complete!
Go Deep into the Design
If you want a more complex watch, Xadow Kit has dozens of modules that will help you.
Structure Design
- Measure the size of Xadow module, pay attention, Xadow - Main Board size special, then based on these dimensions make the 3d model of the enclosure.
- Modeling is complete, save the format: stl,
- Open MakerWare, import the Model file, Ensure the file format is “.stl”.
- Adjust the model position, ensure the model in the print range. Then adjust the print parameters: infell:100%, number of shells: 1, layer height: 0.20mm, extruder:205°C, speed while extruding:100mm/s, speed while traveling:120mm/s. Finished setting parameters, generate 3d printing file.
Software Design
The Xadow Watch needs to use the library of Xadow - OLED 0.96'' and Xadow - 3-Axis Accelerometer. Seeed published their Suli, along with a Suli-compatible library for the OLED and Accelerometer, to make this system much easier to port. We decided to use this Suli-compatible library, click here to get more information about Suli.
The following image is the flow chart of Xadow Watch, this will show you how does Xadow Watch work. You’ll find that this version of watch doesn't have too many different functions, which allows for a simple code. We have two classes to manage the time and display: watch_ui and watch_time. We’ll talk about some important function of this 2 classes.
Update Time
/*
* time update, get time from rtc, or other device
*/
void watch_time::timeUpdate()
This function can update system time, if you use a RTC module, you can get time from RTC, otherwise you can just let second add one per second.
Refresh Time Display
/*
* time refresh
* mode: 0 - when minute change
* 1 - update whatever
*/
void watch_time::timeRefresh(unsigned char mode)
This function can refresh the time on OLED, when mode = 1, it will refresh the display anyway, when mode = 0 it will refresh the time until time changes.
Display Buffer
We know that our OLED has 128x64 pixels, this need 1024 Byte buffer. This buffer is a private variable of watch_ui.
private:
unsigned char pixel[1024];
Draw a Pixel
/*
* draw pixel
*/
void watch_ui::drawPixel(int _x, int _y, unsigned int color)
Write a pixel to display buffer. You should know that this functon can’t update the display immediately.
Display
/*
* display
* only this functin can refresh oled
* the following function such as clear, drawBuff....can only change the pixel buff,
* but will not refresh oled
*/
void watch_ui::display()
Put display buffer to OLED.
xiaobo__
Comments