{"id":7226,"date":"2026-11-03T19:23:19","date_gmt":"2026-11-03T18:23:19","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=7226"},"modified":"2026-11-03T19:23:19","modified_gmt":"2026-11-03T18:23:19","slug":"your-phone-as-a-time-server-for-arduino","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/","title":{"rendered":"Your Phone as a Time Server for Arduino"},"content":{"rendered":"<p>Every microcontroller project that logs data, schedules actions or shows a clock eventually needs to know the time. Getting it right is surprisingly hard: internal clocks drift, RTC modules need to be set, and NTP needs internet access, which you often don&#8217;t have in the field, in a workshop or on a battery-powered sensor.<\/p>\n<p>Yet the answer is probably in your pocket. A smartphone knows the time very precisely, from the network and from its satellite receiver. The idea behind this project is simple: <strong>let the phone share its time with your boards.<\/strong><\/p>\n<h2 id=\"three-projects-that-work-together\">Three projects that work together<\/h2>\n<p><strong>Android Time Services<\/strong> is an app that turns an Android phone into a small time server. It collects time from internet time servers, from the phone&#8217;s satellite receiver and from nearby Bluetooth devices, combines these sources into one reliable clock, and keeps going even when some sources disappear. It then shares that time in two ways: over Wi-Fi, using the standard Network Time Protocol (NTP), and over Bluetooth Low Energy, using the standard Current Time Service (CTS).<\/p>\n<p><strong>TinyNTP<\/strong> is a small Arduino library for NTP. It lets a board get the time over Wi-Fi or Ethernet, from the phone or any other time server, and it can also act as a time server itself.<\/p>\n<p><strong>TinyCTS<\/strong> is the Bluetooth counterpart. It lets a board get the time from a phone, a watch or another board over Bluetooth, with no network at all, and it can also serve the time to others.<\/p>\n<p>Together they give you a small, self-contained time network: the phone is the reference, and the boards pick up the time by whichever route suits them.<\/p>\n<h2 id=\"wi-fi-or-bluetooth\">Wi-Fi or Bluetooth?<\/h2>\n<p><strong>NTP over Wi-Fi<\/strong> is the natural choice when your board is on Wi-Fi anyway or needs the best precision. The phone can even provide its own hotspot, so this works without any internet connection as long as the phone can see the sky.<\/p>\n<p><strong>Bluetooth<\/strong> is the choice for battery-powered devices, places without a network, or simply &#8220;set the clock from my phone&#8221;. It uses little power, needs no setup, and the phone sends its time zone along, so the board shows the correct local time automatically.<\/p>\n<h2 id=\"it-works-in-both-directions\">It works in both directions<\/h2>\n<p>The app is not only a server. Boards running TinyNTP or TinyCTS as a server, for example with a GPS module or a precise real-time clock attached, can feed their time back into the app as additional sources. Boards can also pass time along: one board can fetch the time over Wi-Fi and then share it over Bluetooth with others that have no network.<\/p>\n<h2 id=\"where-things-stand\">Where things stand<\/h2>\n<p>The app is a working prototype, so far tested on one phone. The libraries run on popular boards such as the ESP32, the Raspberry Pi Pico W and Arduino&#8217;s Bluetooth-capable boards, as well as on Linux desktops. Feedback from other phones and boards is very welcome.<\/p>\n<h2 id=\"learn-more\">Learn more<\/h2>\n<ul>\n<li>Android Time Services: <a href=\"https:\/\/github.com\/pschatzmann\/Android-Time-Services\">https:\/\/github.com\/pschatzmann\/Android-Time-Services<\/a><\/li>\n<li>TinyNTP: <a href=\"https:\/\/github.com\/pschatzmann\/TinyNTP\">https:\/\/github.com\/pschatzmann\/TinyNTP<\/a><\/li>\n<li>TinyCTS: <a href=\"https:\/\/github.com\/pschatzmann\/TinyCTS\">https:\/\/github.com\/pschatzmann\/TinyCTS<\/a><\/li>\n<\/ul>\n<p>All three projects are open source. If you find them useful, you can support the work through the sponsorship links on their GitHub pages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every microcontroller project that logs data, schedules actions or shows a clock eventually needs to know the time. Getting it right is surprisingly hard: internal clocks drift, RTC modules need to be set, and NTP needs internet access, which you often don&#8217;t have in the field, in a workshop or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7227,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[20],"tags":[68],"class_list":["post-7226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","tag-time"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Your Phone as a Time Server for Arduino - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Your Phone as a Time Server for Arduino - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Every microcontroller project that logs data, schedules actions or shows a clock eventually needs to know the time. Getting it right is surprisingly hard: internal clocks drift, RTC modules need to be set, and NTP needs internet access, which you often don&#8217;t have in the field, in a workshop or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-03T18:23:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Your Phone as a Time Server for Arduino\",\"datePublished\":\"2026-11-03T18:23:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/\"},\"wordCount\":538,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/AndroidTimeServices.jpg\",\"keywords\":[\"Time\"],\"articleSection\":[\"Arduino\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/\",\"name\":\"Your Phone as a Time Server for Arduino - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/AndroidTimeServices.jpg\",\"datePublished\":\"2026-11-03T18:23:19+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/AndroidTimeServices.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/AndroidTimeServices.jpg\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2026\\\/11\\\/03\\\/your-phone-as-a-time-server-for-arduino\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Your Phone as a Time Server for Arduino\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Your Phone as a Time Server for Arduino - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/","og_locale":"en_US","og_type":"article","og_title":"Your Phone as a Time Server for Arduino - Phil Schatzmann","og_description":"Every microcontroller project that logs data, schedules actions or shows a clock eventually needs to know the time. Getting it right is surprisingly hard: internal clocks drift, RTC modules need to be set, and NTP needs internet access, which you often don&#8217;t have in the field, in a workshop or [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/","og_site_name":"Phil Schatzmann","article_published_time":"2026-11-03T18:23:19+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Your Phone as a Time Server for Arduino","datePublished":"2026-11-03T18:23:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/"},"wordCount":538,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg","keywords":["Time"],"articleSection":["Arduino"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/","url":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/","name":"Your Phone as a Time Server for Arduino - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg","datePublished":"2026-11-03T18:23:19+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2026\/11\/AndroidTimeServices.jpg","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2026\/11\/03\/your-phone-as-a-time-server-for-arduino\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Your Phone as a Time Server for Arduino"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/7226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=7226"}],"version-history":[{"count":1,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/7226\/revisions"}],"predecessor-version":[{"id":7228,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/7226\/revisions\/7228"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/7227"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=7226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=7226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=7226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}