Author Topic: Suggest a microcontroller for a DIY PCB watch  (Read 3090 times)

0 Members and 1 Guest are viewing this topic.

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: gb
    • Woofys Place
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #25 on: March 14, 2025, 04:36:13 pm »
You should also allow for some load capacitors on the 32.768KHz crystal. Something like 12-18pF each side to ground should be ok.
 
The following users thanked this post: tellurium

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4992
  • Country: nl
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #26 on: March 14, 2025, 04:55:13 pm »
Without the VDDA connected to the supply voltage the internal oscillator and LSE might not run. I know from experience that a STM32F103 does not start when VDDA is not connected.

As you are running from a battery and the caps on the supply pins of the MCU are only for decoupling I would reduce them to 100nF.
« Last Edit: March 14, 2025, 04:57:50 pm by pcprogrammer »
 
The following users thanked this post: tellurium

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #27 on: March 14, 2025, 05:46:24 pm »
Thank you pcprogrammer & woofy!

woofy, could you elaborate on a reason a ceramic cap makes a difference, what's special about it?
« Last Edit: March 14, 2025, 05:55:40 pm by tellurium »
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: gb
    • Woofys Place
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #28 on: March 14, 2025, 05:54:41 pm »
Multi-layer ceramic caps have a low inductance. If you use an aluminium electrolytic they have a small inductance because they are wound internally. That inductance can cause a voltage drop on fast internal switching inside the processor. I would change them to 100nF caps as pcprogrammer suggested.

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #29 on: March 14, 2025, 05:59:24 pm »
Done, thank you!
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4992
  • Country: nl
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #30 on: March 14, 2025, 07:30:23 pm »
It is probably best to also add a decoupling cap on VDDA. Depends a bit on how you can place the cap on pin 1 and route the VDD to pin 5. The decoupling caps should be as close as possible to the pins, with not to thin power traces.

Another thing is that you did not value your series resistors on the LED's. They depend on the LED forward voltage and the supply voltage and the amount of current you want running through them. Depends also on if you are going to use PWM to control the brightness. Modern SMD LED's don't need a lot of current to be bright, so you might want to experiment with it for the different colors you are going to use.

It might also be a good idea to add a 1uF cap from reset to ground, to delay the startup on battery insertion. May not be needed here, but good practice in other MCU designs with for instance power supply via USB.

As a side note, you started of with a bad habit of schematic drawing. I do this too when in a hurry or can't be bothered to much, but it is better to use wires instead of those net labels to make the connections. With a simple design like this it makes not that much difference, but it improves on readability.

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #31 on: March 15, 2025, 05:46:00 pm »
pcprogrammer, thank you for those tips, appreciated!

LED resistors are all 1k Ohm.

W.r.t. wires vs net labels - I did not know that. Could you give an example of a good schematic to illustrate the point, please?
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4992
  • Country: nl
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #32 on: March 15, 2025, 06:34:09 pm »
W.r.t. wires vs net labels - I did not know that. Could you give an example of a good schematic to illustrate the point, please?

You are using EasyEDA by the looks of it. With this you can export your schematic. Menu option File->Export->EasyEDA. Upload the export here and I will redraw your schematic to show you what I mean with the wires versus the net labels.

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #33 on: March 15, 2025, 10:33:20 pm »
Here it is. Zipped cause eevblog does not like attaching .json.
Thank you.
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4992
  • Country: nl
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #34 on: March 16, 2025, 08:42:49 am »
Here you go, your schematic redrawn with wires.

I modified the reset part to correct it to how it should be. Also removed the VDD from the connectors for programming. Why, because it is a battery driven system, and when the battery is placed it is not a good idea to supply a voltage to it without any protection.

An option can be to add a separate connector for supplying power, but this still can hurt the battery. This is something to think about.

For the LED resistors, your choice to use 1K ohm for them all can bite you in the behind, brightness wise. Best to test this before making a final design.

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #35 on: March 16, 2025, 05:20:54 pm »
pcprogrammer,
that is way more than I expected, thank you so much.
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4992
  • Country: nl
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #36 on: March 16, 2025, 07:07:42 pm »
pcprogrammer,
that is way more than I expected, thank you so much.

No biggie, and you are welcome.

Offline ColinB

  • Contributor
  • Posts: 31
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #37 on: March 24, 2025, 04:46:51 pm »
I must be missing something huge here, but surely a watch

- needs to run for a fair time on the battery (it is debatable whether the almost daily removing it from the wrist to charge it, is a hugely cynical play on fashionable smart watches)

- needs to be accurate

What CPU do Garmin use in their £800 top end watch? They claim ~50 day battery life but that is only if you basically don't do anything with it ;) It is really fat, to accommodate the battery.

Re accuracy, you can have a periodic GPS sync. But all smartwatches do very little without a bluetooth connection to a smartphone.

There are a wide array of what people consider a "watch". As opposed to a wrist-worn personal computer.

You have to really want the smart watch experience to have a device that needs to be charged every day. But if OP wants to make a watch that uses LEDs as the display, then the LEDs are going to use significant energy and unless they are somehow turned off for the vast majority of the time, it will have to be charged frequently, it seems.

As for accuracy, average 32.768 kHz crystal is good enough for normal watches. Just needs manually synchronized to the second every couple of weeks. You could do temperature compensation in firmware to increase accuracy also.

