nWatch - build and program your own smartwatch [160326]

nWatch is a device that you can program, and wear on your wrist. The first development board of this kind based on stm32 microcontroller.
Project
The aim was to build a development board shaped as a wristwatch. This form of a kit is much more attractive, because It's not only a tool for developing your programming skills. It is also a complete device that you can wear every day, and impress your friends J Besides, you can focus on the software part, because the hardware is fixed on the PCB. Unlike any other kit it has a built in li-po battery, and can be charged and programmed using only one cable.
Hardware
nWatch is really well equipped when it comes to internal peripherals. Below I present a full list of main components:
- Main controller STM32f407ZGt6
- External 4MB SRAM memory
- Nokia 6300 LCD with touch panel
- Micro sd card
- Mp3 decoder
- Position sensor set
- Bluetooth 4.0
- USB and SWD connector
- 3 physical buttons
- RTC clock
Of course there are some more - a li po charger, main step-down converter, backlight converter, touch controller. In the attachment you can find a full schematic.
I decided to add a feature of turning the device on in 4 ways. As you can see in the schematic the buck converter has an enable pin. This pin requires a positive voltage to turn on the converter, and thus the main controller. First and the most obvious way is the button. If you press it the voltage enables the pin, and from now on the CPU_ON line form the STM32 powers the EN line. If I want to put the converter back to sleep I have to put 0 on CPU_ON line. Second way is from the MPU6050. Enable line is connected to the interrupt of the sensor. The same thing goes with Bluetooth and RTC clock. However these two give an inverted signal ( 0 when active ) that is why there are transistors on these lines. Basically this is the „power management” of nWatch.
I added a voltage divider, with a feature of turning it on and off ( in sleep mode ), so that you are able to measure the battery voltage.
I think that was the most tricky part of the schematic. The rest are just other IC’s with their passive components.
Software
I mentioned earlier that nWatch is a development board, so how does it look like from the software side ? Of course you are able to make everything you want, but I've made some libraries easier to adapt to this device.
-Stemwin, a graphic library is used to run the lcd. It looks really professional, and the library itself is very well documented ( and supported by ST).
-FreeRTOS, a real time operating system library. It is used as a basic operating system. If you are making a more complex project it is a necessary thing.
-FATFS - well known library by elm-chan, which is used to communicate with the SD card.
- libjpg/ tjpgdec - libraries used for decoding jpeg images
- and many more for hardware control
With this project I would like to encourage more people to try programming. It can be really interesting, but sometimes people do not have enough motivation. I hope my watch can change something in their approach to this topic ;)
Peter.
The aim was to build a development board shaped as a wristwatch. This form of a kit is much more attractive, because It's not only a tool for developing your programming skills. It is also a complete device that you can wear every day, and impress your friends J Besides, you can focus on the software part, because the hardware is fixed on the PCB. Unlike any other kit it has a built in li-po battery, and can be charged and programmed using only one cable.
Hardware
nWatch is really well equipped when it comes to internal peripherals. Below I present a full list of main components:
- Main controller STM32f407ZGt6
- External 4MB SRAM memory
- Nokia 6300 LCD with touch panel
- Micro sd card
- Mp3 decoder
- Position sensor set
- Bluetooth 4.0
- USB and SWD connector
- 3 physical buttons
- RTC clock
Of course there are some more - a li po charger, main step-down converter, backlight converter, touch controller. In the attachment you can find a full schematic.
I decided to add a feature of turning the device on in 4 ways. As you can see in the schematic the buck converter has an enable pin. This pin requires a positive voltage to turn on the converter, and thus the main controller. First and the most obvious way is the button. If you press it the voltage enables the pin, and from now on the CPU_ON line form the STM32 powers the EN line. If I want to put the converter back to sleep I have to put 0 on CPU_ON line. Second way is from the MPU6050. Enable line is connected to the interrupt of the sensor. The same thing goes with Bluetooth and RTC clock. However these two give an inverted signal ( 0 when active ) that is why there are transistors on these lines. Basically this is the „power management” of nWatch.
I added a voltage divider, with a feature of turning it on and off ( in sleep mode ), so that you are able to measure the battery voltage.
I think that was the most tricky part of the schematic. The rest are just other IC’s with their passive components.
Software
I mentioned earlier that nWatch is a development board, so how does it look like from the software side ? Of course you are able to make everything you want, but I've made some libraries easier to adapt to this device.
-Stemwin, a graphic library is used to run the lcd. It looks really professional, and the library itself is very well documented ( and supported by ST).
-FreeRTOS, a real time operating system library. It is used as a basic operating system. If you are making a more complex project it is a necessary thing.
-FATFS - well known library by elm-chan, which is used to communicate with the SD card.
- libjpg/ tjpgdec - libraries used for decoding jpeg images
- and many more for hardware control
With this project I would like to encourage more people to try programming. It can be really interesting, but sometimes people do not have enough motivation. I hope my watch can change something in their approach to this topic ;)
Peter.
Discussie (15 opmerking(en))
emctvv 3 jaar geleden
Thanks!!
Mechanic 5 jaar geleden
can i buy this watch? And if can hhw much would it cost?
Qwertyytrewq 5 jaar geleden
rjv 5 jaar geleden
Qwertyytrewq 5 jaar geleden
Great project ,
Could you please send screenshots of the apps
ALFREDO Hp PEREZ 5 jaar geleden
Jan Visser 5 jaar geleden
https://www.elektormagazine.com/magazine/elektor-201707/40501
Alireza Stm 6 jaar geleden
this altium file is ok? and can trust it for make ?
how i can find frimware for program the STM ?
Jan Visser 5 jaar geleden
https://www.elektormagazine.com/magazine/elektor-201707/40501
goutham gumm 7 jaar geleden
where can i find the code for this project?
Jan Visser 5 jaar geleden
https://www.elektormagazine.com/magazine/elektor-201707/40501
Samiii 7 jaar geleden
I also want to build this Smart Watch.
I've just the problem that I haven't got the right connector for the display.
May you tell me which display and which connector you have used?
BR
Samuel
Samiii 7 jaar geleden
ok, thanks for your help.
I will see whats the easiest way for me.
Best Regards
Samuel
klonyyy 7 jaar geleden
The connector I used is the unsoldered conncetor from nokia phone (as well as the display). Maybe You will be able to find a new one on the internet, but unsoldering is the cheapest way ;)
Peter.
Matthias Pleschinger 7 jaar geleden
your nwatch is great. I would like to build it on my own based on your article. But I have a problem to find the right touch panel and the S1-S3 buttons. Can you please give me further information or links where you have bought these parts?
Thank you very much!
Matthias
rjv 7 jaar geleden
for the switches s1,s2,s3 you can take a look at the following link.
https://www.maritex.com.pl/przelaczniki/przelaczniki_typu_tact_switch/laczniki_tact_switch_katowe_do_montazu_smt/tactdr345h40b160.html
manufacturer is Innocent Electronics, typenr : int-1125VSE35A
gyrolen 8 jaar geleden
What a great project, especially from such a young student.
You have great talent and dedication, I am sure you will go far and I look forward to seeing other projects from you in the future.
Merry Christmas
Len - FF from OZ
klonyyy 8 jaar geleden
Thank you for these kind words. I feel very motivated when people say that this is a good project, and I hope I will fulfill your expectations with future projects ;)
greetings,
Peter.
Piyush Pandey 8 jaar geleden
Your project is quite good and very interesting. But is it completed or is still under development.
Also if you have completed it that could you please share the source code files of it.
Also I think the pcb is hand made as it can be seen from pictures which you have posted.
So can you please tell us what procedure you used in order to make the pcb for it.
regards
klonyyy 8 jaar geleden
If we are talking about the PCB. It took me some time to finish the layout, and what you can see is, I think, the second or third version. Although It has a loong way to a perfect PCB ahead. This is the skill I would like to learn. To make a PCB that is well designed and thought through, not only routed without any order. When a friend of mine started talking about a lecture he had attended to, I relized how much work and time it takes to design a proffesional PCB.
To make this board "perfect" I should use at least 4 layers - one of them should be a polygon of ground, and the other a polygon of positive voltage and then remaining two for traces. My friend explained that they make a really low capacitance capacitor together ( but this is the point where my knowledge ends ).
When someone talks about it it is very interesting, though when I try to read books about PCB design it's not that easy and eventually I give up.
So you shouldn't consider my pcb as a well designed - I do not want to confuse people :P
I can tell you that I have made dozens damaged of PCB using dry film method. The biggest problem was with developing after the exposure , but in the end I succeded with a substance dedicated to develop negative film ;)
It will be easier for me to help you if you post a photo of the unsuccesful board.
I'm eighteen now, but I started quite early ;)
Peter.
Didan J Ribeiro 8 jaar geleden
Regards,
Didan
klonyyy 8 jaar geleden
Thank you ;)
The schematic & PCB are made in Altium. I added them in the attachement.
The idea is mine, and was born about 3 years ago when I decided to build a cheat watch for my school history exams. Then I realised that the watch can be used in different, more useful way. To be honest, these watches helped me to learn programming and I thought it is worth sharing with other people ;)
The schematics are mine as well, of course I based on datasheets, but not on any other finished projects.
greetings,
Peter
Didan J Ribeiro 8 jaar geleden
klonyyy 8 jaar geleden
https://www.youtube.com/watch?v=cRCFGZxmob0
Although I do not use the transparent foil, but a carbonpaper. It gives good results, but the best are on transparent foil and ink printer.
Another tutorial I based on :
http://www.instructables.com/id/Dry-Film-Photopolymer-for-making-circuit-boards/
And the dry film itself :
https://pl.aliexpress.com/wholesale?catId=0&initiative_id=SB_20161218021452&SearchText=dry+film
Hope I helped you a bit ;)
Peter.
Piyush Pandey 8 jaar geleden
just post the link of youtube and others sites you used as reference.
Also can you please tell me that whether you used negative photoresist film or the photoresist paint for developing the PCB.
klonyyy 8 jaar geleden
Piyush Pandey 8 jaar geleden
Thanks for your reply and for posting the source code to the github.
Also as you have mentioned that you used the negative photosensitive method to prepare the pcb on your own , I want you to do me a small favour , could you please post all the links and references which you have used in your journey throughout this project for both the software and the hardware.
regards
klonyyy 8 jaar geleden
It's great to hear that the project is quite interesting ;)
David Van Balen 8 jaar geleden
Awesome work ! Congratulations !
klonyyy 8 jaar geleden
Thank you !
The project for now is almost finished. With Elector team I will be able to make a watch that is prepared as a kit. However it will take a few more months from now.
If we are talking about the source code, you will find it here:
https://github.com/klonyyy/nWatchv2
But please do not be afraid of the size. It has many files, but not all of them are used. Moreover they are messy and not optimized. Due to a long time of development I had to test different solutions, and this is why there are so many files.
The pcb, as you noticed, is fully handmade. I had to make the prototype fast, sometimes the clearances between traces are less than 5 mils, and I would have to pay extra if I wanted to make it in a PCB company. That is why I decided to make it myself. It wasn't an easy process though. I am using the method with negative photosensitive film (cheap one from Aliexpress). The whole process is well described in the internet, but requires some experience to make thin traces, or any other tricky parts of the pcb. The worst process is driling and making vias - I was using a piece of wire and soldering its both sides to the trace. So generaly speaking a very good way of making PCB, but the real problem are vias :)
Greetings,
Peter.
gavb 8 jaar geleden
Also, running MicroPython on it would be interesting.
klonyyy 8 jaar geleden
There are many problems with sleep modes of the core. Sometimes it might not put all gpio's low and some of them may draw current during the sleep what is unacceptable. Second thing are pullup resistors etc. they might use the baterry as well, and when we sum up the current is around few miliamps instead of 0.2 mA. Though I do not find it as a drawback of the watch. You can always use the backub domain on STM32 to store the most important data.
Of course the idea of connecting the interrupt lines to CPU is very good, and I will keep it in mind. For now when the watch is woken up you have to check flags from each device, and that is how you find the source of interrupt ;)
gavb 8 jaar geleden
Also, it might be a good idea to take: mpu_int, rtc_int and ble_int to CPU so that interrupts can be used in s/w drivers (not just as wake from sleep), they could also be used to find which device was responsible for wake up.
klonyyy 8 jaar geleden
When the display and all pheriperal are working the power consumptiom is about 150 mA. That is quite a big current for a small battery.
I have not used microphyton, so I cannot tell you more about that.
Greetings,
Peter
Werner-L 8 jaar geleden
klonyyy 8 jaar geleden
klonyyy 8 jaar geleden
Regards,
Peter.
David Van Balen 8 jaar geleden
With PCB, of course.
What about the case? 3D printed, I guess ?
And one precision, pls: what are the frequencies of the crystals used ?
klonyyy 8 jaar geleden
If we talk about crystals you can use 8mhz 16mhz 25mhz, and the only thing you are obliged to do is change the config file.
Besides the main crystal you also need 32.768khz for the rtc clock and 12.288Mhz for the mp3 decoder.
Greetings,
Peter.
hoteloskar 8 jaar geleden
I bougth it some years ago in order to build a software for a golf score counter. But programming of the eZ430 was very hard and I had no success.
Maybe I can give it another try with this nWatch.
What about a parts kit?
Hans
klonyyy 8 jaar geleden
Thank You for the interest in my project.
If we are talking about kits, I hope elector will help me to make a fully functional kit, and then You will be able to buy it in the Elector store as many other project kits.
Regarding the programming - its not that easy but I cannot say it is hard as well. nWatch is based on Stm32 processor so if you have any troubles, you will definitely find many examples in the internet. No worries ;)
greetings,
Peter.