Close
0%
0%

Open Source Smart Watch

Based on the stm32f4 cortex-m4 mcu, 1.44" TFT LCD , HC-05 and Android App.

Similar projects worth following
"Rooster on Wrist" is the name I chose for this project. Mainly a 1.44" tft lcd + stm32f4 discovery an hc-05 bluetooth module and lots code. The main purpose of the watch is to sync and display Time/Date/Weather and Notifications from the phone. The watch uses the internal RTC on the STM32F4 to keep tracking of the time.

So fare I managed to get the first watch face done + the companion app on Android. The watch successfully sync data from the phone and displays it.

One aspect was to display the data in an elegant way. From the start I was inspired by the pebble and I took a look at my of the watch faces online to create something similar.

Concerning the Android App I always thought I was going to write my own but at the very last moments I discovered App inventor which saved me tons of time !! I still believe I will have to write my own code sooner or later.



The Code:

Just like many of hobbyists out there I use CooCox with GCC for my projects and that's a major key factor why I chose ARM over PIC32 MIPS , the free IDE and C compiler.

The first step was to interface the tft lcd , I looked up online and luckily I found many useful blog posts about using the ili9163 tft lcd. Obviously I could have checked the datasheet and write my own library which I eventually did and managed to get something on the screen (a bitmap of what I imagined)

This TFT LCD uses SPI and is interface to SPI3 on the discovery board. I use DMA to make it even faster to loads frames ( thought I did not see much a difference )

I kept working on the display library because it was a key factor in handling most of the work here.

Next I wrote the code for the RTC unit, which has two main functions RTC_Configuration() which sets the RTC configurationa and TimeWidget() which constantly keeps track of the time and updates it on the screen.

The bluetooth module:

The hc-05 is connected to the USART1 unit pins and triggers an interrupt which stores the data received from the phone and calls RTC_Configuration() to sync the Time/Date from the phone.

The Mobile App:

When I first started I had to use an app called BlueTerm on Android, it's an extremely useful Bluetooth terminal app that allowed me to communicate with the HC-05 module and send data manually to test my code.

Later on I learned about App inventor by MIT and it was like few minutes untill I got my first companion app done. It reads automatically the time on the smartphone and syncs it to the device.

android sync app screenshots

appinventor2 screenshots

What's Next ?

From the begging the goal was to create a complete smartwatch with complete functionality.

What's left to go:

- Improving the software, adding more watch faces, adding apps and notification sync.

- Improving the android app and sync incoming calls and weather.

- Build a small PCB for with the STM32F407 or STM32F051, add battery (with voltage regulator and controller ic) , add a SPI 16MB flash memory to store all bitmaps.

- Use a BLE module instead of the HC-05