You could use Bluetooth to synchronize time automatically (e.g. Device Time Profile  https://www.bluetooth.com/specifications/specs/dtp-1-0/)

Now Garmin is an interesting example since it has good battery life but also a lot of features including GPS. They obviously are using a CPU/microcontroller that allows good low-power operation, but also they must have made some good design decisions and quality implementation of firmware and hardware, so they get my respect for that.
 
The following users thanked this post: tellurium

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16280
  • Country: fr
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #38 on: March 24, 2025, 06:52:04 pm »
Well, +/- 1 s per 2-week period is about 0.8 ppm. Not something you're very likely to get with an "average" 32768 Hz crystal (which will be more like +/- 30 ppm) and no special additional measure IMO, but YMMV.

(30 ppm over 2 weeks is about 36 s, just to get some perspective.)
 
The following users thanked this post: tellurium

Online Picuino

  • Super Contributor
  • ***
  • Posts: 1202
  • Country: es
    • Picuino website
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #39 on: March 24, 2025, 07:00:19 pm »
« Last Edit: March 24, 2025, 07:19:15 pm by Picuino »
 

Offline peter-h

  • Super Contributor
  • ***
  • Posts: 4591
  • Country: gb
  • Doing electronics since the 1960s...
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #40 on: March 26, 2025, 10:23:01 pm »
Watch mfgs do proper calibration in production, probably 2-point i.e. at 2 temps. You have to do that if using a cheap 32768Hz xtal.

Swiss "chrono" watches need to achieve < 7 secs per day, which is what you get on a 10,000 quid IWC etc - well from one 600 quid service to the next a year later ;)

Or you could assume it will be worn, so +35C or so :) and then cal it at just that one point. But if it draws as much power as this one will, it likely won't be worn during the night (that's the case for most smartwatches) and then you have a problem...

There are drift offsetting methods used in the precision analog chip business, which let the device warm up and drift due to that and you measure the drift and extrapolate the curve from that. I was doing this in the 1970s on precision HV power supply feedback resistors. It is much quicker than heating up the product during production to get the 2nd cal point.

If there is not enough self-heating then you can incorporate a resistor next to the xtal which is connected to test probes for the heating.

However in this case I suspect the purpose of this exercise is to develop an application note for some software libraries, so it doesn't need to be super polished. One would be hard pushed to compete with the 800 quid Garmin product, which probably runs for a week or so between charges. And which doesn't do a whole lot anyway unless there is a BT-connected smartphone.




Z80 Z180 Z280 Z8 S8 8031 8051 H8/300 H8/500 80x86 90S1200 32F417
 
The following users thanked this post: ColinB

Offline telluriumTopic starter

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ua
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #41 on: April 07, 2025, 07:50:52 am »
Got 5 PCBs from JLCPCB, with 2 of them assembled. Battery they did not assemble, and also did not ship either - so need to deal with it later.
I've created a repo where I posted both hardware and firmware sources, https://github.com/cpq/watch . Firmware code with time display and time setup logic is implemented and tested.

Left to do:
- (hardware) battery
- (software) proper clock setup, currently a default is used, which is an internal oscillator IMO
- (software) proper low power sleep / wakeup on button press

Quick question. Any tips can I measure power consumption for the assembled board? The relevant equipment I own is this:
- Tenma 72-7745 multimeter
- Miniware DS213 mini oscilloscope

Thank you all, your help so far was invaluable.
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 413
  • Country: gb
    • Woofys Place
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #42 on: April 07, 2025, 08:12:29 am »
Dave used to sell the ideal device for this, but its not been available for a while:
https://eevblog.store/products/ucurrent-gold-multimeter-adapter?_pos=1&_sid=bdaecbd89&_ss=r

Another forum member has just found two of them that have been lost for 12 years.
https://www.eevblog.com/forum/chat/2-ucurrents-found-after-moving-my-lab-halfway-across-the-world/
Maybe you could come to some arrangement together.
 
The following users thanked this post: tellurium

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2707
  • Country: gb
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #43 on: April 07, 2025, 10:36:30 am »
Or you could assume it will be worn, so +35C or so :) and then cal it at just that one point. But if it draws as much power as this one will, it likely won't be worn during the night (that's the case for most smartwatches) and then you have a problem...

The turnover temperature of watch crystals is typically 25C as the watch temperature is lower than wrist surface temperature.

Firmware applied rtc temperature compensation may or may not be useful here (e.g. watch spends nights off-wrist, or many days at cooler temperature, if you care). For academic interest, there is a fun technique of temp comp using two crystals.
https://bhi.co.uk/wp-content/uploads/2023/12/12-HJDecember23-AOTM.pdf
 
The following users thanked this post: Picuino

Offline Tation

  • Regular Contributor
  • *
  • Posts: 147
  • Country: pt
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #44 on: April 07, 2025, 02:58:35 pm »
Quick question. Any tips can I measure power consumption for the assembled board?

this Nordic tool is aimed at measuring consumption of devices that show current peaks (as sleep - awake - sleep). Not much expensive, IMHO.

Note that I have not used it.
« Last Edit: April 07, 2025, 05:56:47 pm by Tation »
 
The following users thanked this post: tellurium

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2707
  • Country: gb
Re: Suggest a microcontroller for a DIY PCB watch
« Reply #45 on: April 07, 2025, 03:34:51 pm »
Quick question. Any tips can I measure power consumption for the assembled board?

Yes indeed, the Nordic PPK2 is well worth the modest price.
 
The following users thanked this post: tellurium


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf