Close
0%
0%

SUhr

BLE-enabled ATMega based smartwatch in a case suitable for everyday use

Similar projects worth following
Impressed by Max.K's Chronio watch I thought I'd give it a try and create my own MemoryLCD watch. However, I didn't want to follow his minimalistic approach, and instead add some features like BLE, vibration, backlight, accelerometer, magnetometer etc. It's based on an ATMega1284P, uses an RN4871 BLE module and a FLEx Lighting backlight. For time-keeping the asnychronous mode of Timer2 in the ATMega1284P is used with a 32.768kHz crystal, saving a separate RTC. Also I'm hoping to design a simple and cheap case that is nonetheless suitable for everyday use (protective glass, at least a little water resistant, fully waterproof/resistant probably not feasible for me).

As I'm already 1.5 years into this project, but missed to write anything up, this is a mix of an overview on the project and a mostly chronological log.

Some Design choices

As I most often use ATMega uCs in my projects, I decided to stick to that here as well.

As the 96x96px Sharp Memory-LCDs are not in production anymore, I use the newer LS013B7DH03 128x128px display. This means I need some RAM for the framebuffer. Thus the choice of the ATMega 1284P as uC.

As my analog design-skills are limited (and RF skills practically non existent), I decided to use an integrated module, the Microchip RN4871, that also brings some certification. That of course means this watch will never reach a power consumption as low as an NRF or STM32 standalone solution with integrated radio would allow. However, a couple of days of runtime should be OK, and it's still a learning project.

The RN4871 cannot be used with the maximum of 4.2V expected from the Li-Ion cell, hence a 3.3V regulator is needed. Also, according to the datasheet the ATMega is not guaranteed to run stable at 16MHz and 3V. However, I need to be able to communicate with 115200 baud to the RN4871. Hence, the main clock frequency of choice is 7.3728 MHz allowing for no baud rate error at 115200 baud and stable uC operation.

The main sensors are provided by an LSM303 (magnetometer, accelerometer).

First (round) version

As I do not like rectangular watches too much, the first version was designed as a round watch with an outer case diameter of 46mm (yes, uff quite large). I liked Max.k's idea of using coin cells as you can get replacements everywhere, but due to the higher consumption I decided to use a quite large rechargeable LIR2450 lithium ion cell. Due to the respective coin cell socket this lead to a pretty large 17mm body height. So this design was very unhandy as a watch, but left enough place to fiddle around and fix mistakes I made in the first design.

The case was 3D printed with HP Multi-Jet Fusion (means I ordered it instead of printing it myself). My FDM printer doesn't allow for sufficient surface quality on the overhangs. The buttons, back cover and glass are sealed with o-rings. The o-ring is also what keeps the glass in place. (The above image doesn't show glass and display as I already scavenged those for the second version). Arguably, o-rings don't really seal on a rough 3D-printed surface, but it's better than nothing. From a mechanical point of view this worked great. The buttons were easy to push and you needed serious force to press the glass out of the case. Only the back was a little too thin to provide sufficient pressure on the o-ring all around the circumference, but the missing pressure was supplied by the arm while wearing.

Programming and charging are both done via a waterproof micro usb connector (which is also quite large).

As a backlight I found the integrated modules by FLEx lighting to be the easiest option (FLEx lighting 11049-03).

In order to keep the BOM short I thought I'd stick to the internal RC-oscillator as main clock for the uC (not for time keeping). This means the RC oscillator is calibrated to approx. 7.3728 MHz on each boot based on the 32kHz clock crystal on Timer2 (PDF ATMEL AppNote). This worked pretty well, but takes some time during booting and I wasn't able to fit the calibration code into the Bootloader. That means the bootloader runs on the regular, inaccurate 8MHz clock and thus the programming transfer rate is limited to 9600 baud. This is quite unnerving when fiddling on small things in the code.

In addition to the vibration motor the PCB features a CUI piezo speaker, but after testing the watch for a couple of days I decided that I don't need a speaker if I have a sufficiently strong vibration motor. Also the speaker takes up quite a lot of space on the PCB.

Besides some quirks (as discussed in the following list) the hardware worked pretty well.

Anyway, I of course made a lot of mistakes and...

Read more »

SUhr_Dock.stl

Docking station for printing

sla - 189.54 kB - 02/22/2021 at 18:51

Download

SUhr.pdf

Schematic of the mostly working second version

Adobe Portable Document Format - 90.65 kB - 02/01/2021 at 20:50

Preview
Download

second_rectangular_version_compilation_in_printing_cage.stl