- 3D Modeling a case and manufacturing it.


  • 1 × 1.44" TFT LCD with ILI9163 was really cheap on ebay with 128*128 display resolution
  • 1 × STM32F4 Discovery since I decided to use an ARM cortex-m for this and what's better than this.
  • 1 × HC-05 Bluetooth module I beleive I will replace it later on with a BLE module from microchip or ST but for now it serves the purpose.

  • First time Surface Mount soldering

    Montassar12/12/2015 at 17:12 16 comments

    i finally got the ST chips I ordered from e-bay yesterday ( after over 40 days !!! ) .

    I went on and I tried to solder the LQFP48-package chips and indeed hand soldering these was a challenge. It's my first time as a hobbyist doing but I still mastered the courage to do it.

    Results ??

    Well it's not super clean and because I was unable to find solder wick in the near shop , I'm stuck with many bridges between the pins, at least untill the new stock is here.

    Notes:

    1) Solder wick is IMPORTANT.

    2) Positing the chip was hard because some of the pins were out of place.

    I will be working on a newer pcb version soon. I will also post updates about the current one , once i solder the rest of the stuff and I clean it.

  • PCBs from Oshpark are here !!!

    Montassar11/09/2015 at 15:59 0 comments

    I just got the PCBs I ordered from Oshpark today and I must say I'm really impressed by how fast it got here.

    I placed the order and it got automatically upgraded to Super Swift Service ( for free ! ) The boards were done within 6 days , shipped and It was here within 8 days ! Beauty , Thankx oshpark !!

    About the PCBs:

    These are breakout boards for the STM32F103CBT6 which I will be using for the next prototype. I ordered the MCUs from ebay and it should be here soon ( hopefully ).

    These are the boards I designed for "The Square Inch Project". More updates soon.

  • New board Arrival

    Montassar11/04/2015 at 19:08 0 comments

    New board arrived. A "MINI-M0" from Mikroe.

    A Quick unboxing reavels the board ( beauty ! ) . In the next log I'll be sharing the new prototype.

    * Meanwhile I'm waiting for the new PCBs from oshpark *

  • New Schematic Part 2

    Montassar10/18/2015 at 07:51 4 comments

    In the previous update, I posted a new schematic of a custom board for this project based on the STM32F407VG ( obviously ) . Soon after I decided to edit go over it again and remove some parts which I thought I can replace the regulator & the usb port and replace it with a 2 pin header that will later on connect to one of these cheap/small modules for voltage regulation and battery control.

    3.3V linear voltage regulator.

    LiPo battery charging module from sparkfun.

    I had 2 main reasons behind this decision : First is to reduce the work necessary to get this up and working later on & simplify the PCB design process as much as possible. The second is having these modules laying under the main board and reduce it height & width.

    The Gerber files will be soon submitted to OSHPARK if no one points something odd on the schematic.

    Currently in work:

    I'm currently working on the website for this project. It's gonna be a place where I share all the resources behind this project including schematic files, source code.

  • Custom board 1: NEW schematic !

    Montassar10/09/2015 at 16:31 0 comments

    For the last few days I've been working on the schematic for a custom board for this project.

    I had to search other people who managed to make something similar and also made use of the discovery schematic as well. The following is what I came up with:

    This was done with KiCAD. At first I was going to be using Altium's fairly new "Circuit Maker" which is a super cool piece of software but It required me to be coonect all the time which was not case.

    Overall this was fun and I'm looking forward for anyone's feedback on this.

  • Gaming added to the watch with CHIP 8

    Montassar09/03/2015 at 12:58 0 comments

    Before proceeding with the project log, let me thank all joined me in this and started following my project. I also apologize for not updating for a while.

    Ok, few days ago I came across lots of emulation info while trying to write my own NES emulator in C++ . Unfortunately I couldn't write a NES emulator but, I found an easier target which was the CHIP 8. Everything went smoothly and I did that and that's when I got the idea of writing the emulator for the smart watch.

    It was a super easy straightforward process that took me a day to write the emulator for PC and an hour to convert it for the smart watch.

    I found this amazing tutorial for writing the emulator at http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/ (You can read more about it there )

    Game screenshots:


    Brief notes:

    • The games are included in the code but I can load them directly from an sd card if I implement the write code (which can be a future goal)
    • The chip 8 outputs black and white graphics , the graphics are stored in an array (simulating the RAM in the actual system) as 0 (for back pixel) and 1(white pixel)
    • Each pixel in the display array is output as 1 pixel on the smartwatch display and since the chip 8 is 64 * 32 , you can see why the games are taking a small portion of the screen ( I have to out put it as 128 * 64 in the next update )
    • The CHIP 8 originally has 16 inputs for game play and all sort of control 1-9 & A-F .. However I have only 4 buttons on my smart watch , so that's another challenge.
    • Clicking the top button on the watch toggles between the watch face and the emulator , you can clearly see it in the video above.

    Conclusion:

    So far the watch :

    1. Has a decent watch face with the weather/time/date.
    2. Displays notifications.
    3. Has games which can be loaded on the CHIP 8 Emulator.

    Thinking outside of the box:

    The emulator is good for games but it's not just limited to the games actually. Other programs can be written for CHIP 8 and with the right code it can be loaded to the smart watch over Bluetooth to achieve something like what the pebble has.

  • Added Buttons ,Animated Weather Icons & Notifications

    Montassar07/31/2015 at 09:29 0 comments

    1) Added 4 buttons on the side:

    I soldered 4 of the buttons ( I got some vertical standing ones) on the side of the screen. These will be the main user input for the device.

    It is directly connected to PA1/2/3/4 and each button has an interrupt handler.

    The schematic is really easy for these: I have 3V going through each button and a capacitor for debounce handling ( I use 100nF in this case )

    PS: Using the vertical buttons turned out to be bad decision (hard to solder & easy to break after long period of clicking) . Do not use them !

    2) Animated weather icons :

    The next big thing is the weather icons now are animated. I got this done via creating a bitmap with the different frames of the animation , later on the function on the watch loops through the bitmap array each time display a part which matches certain frame.

    In this example I use 4 frames with 50*50 px for each one ( total of 50*200px)

    PS: I created these in photoshop.

    3) Notifications:

    Well, an essential part of this project was displaying phone notifications such as push notifications from different apps, messages , incoming calls.

    Now that is possible via a simple interrupt functions that checks what type of notification is and the content then display.

    The appinventor2 does not allow for application to run in background ( to keep monitoring & updating the watch) . That's why this is not fully what I need. I guess I will have to start writing a native app soon.

    *)Bonus:

    I wanted to convey what I was thinking from the start for this watch to end up like, so here is 3D model I made few days ago.

    Next step ?

    - On the software side :

    • Working on the native app
    • Adjusting the UI more and creating more attractive , more colorish UI and text.
    • Adding more watch faces.

    - On the hardware side :

    • The challenge of creating the final small pcb is still up and I need to buy all the components.

