Arduino with Crystal for more accurate Millis without RTC

nicolajna:
It was just a suggest which he can follow if he feels comfortable with it, or choose to ignore if he doesn't.

My posts are addressed to the public as well as the OP. Often it is more than just the OP that is the audience. Most people have no clue how difficult/easy or risky/safe some PCB rework can be. But most people over-estimate rather than underestimate their skill. So I put those comments there so someone might avoid destroying a board. It's not an attack on the suggestion itself.

aarg:
My posts are addressed to the public as well as the OP. Often it is more than just the OP that is the audience. Most people have no clue how difficult/easy or risky/safe some PCB rework can be. But most people over-estimate rather than underestimate their skill. So I put those comments there so someone might avoid destroying a board. It's not an attack on the suggestion itself.

I hear you and that's perfectly fine. I just personally think that even novices should be able to do this rework if they have the tools and with a bit of guidance. You have to start somewhere after all.

nicolajna:
I hear you and that's perfectly fine. I just personally think that even novices should be able to do this rework if they have the tools and with a bit of guidance. You have to start somewhere after all.

They should practice on scrap boards, first.
Paul

“ But most people over-estimate rather than underestimate their skill. “

@aarg, haha I know I’ve always done! And I have plenty of evidence to prove it...

a7

Are you open to using a different processor or form factor than the UNO?
The reason is that if you don't have specific processor requirements, power requirements or need 5v i/o pins and have WiFi available, you could use the built WiFI on the ESP parts to run NTP and have very accurate time with no RTC or added components. The ESP8266 & ESP32 Arduino platforms come with built in NTP support that runs in the background once configured so you don't have to do anything in your sketch to get accurate local time including DST adjustments.

I like to use the WeMOS mini's but you can get UNO factor boards like the Wemos D1 boards.

If you need more pins than what is available on the ESP8266 you could use the ESP32 which has similar options.

I really like using the ESP parts for projects since you can do so much with the built in WiFi to create IoT projects.

--- bill

You can find clone Uno’s with standard through hole HC/49 can crystals (and surface mount versions) all over eBay and Aliexpress. For example:

https://www.aliexpress.com/item/4000587200875.html

https://www.aliexpress.com/item/32790797739.html

Many thanks for all the replies.

If my project is successful I may need to scale up to 100-250 units quite quickly so making any modifications by hand to a board is not an option unfortunately. Needs to be off the shelf, plug'n'play and simple.

I will look into the boards suggested with RTC built in but seems these are different form factor, rare and unknown quality.

I will also look into understanding more about the firmware modification option although this scares me a little. Thanks for the code example.

I am open to using other form factors as long as they have enough pins but there will be no WiFi/Data connection so NTP not an option sadly. ES8226/ESP32 are too few pins for me in standard form.