Second (rectangular) version compilation in printing cage. This can be printed as a single part with MultiJet Fusion. The cage holes are big enough for the remaining powder to exit (although the manufacturer claimed they don't suffice).

sla - 1.13 MB - 02/01/2021 at 10:45

Download

second_rectangular_version_button.stl

Second (rectangular) version button

sla - 224.59 kB - 02/01/2021 at 10:45

Download

second_rectangular_version_top_case.stl

Second (rectangular) version top case

sla - 228.99 kB - 02/01/2021 at 10:45

Download

View all 9 files

  • 1 × ATMega1284P Microprocessors, Microcontrollers, DSPs / Microcontrollers (MCUs)
  • 1 × RN4871 BTLE
  • 1 × LSM303AGR magnetometer accelerometer
  • 1 × Jinlong Z32TH7B2882001D vibration motor
  • 1 × MCP1811 voltage reg.

View all 12 components

  • Code published on Github

    vch102/22/2021 at 19:05 0 comments

    I finally got around to publish the code: https://github.com/joemmert/SUhr

    I wanted to change something on the Adafruit font I was using. Because it was pretty complicated to do this in the hex codes directly. Hence, I wrote a short python script to graphically work with these 5x7 fonts. However, after tinkering some more things got out of hand and I somehow ended up creating completely new font. Its not better than the Adafruit one (it's definitely worse), but now it's really easy to change things.

    You find everything in the Fontgenerator folder. When you start the script it loads the current font state. You can choose the character number in the number field. Then you change something and close the window, and it automatically saves the changes. When you click the compile button the font is compiled into a header file that can be moved into the arduino sketch folder and done. So not the most advanced code, but short code and easy to use.

    Also a short note on battery life: I'm currently using the second version every day, including the alarm to wake up. Without a lot of optimizations I currently have 10+ days of battery life (I always recharged at 3.35V). I guess I still can fiddle a little with the digital input buffer state to get some more out of it. Also BLE is currently still inactive. We'll see what BLE will cost in terms of battery life as soon as I cleaned up the BLE code.

View project log

Enjoy this project?

Share

Discussions

Alvaro wrote 03/30/2021 at 23:31 point

Hello. Thank you for including me in your project. I will look for some way to help. Thanks

  Are you sure? yes | no

Mike Szczys wrote 02/16/2021 at 15:51 point

I'm also guilty of going way too long before writing down details my my projects. Glad you got around to it though, this looks great! I love the pogo-pin setup. When you did conformal coating of the board, how did you keep it away from the pads for those connections?

  Are you sure? yes | no

vch1 wrote 02/17/2021 at 07:29 point

Thanks a lot! I'm using a spray coating, so no dipping or similar. Hence, it was sufficient to simply put Kapton/polymide tape on all switches/connectors/pads. The pogo pads therefore were the simplest part. The switches were a little more laborious to get "spray-proof".

As I already had to do this for another project on a couple of identical PCBs, I started thinking about how to make this easier. If I'll again have to do a small series of PCBs I will probably print a 3D mask from flexible filament, speeding up everything.

  Are you sure? yes | no

Matthew James Bellafaire wrote 02/10/2021 at 16:23 point

Nice project, I've been working on my own smartwatch based on the ESP32 for awhile. I see you're including BLE in your project, if you're interested I created an open-sourced android application that can feed android notifications over BLE (https://github.com/Bellafaire/Android-Companion-App-For-BLE-Devices) along with a few other features. 

  Are you sure? yes | no

vch1 wrote 02/10/2021 at 18:13 point

Thank you! Yes, I'm already following your project which is really impressive, especially software and UI. I'm definitely interested in your app, but I'm currently only running SailfishOS on my phones. However, maybe I'll switch again. Reading the notifications cost me a lot of time when writing my Sailfish companion app, so it's great that this is already there. Also I see that you are using a command interface that is very compatible with the transparent UART feature of the RN4871 modules I'm using (means you are also simply writing command strings to a single characteristic). So this could be adapted easily. I'll definitely get in touch with you when I'm switching to Android again.

But for now my first goal is to write a robust BLE driver for the watch firmware instead of the old messy code. Previously pairing was handled by manually switching the module into an "pair with everybody" mode, then pairing, and then adding the paired device to a whitelist  before locking the pairing mode again (everything manually via UART console). After this is realized in a nice menu driven workflow on the watch, I will get back to companion apps.

  Are you sure? yes | no

Jeff Cooper wrote 02/05/2021 at 16:03 point

This is so cool! I've been working on my watch[1] for about the same amount of time, and it's cool to see where we made the same design decisions (or different ones). Looking forward to seeing where this goes!

[1] https://hackaday.io/project/169967-nrf52-smartwatch

  Are you sure? yes | no

vch1 wrote 02/05/2021 at 19:08 point

Thanks a lot! Yes, I just rediscovered your project a couple of hours ago. I remember viewing it nearly a year ago, but somehow lost track. Now I'm following, and looking forward to getting some good design hints ;-) It's amazing how you crammed such a huge 500mah battery into such a thin case.

  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