View all 7 project logs

Enjoy this project?

Share

Discussions

alpha_ninja wrote 12/07/2015 at 00:42 point

Hey there— I can't seem to find your design files. Could you post a link?

  Are you sure? yes | no

alpha_ninja wrote 12/02/2015 at 00:46 point
This is your one-week reminder to upload design documents: https://hackaday.io/project/7813-the-square-inch-project/log/28566-design-deadline

  Are you sure? yes | no

greenaum wrote 11/04/2015 at 21:13 point

It's the obligatory comment, I'm afraid... Would you consider selling these, manufactured? I'm much more of a software guy than a hardware one. Soldering something so tiny is a bit beyond my capabilities. But I've been wanting a watch I can program myself for years! I've got a mobile phone watch, but it's a single module, Mediatek's MTK6226, and I'm pretty sure there's not much room for custom software in there. Particularly without breaking the existing functions!

Shame cos it's a nice watch, cost about 50GBP. Has a resistive touch-screen with not-bad handwriting recognition, one character at a time! Bluetooth, keypad, colour OLED (I think). Ideal hardware. If only there was a way of hacking it! 


I'd love something I can write my own code for. Doesn't even need to be a phone itself. Talking of which, might be nice if you could put a little joystick in there as a control, and maybe a couple of buttons. Touchscreen too would be good. For a version of Freecell!

  Are you sure? yes | no

Montassar wrote 11/05/2015 at 20:26 point

Actually this project aims for this exact problem. The final watch itself will be more targeted towards developers and the maker community.

Hopefully once done ( soon ) I can setup a website for the code / schematics and have pre-made boards for sale ( for those who dont deal too often with soldering , like me ).

Stay tuned , thankx for sharing your thoughts !

  Are you sure? yes | no

Ramon Schepers wrote 09/14/2015 at 13:33 point

hi, i wonder how you will get everything in such a sleek case, i mean, the mcu, battery and screen take up quite some space (or you want to use a BGA instead of TQFP based mcu?)

  Are you sure? yes | no

Montassar wrote 09/14/2015 at 14:03 point

I don't think it's a challenge to get that done actually even with TQFP. All this needs is a MCU , BLE chip , voltage regulator & battery controller which can fit easily in 35 * 40 mm pcb. The thickness ( If I'm targeting something close to the pebble for example 11 mm ) 3 mm for the LCD 4 mm for the pcb & 5 mm for the battery (150 mA) is close enough. If I'm going to do this I'll definitely have to order custom pcb made & assembled so this is a bit expensive but there is no escape from that.

I recommend you take a look at Dave's teardown for the pebble time to see how they do it .

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates