{"id":255,"date":"2020-07-20T22:43:05","date_gmt":"2020-07-21T05:43:05","guid":{"rendered":"https:\/\/boom-tracker.com\/tracker\/?p=255"},"modified":"2020-07-20T22:43:07","modified_gmt":"2020-07-21T05:43:07","slug":"and-now-for-the-time-and-temperature","status":"publish","type":"post","link":"https:\/\/boom-tracker.com\/tracker\/blog\/and-now-for-the-time-and-temperature\/","title":{"rendered":"And now for the time and temperature&#8230;"},"content":{"rendered":"\n<p>I&#8217;ve been noticing that the microphone that has the DHT-11 temperature sensor consistently under-performs the other microphone in terms of how well is stays in sync with the NTP server.  I have documented <a href=\"https:\/\/boom-tracker.com\/tracker\/blog\/another-timing-bug-squashed\/\">previously<\/a> that trying to read a non-existent sensor caused major sync issues, but I now know that even if the sensor is working properly, it still throws the sync off slightly.<\/p>\n\n\n\n<p>On mic 001 (the one with the temperature sensor). I was seeing the average offset being somewhere around +\/-1300 microseconds, whereas on mic 004 (the one without the sensor or code to read it). I was typically seeing offsets of +\/-300-400 microseconds (1\/4 to 1\/3 as large).  So I disabled the DHT-11 on mic 001, and within 15 minutes the average offset was +\/- 400-500 microseconds, and the timing of received sound waves was much more in sync.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros.png\" alt=\"\" class=\"wp-image-257\" width=\"791\" height=\"551\" srcset=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros.png 971w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-300x209.png 300w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-768x535.png 768w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-250x174.png 250w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-550x383.png 550w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-800x558.png 800w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-258x180.png 258w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-430x300.png 430w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros-717x500.png 717w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><figcaption>I have no idea what this was, but both mics agree when it was.<\/figcaption><\/figure>\n\n\n\n<p>And zooming in on that first big positive peak you can see that they&#8217;re only about 400 microseconds apart, which is pretty good.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed.png\" alt=\"\" class=\"wp-image-256\" width=\"805\" height=\"561\" srcset=\"https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed.png 971w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-300x209.png 300w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-768x535.png 768w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-250x174.png 250w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-550x383.png 550w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-800x558.png 800w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-258x180.png 258w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-430x300.png 430w, https:\/\/boom-tracker.com\/tracker\/wp-content\/uploads\/2020\/07\/mic_001_004_1595300863_micros_zoomed-717x500.png 717w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><figcaption>.9093730-.909344 = .000386 seconds, or 386 microseconds difference<\/figcaption><\/figure>\n\n\n\n<p>It&#8217;s not the 100 to 200 microsecond offset I&#8217;m looking for, but I can live with this level of error.  <\/p>\n\n\n\n<p>Now what am I going to do with the temperature sensor?  I still need to be able to measure ambient air temperature to calculate the speed of sound accurately, but it was never a requirement that I have 4 of them or that they be co-located with microphones.  I have some spare ESP8266 feathers now, and while they&#8217;re not good for the microphones, I can easily re-purpose them to being a couple of temperature sensors.  I&#8217;ll play with low-power deep-sleep and have them wake up every 30 seconds or so to check the temp and report in.  That should give me a fairly accurate and current air temp. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been noticing that the microphone that has the DHT-11 temperature sensor consistently under-performs the other microphone in terms of how well is stays in sync with the NTP server. I have documented previously that trying to read a non-existent sensor caused major sync issues, but I now know that even if the sensor is&hellip; <a class=\"more-link\" href=\"https:\/\/boom-tracker.com\/tracker\/blog\/and-now-for-the-time-and-temperature\/\">Continue reading <span class=\"screen-reader-text\">And now for the time and temperature&#8230;<\/span> <span class=\"meta-nav\" aria-hidden=\"true\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"bgseo_title":"","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[3,9,8],"tags":[],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-blog","category-experimentation","category-implementation"],"_links":{"self":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":1,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/posts\/255\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/boom-tracker.com\/tracker\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}