I really like the most recently suggested UNO boards (from WattsThat) with 2 sliver crystals and think I will buy a couple of those and test out the time drift. I have to be honest I originally thought that the silver crystal was actually the ceramic oscillator (as most specs for Uno say ceramic) and didnt realise on my board this was just for the USB chip (didn't know that needed one). Now I know I can look for a board with 2 silver crystals or search for 'high quality' this should help in my search!

What is the reason that most Uno boards have a Crystal for the USB but only a ceramic for the ATMega?

Also is there any major reason why I shouldn't use an Uno board in a low cost Production product? Yes I could make my own board but what would be the point when these are tried+tested and so cheap? Is there a particular brand that is more production grade than others/has better warranty?

Thanks once again for all the contributions...

Uno doesn't allow for secure connections.
If you had a screw shield with your Uno that would really help to make connections secure & solid.
Example:

Most consider the Uno to be an oversized prototyping board and usually will replace it with the much smaller but essentially identical Nano board in the final product.
A Nano plus a external RTC would take up less room than an Uno by itself.

Of Course a Arduino MKR Zero is more powerful(32 bit) has a built in RTC and is the same size as a Nano.

The RTC on the Zero still uses an external 32K crystal which may (or may not) be accurate enough for what is required.

mypi-home:
What is the reason that most Uno boards have a Crystal for the USB but only a ceramic for the ATMega?

Price presumably. Resonators also require less external components than crystals typically do.

mypi-home:
What is the reason that most Uno boards have a Crystal for the USB but only a ceramic for the ATMega?

Most likely USB is highly timing critical. Your run-off-the-mill Arduino project not so much. Ceramic resonators are cheaper than crystals.

Also is there any major reason why I shouldn't use an Uno board in a low cost Production product?

Size, connections. I'd go for a Nano or Pro Mini though you may not be able to find one with a crystal. Not that much space on those boards.

There are Unos that do allow for secure connections - the clone board that I have comes with a row of holes right next to the female headers. It's possible to solder other headers or wires straight into that.

For 100-250 pc I'd roll a PCB myself. Easiest for those numbers, less soldering per board and a much more stable end result. You can add connectors and so for whatever you want to connect to it, just solder it on. If you don't want to use bare ATmega chips (not that hard, though) you can simply solder a Pro Mini or Nano on it. Works wonders, too.

For RTC you can add a simple RTC module such as the ChronoDot board. Can also be soldered securely onto your PCB.

Thanks for the further replies. Yes for the final product I do need screw terminals and a DIN rail mount and was going to use something like this: https://images-na.ssl-images-amazon.com/images/I/713joKVTWKL._AC_SX569_.jpg

I also need 10 Digital IO, I2C, Serial and 12v power input which is why I like the Uno. Space is not an issue. I'm just trying to use off the shelf product/components with warranties where possible and which can be put together with no soldering or modification.

Seems maybe with the smaller Arduino variants i have the issue of ceramic oscillators/inaccurate millis again? Would also have to think about the 3.3v implications too.

mypi-home:
Thanks for the further replies. Yes for the final product I do need screw terminals and a DIN rail mount and was going to use something like this: https://images-na.ssl-images-amazon.com/images/I/713joKVTWKL._AC_SX569_.jpg

I also need 10 Digital IO, I2C, Serial and 12v power input which is why I like the Uno. Space is not an issue. I'm just trying to use off the shelf product/components with warranties where possible and which can be put together with no soldering or modification.

Seems maybe with the smaller Arduino variants i have the issue of ceramic oscillators/inaccurate millis again? Would also have to think about the 3.3v implications too.

In that case have you considered looking at some of the Arduino compatible industrial solutions? Such as:
https://www.controllino.com/

Smaller doesn’t imply 3.3v. Faster often will. Just be sure you get the right ones.

And why don’t all UNOs come with that row or two of through holes next to the single inline connectors? I like them for test points and for direct wiring.

Your timing issue isn’t super critical, but if you do go with an RTC they can be very inexpensive, even the Chronodot can be if you shop around, although what I am seeing may be counterfeit.

I’ve had good luck with the cheap RTC modules - I accidentally got 8 packages of 5, 40 instead of the eight I wanted (!), now I just stick them on anything that ever might conceivably need one. TBH I use them for that accurate square wave output more often than for HH:MM:SS.

If you do a PCB the layout for an RTC chip is not too hard also.

a7

mypi-home:
Also is there any major reason why I shouldn't use an Uno board in a low cost Production product?

A particularly inconvenient form factor and the fact that it has socket strips instead of pins or just pads.

mypi-home:
Yes I could make my own board but what would be the point when these are tried+tested and so cheap?

Good thinking. A Nano - or Pro Mini since I doubt you need USB functionality - can be mounted with its pins on a custom PCB or "stripboard" or just protoboard, or a "screw shield" if it is more about wiring than adding extra components.

hzrnbgy:
The RTC on the Zero still uses an external 32K crystal which may (or may not) be accurate enough for what is required.

But 32k crystals are manufactured for just one specific purpose - as timekeepers!

1 Like

But 32k crystals are manufactured for just one specific purpose - as timekeepers!

Does that make them more accurate and stable than regular crystals? If it is, does that make it satisfy the requirement as put forward by the OP?

Well, that is what they are made for!

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.