<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Vinnie’s Views]]></title><description><![CDATA[It’s about independence
built from code, steel, and stubbornness.]]></description><link>https://www.vinthewrench.com</link><image><url>https://substackcdn.com/image/fetch/$s_!Vix4!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdba2dcc7-51bb-4fcd-ae79-72b2f75e08d0_1019x1019.png</url><title>Vinnie’s Views</title><link>https://www.vinthewrench.com</link></image><generator>Substack</generator><lastBuildDate>Sat, 01 Aug 2026 20:27:57 GMT</lastBuildDate><atom:link href="https://www.vinthewrench.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Vinnie Moscaritolo]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[vinthewrench@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[vinthewrench@substack.com]]></itunes:email><itunes:name><![CDATA[Vinnie Moscaritolo]]></itunes:name></itunes:owner><itunes:author><![CDATA[Vinnie Moscaritolo]]></itunes:author><googleplay:owner><![CDATA[vinthewrench@substack.com]]></googleplay:owner><googleplay:email><![CDATA[vinthewrench@substack.com]]></googleplay:email><googleplay:author><![CDATA[Vinnie Moscaritolo]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Self-Hosting Without the Exposure]]></title><description><![CDATA[How to access your self-hosted applications with Cloudflare while keeping your home network private.]]></description><link>https://www.vinthewrench.com/p/self-hosting-without-the-exposure</link><guid isPermaLink="false">https://www.vinthewrench.com/p/self-hosting-without-the-exposure</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sat, 01 Aug 2026 20:18:55 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!JQIY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JQIY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JQIY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JQIY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg" width="600" height="321" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JQIY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JQIY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb0e4d57a-cb9b-4376-9555-1e39ce8bed67_600x321.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;ve written a couple of articles lately about some of the dashboards I built for the farm. One lets me keep an eye on the <a href="https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation">irrigation system</a> and shows me the schedules, valve activity, and what&#8217;s going on with it. Another is connected to my <a href="https://www.vinthewrench.com/p/build-your-own-off-grid-weather-station">off-grid weather station</a>, where I can check the current conditions, watch the trends, and dig back through the history.</p><p>These sites work great on my local network, but now and then I leave the ranch to pick up chicken feed, or maybe just have a life, and I still want to check up on things.  The problem is, how do I get to my sites without inviting every smelly script-kiddie wannabe, AI bot, or <a href="https://media.defense.gov/2024/Feb/07/2003389935/-1/-1/0/CSA-PRC-COMPROMISE-US-CRITICAL-INFRASTRUCTURE.PDF">Beijing-sponsored cyber rats</a> to come knocking?</p><p>So I had to find a balance between wanting complete control over my self-hosted systems and the convenience of reaching them from anywhere, without hanging my home network out on the open Internet.</p><p>What I discovered is that it doesn't have to be all or nothing. I can still own the hardware, control the software, and keep the data on my own servers. The key is putting Cloudflare in front as the secure front gate to everything behind it.</p><h3>What&#8217;s a Cloudflare?</h3><p>You&#8217;ve probably used <a href="https://www.cloudflare.com/">Cloudflare</a> hundreds of times without realizing it. Ever click on a website and get that little &#8220;Verifying you are human...&#8221; screen before the page appears? </p><blockquote><p>Am I the only one who finds it ironic that a machine is asking a human that question?</p></blockquote><p>That&#8217;s Cloudflare at work. It&#8217;s one of the more visible things they do, but it barely scratches the surface of what the company actually does.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1NQq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1NQq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 424w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 848w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 1272w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1NQq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png" width="475" height="107" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:107,&quot;width&quot;:475,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18870,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1NQq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 424w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 848w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 1272w, https://substackcdn.com/image/fetch/$s_!1NQq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2055d880-a8b0-4a01-a7c0-38760261f5f3_475x107.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Cloudflare traces its roots back to an anti-spam project. In 2009, <a href="https://www.cloudflare.com/our-story/">the people behind</a> it realized the bigger challenge wasn&#8217;t just fighting spam. It was making the Internet itself faster and more secure. The story goes that because they were building a &#8220;firewall in the cloud,&#8221; the name Cloudflare just seemed to fit. Since then, they&#8217;ve grown into one of the largest Internet infrastructure companies in the world. A huge amount of all Internet traffic now passes through their network every day.</p><p>Cloudflare offers everything from DNS and content delivery to DDoS protection, web application firewalls, Zero Trust security,  tunnels, serverless computing, and cloud storage.</p><p>Despite all that, Cloudflare doesn&#8217;t host my applications. My servers stay in my house. I use Cloudflare to create a <em>secure tunnel</em> between my users and those servers, making the connection faster, more reliable, and a lot harder to attack.</p><h3>So What's the Catch?</h3><p>Yeah so how much is this going to cost me?</p><p>Well, maybe nothing. But we both know there&#8217;s no such thing as a free lunch.</p><p>The <a href="https://www.cloudflare.com/plans/">free tier is part of Cloudflare&#8217;s business model</a>. They give a lot away to regular users and hobbyists, and most people never pay anything. When some of those users grow and need higher limits, better tools, advanced features, or real support, that&#8217;s when Cloudflare makes its money.</p><p>It&#8217;s simple economics. Cloudflare already operates one of the largest networks on the Internet. Adding another small website or home lab to that network costs them almost nothing, but it introduces another potential long-term customer.</p><p> For self-hosters, the free plan is usually more than enough.</p><h3>The Old Way</h3><p>Before Cloudflare Tunnel came along, exposing a home server to the Internet involved a lot of moving parts and was often hit or miss. I still have the scars from doing it for years, going all the way back to the old <a href="https://www.justice.gov/archives/atr/wildblue-communications">WildBlue satellite</a> days.</p><ul><li><p>First, you needed a public IP address. If your ISP changed it from time to time, as many do, you also needed a Dynamic DNS service so people could still find your server.</p></li><li><p>Next came port forwarding. You&#8217;d log into your router and tell it that incoming traffic on ports like 80 (HTTP) or 443 (HTTPS) should be forwarded to a specific machine on your local network.</p></li><li><p>If you used HTTPS, you had to deal with X.509 certificates. Even today with services like Let&#8217;s Encrypt, you still have to obtain, install, and renew them.</p></li><li><p>Then there was the firewall. Opening ports to the Internet meant making sure only the traffic you wanted could get through while keeping everything else out.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JFRW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JFRW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JFRW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png" width="800" height="533" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/50df216a-4b61-4795-a603-f825593e5fbb_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:533,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:598868,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!JFRW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!JFRW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50df216a-4b61-4795-a603-f825593e5fbb_800x533.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And if you wanted to self-host, this is the crap you had to go through just to be reachable on the Internet. I&#8217;m sure plenty of sites still do it this way.</p><p>You owned every piece of it. DNS had to be right. The public IP had to stay current. Port forwarding had to work. Certificates had to get renewed. Firewall rules had to stay tight. It could work fine for months, then one little thing would break and you&#8217;d be screwed, looking for a fix to the problem.</p><h3>Why I Started Looking at Cloudflare</h3><p>Fast forward to 2026. My Internet connection is now Starlink. It&#8217;s absolutely amazing. It&#8217;s stupid easy to set up, it&#8217;s fast, and it just works.</p><p>Unfortunately, there&#8217;s one catch. Starlink uses <a href="https://www.draytek.co.uk/information/blog/what-is-cgnat">Carrier-Grade NAT (CGNAT)</a>.</p><p>Instead of giving every customer their own public IP address, you&#8217;re sharing one with a bunch of other customers. From the rest of the Internet&#8217;s point of view, it doesn&#8217;t see your network. It only sees Starlink&#8217;s. That put me right back where I started during the old WildBlue days, just with a whole lot more bandwidth.</p><p>My first thought was, &#8220;No problem. I&#8217;ll just use Dynamic DNS.&#8221; Unfortunately, all that would do is point my domain name to Starlink&#8217;s shared public IP address. That address doesn&#8217;t belong to my router,  it belongs to Starlink&#8217;s CGNAT gateway.</p><p>From there, the connection has nowhere to go. Starlink has no port-forwarding rule telling it which customer should receive the incoming connection, so the traffic just stops. Their default CGNAT policy blocks inbound ports,  there&#8217;s no way to forward them to your router. </p><p>So where does that leave us? I asked around to a bunch of buddies who are way smarter than me and pretty much came to the same conclusion. Today there are really three practical ways to reach self-hosted services when you&#8217;re stuck behind CGNAT.</p><p>One option is to build a private network using something like <a href="https://tailscale.com/">Tailscale</a>. It works well if you&#8217;re willing to install software on every device that needs access and limit those services to yourself or a small group  of trusted users.</p><p>The other option, and I didn&#8217;t even know they offered this, is to pay <a href="https://starlink.com/support/article/13f0056c-6f6d-5a55-623c-fe94ad9947c5">Starlink for a public IP address</a>. That usually means moving to a higher-priced Priority plan. Even then, it gets you right back to the traditional model of port forwarding, certificates, and firewall rules.</p><p>Neither of those worked for me. I wanted to keep my servers and my LAN private, while allowing selected applications to be available from anywhere, without requiring users to install any special software.</p><p>That&#8217;s what led me to the Cloudflare Tunnel.</p><h3>Cloudflare Tunnel</h3><p>A <a href="https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/">Cloudflare Tunnel</a> flips the usual model the other way around.</p><p>Instead of opening ports on your router and waiting for the Internet to connect to you, your server reaches out to Cloudflare and keeps an encrypted connection open. When someone types your website address in a browser, the request goes to Cloudflare first. Cloudflare then sends it down the tunnel to your server, and the response travels back the same way.</p><p>Nothing on your home network is waiting for random connections from the Internet. There are no inbound ports to open, no port forwarding, and no direct exposure of your home network to the Internet.</p><p>This is what Cloudflare calls <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/">Zero Trust</a>. The old model basically trusted anything that managed to reach your open ports.  Zero Trust is the opposite.  Nothing is trusted by default. Every request has to prove itself, and your actual servers stay hidden. With a Cloudflare Tunnel the access can be controlled at Cloudflare&#8217;s edge before anything ever reaches your network.</p><p>That&#8217;s what makes it one of Cloudflare&#8217;s coolest features. Your servers stay private, but the applications you choose to publish can still be reached from anywhere through a normal website address.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sO4d!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sO4d!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 424w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 848w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 1272w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sO4d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png" width="800" height="422" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:422,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:451395,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sO4d!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 424w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 848w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 1272w, https://substackcdn.com/image/fetch/$s_!sO4d!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4dcf8a0-3d76-46df-8f9f-9d3e985d31c7_800x422.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Setting up Cloudflare </h3><p>There are a few hoops to jump through the first time around, but that's about it. Once everything is in place, adding another application takes just a few minutes.</p><h4>Create an Account.</h4><p>You&#8217;ll need a Cloudflare account. If you don&#8217;t already have one, go to <a href="https://www.cloudflare.com/plans/">https://www.cloudflare.com/plans/</a> and sign up. The free plan is enough for everything in this article.</p><h4>Do the DNS Dance.</h4><p>For the tunnel to work cleanly, Cloudflare has to be your DNS provider. When Cloudflare controls the DNS, it can route a name like myapp.yourdomain.com through their network and straight into your tunnel. If someone else is still handling the DNS, the traffic never reaches Cloudflare properly and the tunnel can&#8217;t do its job.</p><p>That doesn&#8217;t mean you have to buy the domain from them. If you like your registrar, you can keep your registrar (Porkbun, Namecheap, GoDaddy, etc.). Just point the nameservers at Cloudflare and leave the registration wherever it already is.</p><p>When you add your domain to Cloudflare, they give you two nameserver addresses that look something like <strong>foobar.ns.cloudflare.com</strong> and <strong>bozo.ns.cloudflare.com</strong>, or whatever they assign you.</p><p>You log into your registrar, find the nameserver settings for the domain, and replace whatever is currently there with the ones Cloudflare gave you. Once that change propagates, Cloudflare is in charge of the DNS and can route traffic into your tunnel.</p><p>That&#8217;s the only real requirement, and the good news is you only have to do this once. After the nameservers are updated, the rest of the setup happens inside Cloudflare.</p><h4>Create a Tunnel</h4><p>Once your domain is on Cloudflare and the nameservers have updated, the next step is to create a tunnel.</p><p>To me this is the hardest part: finding it in the Cloudflare website. They offer so many services that it&#8217;s easy to get lost, and it feels like they rearrange the whole thing every other week.</p><p>In the Cloudflare dashboard, look for <strong>Zero Trust</strong>. From there go to <strong>Networks &#8594; Tunnels</strong>. Or just type &#8220;Tunnels&#8221; in the dashboard search bar. That&#8217;s often the fastest way. Make sure you&#8217;re creating a <strong>Cloudflare Tunnel</strong>, not anything labeled Mesh. You want the tunnel.</p><p>You&#8217;ll land on a page that asks you to name it. The name is only for your own tracking, so call it whatever you want.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l0E5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l0E5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 424w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 848w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 1272w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l0E5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png" width="500" height="371" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:371,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:72368,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!l0E5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 424w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 848w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 1272w, https://substackcdn.com/image/fetch/$s_!l0E5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89f6d236-e318-45a6-99ec-81ec39ecf1e2_500x371.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p> Once you name the tunnel, Cloudflare takes you to the <strong>Install and run a connector</strong> screen. They show you a bunch of options (Docker, Linux, Windows, macOS, etc.).We&#8217;re not actually going to use any of those full install commands. What we really want is the token.</p><p>The easiest way I&#8217;ve found is to select <strong>Docker</strong>. Cloudflare will show you a long docker run command that includes a --token followed by a huge string that starts with something like eyJhIjoi....</p><p>Copy that whole token (everything after --token) and save it for now. That&#8217;s the only piece we need for the Docker setup later.</p><p>After you grab the token, Cloudflare sends you to the <strong>Route Traffic</strong> screen. This is where you tell the tunnel which public name should point to which local service.</p><p><strong>Hostname</strong><br>Pick a subdomain (like myapp) and choose your domain. That becomes the public address, for example myapp.yourdomain.com.</p><p><strong>Path</strong><br>Leave it blank unless you only want a specific path.</p><p><strong>Service</strong><br>Set the type to HTTP and put in the address of your service. Because we&#8217;re running things in Docker, this is usually <strong>not</strong> localhost.</p><p>You&#8217;ll typically use one of these:</p><ul><li><p>The Docker service name (if cloudflared is on the same Docker network), for example http://myapp:8080</p></li><li><p>The host machine&#8217;s IP address, for example http://192.168.1.50:8080</p></li></ul><p>The key point is that the address has to be reachable from inside the cloudflared container.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Edf4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Edf4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 424w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 848w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 1272w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Edf4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png" width="600" height="627" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:627,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142644,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/209154687?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Edf4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 424w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 848w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 1272w, https://substackcdn.com/image/fetch/$s_!Edf4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdc1f439b-8721-4b6d-905e-3c43bd2f82ad_600x627.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Once you hit <strong>Complete setup</strong>, Cloudflare will create the DNS record for you. You can add more hostnames later if you need them.</p><h4>Setup Your Side</h4><p>At this point I&#8217;m assuming you already have your web app (or whatever service you want to expose) up and running on your local network. For the rest of this article, I'll assume it's plain HTTP.</p><p>You <em>can</em> point the tunnel at an HTTPS service, but on a local network it&#8217;s usually more trouble than it&#8217;s worth. You often end up flipping on &#8220;<strong>No TLS Verify</strong>&#8221; because the local certificate doesn&#8217;t match what Cloudflare expects. <strong>Cloudflare already handles HTTPS on the public side</strong>.   So I generally don&#8217;t bother encrypting the short hop inside my own LAN. Pointing the tunnel at something like http://192.168.1.50:8080 or http://myapp:8080 is the simple way most of us do it.</p><p>That said,  we need to run the Cloudflare Tunnel connector so it can reach that service and keep the outbound connection open to Cloudflare.</p><p>I run the connector in Docker. Same reason I run most things in Docker: it&#8217;s simple, consistent, and easy to update. Instead of installing cloudflared on the host, I just use the official image. When a new version comes out I pull it and restart the container.</p><blockquote><p>One thing that tripped me up the first time was Docker networking. Remember, cloudflared is running inside its own container. When you tell Cloudflare your application is at http://127.0.0.1:8080 , it&#8217;s looking for a web server inside the cloudflared container, not on your Raspberry Pi or another container. If your application is containerized, point the tunnel at the Docker service name, for example http://farm-web:8080. If it&#8217;s running directly on the host, use the host&#8217;s LAN IP address instead.</p></blockquote><p>The other advantage of using the Docker container that I can run more than one connector from the same <strong>docker-compose.yml</strong> file if I want to run multiple tunnels. Each one gets its own service name and its own token. I keep the tokens in a separate .env file so they don&#8217;t end up in the compose file itself. And if I decide to punt a tunnel, all I have to do is edit that file and restart the container.</p><p>On the machine running the connector, I keep the whole Cloudflare tunnel setup in its own directory. Inside it are just two files: a docker-compose.yml and a .env file that holds the tokens.</p><p>The <strong>docker-compose.yml</strong> looks like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;22be8037-3171-435c-a549-3da4433d6740&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml">services:
  cloudflare-your-service:
    image: cloudflare/cloudflared:latest
    container_name: cloudflare-your-service
    restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=${YOUR_TOKEN}
    tmpfs:
      - /var/log

  cloudflare-another-service:
    image: cloudflare/cloudflared:latest
    container_name: cloudflare-another-service
    restart: unless-stopped
    command: tunnel run
    environment:
      - TUNNEL_TOKEN=${ANOTHER_TOKEN}
    tmpfs:
      - /var/log</code></pre></div><p>And the <strong>.env</strong> file in the same directory holds the tokens.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4007c423-7aa8-4cf1-8c9a-f00f061b7455&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">YOUR_TOKEN=eyJhIjoiNDg0NTE3Mj......
ANOTHER_TOKEN=eyiEyiYoTE3Mj......</code></pre></div><p>Then I just run:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;de6e05e5-059e-48e8-b3b0-9f989f259f88&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">docker compose up -d</code></pre></div><p>That's it. The container starts, authenticates with Cloudflare using the tunnel token, and establishes the encrypted tunnel automatically.</p><h3>Testing That It Works</h3><p>Once the container is running, the first thing I do is simply open the public URL in a browser. If the page comes up, the tunnel is probably working.</p><p>If it doesn&#8217;t, the Cloudflare Zero Trust dashboard is the next place to look. Under <strong>Tunnels</strong>, you should see your connector with a <strong>Healthy</strong> status. If it isn&#8217;t healthy, there&#8217;s no point chasing anything else until you fix that.</p><p>Cloudflare also lets you watch the tunnel in real time. You can open the log stream from the tunnel page and see requests as they come through. When something isn&#8217;t working, that&#8217;s usually where I start looking.</p><p>One last check is to try the site from somewhere outside your home network. Turn off Wi-Fi on your phone or grab another Internet connection. That confirms you&#8217;re really reaching the service through Cloudflare and not accidentally talking to it over your local network.</p><p>At this point the tunnel is up and working. Your application is reachable through Cloudflare, and your home network is still sitting behind your firewall.</p><p><strong>There&#8217;s just one problem. Right now, anyone who knows the URL can reach your application. The tunnel hides your network, but it doesn&#8217;t decide who gets in.</strong></p><p>That&#8217;s where <strong>Cloudflare Access</strong> comes in. We&#8217;ll put an authentication layer in front of the tunnel so only the people you choose can get through.</p><h3>Authentication with Cloudflare Access</h3><p>Instead of making your application handle logins, you can have Cloudflare check the user&#8217;s identity before the request is ever sent down the tunnel. If the person isn&#8217;t allowed in, the traffic never reaches your server. That keeps the attack surface smaller, and you don&#8217;t have to bolt authentication onto every individual app.</p><p>At the time of this writing, Cloudflare Access supports a bunch of login methods. Most of the convenient ones (Google, Microsoft, GitHub, and the rest) just hand the problem off to an outside provider who gets to decide whether a request should be allowed through. Which defeats the purpose of self-hosting as far as I am concerned.</p><p>There is one method I find acceptable, even if it isn&#8217;t perfect: Email one-time PIN. Cloudflare sends a short code to the user&#8217;s email address. If you're already using a privacy-focused email provider like Proton Mail, it&#8217;s a reasonable compromise. It&#8217;s still not fully self-hosted, and Cloudflare isn&#8217;t encrypting the message with your PGP key, but it&#8217;s the least bad of the convenient options.</p><blockquote><p>I&#8217;ve been skeptical of these identity problems for a long time (I wrote about the <a href="https://www.vinthewrench.caom/p/how-do-i-know-its-really-you-verifying-authenticity-of-public-keys-a788c9c6c3d6">difficulty of verifying authenticity of public keys</a> years ago). That experience is part of why I&#8217;m not eager to hand the whole problem over to the tech bros at Google, Microsoft, or even Apple. </p></blockquote><h3>Turning on Cloudflare Access</h3><p> Activating Cloudflare Access isn't too hard once you figure out where they've hidden it this week. Honestly, every time I set one up I either end up skimming the documentation or asking AI where everything moved. I swear they rearrange the menus every other week.</p><p>Last time I checked, it was under <strong>Access Controls &#8594; Applications</strong>. Create a <strong>Self-hosted</strong> application, give it a name, select the hostname you already created for the tunnel, and choose <strong>One-time PIN</strong> as the login method.</p><p>Next, create a policy that includes the email addresses you want to allow.  You can enter individual addresses or allow an entire email domain. You can also decide how long a login session stays valid before users have to sign in again.</p><p>One last thing: don&#8217;t forget to click <strong>Save</strong> on the policy. This tripped me up more than once. </p><h3>The Nuts an Bolts of One-Time PIN</h3><p>So here&#8217;s what happens when someone hits a hostname protected by Access. Cloudflare intercepts the request before it ever goes down the tunnel. The browser is shown a login page that asks for an email address.</p><p>Once someone gets past the PIN, Cloudflare creates a signed <strong><a href="https://www.jwt.io/">JSON Web Token</a></strong><a href="https://www.jwt.io/">  </a><strong><a href="https://www.jwt.io/">(JWT)</a></strong> and stores it in the browser as the <strong><a href="https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/">CF_Authorization</a></strong> cookie. That same token also shows up on your server in a header called <strong><a href="https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/validating-json/">Cf-Access-Jwt-Assertion</a>.</strong></p><p>The JWT carries the identity info (email, when it was issued, etc.) and is signed by Cloudflare so it can&#8217;t be casually messed with. On later visits the browser just sends the cookie along and Cloudflare checks it. If it&#8217;s still valid, the request goes down the tunnel.</p><p>One thing that tripped me up: JavaScript in the browser can&#8217;t read the <strong>Cf-Access-Jwt-Assertion</strong> header. Backend code or nginx can. If your front-end needs the identity info, the cleanest approach is to create a small endpoint that returns only the specific data the page actually needs. Don&#8217;t hand the full token to the browser. It&#8217;s a reusable credential, and a hacker who gets hold of it can use it to get into your system.</p><p>Here&#8217;s a simple nginx example that extracts the JWT payload and serves it at /access-info:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;3f15b88c-49f2-449b-a041-e92aabccf9a8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">map $http_cf_access_jwt_assertion $cf_access_jwt_payload {
    default "";
    ~^[^.]+\.(?&lt;cf_access_payload_segment&gt;[^.]+)\.[^.]+$ $cf_access_payload_segment;
}

server {
    listen 80;
    server_name _;
    root /usr/share/nginx/html;
    index index.html;

    location = /access-info {
        default_type text/plain;
        add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always;
        add_header Pragma "no-cache" always;
        add_header Expires "0" always;
        add_header X-Content-Type-Options "nosniff" always;

        if ($cf_access_jwt_payload = "") {
            return 204;
        }
        return 200 $cf_access_jwt_payload;
    }
}</code></pre></div><p>This returns only the middle segment of the JWT (the Base64-encoded payload), not the full signed token. Your JavaScript still needs to decode it to read the identity information.  </p><p>You can debug it yourself by going to yoursite/access-info and pasting the returned string into <a href="https://www.jwt.io/">https://www.jwt.io</a> That will decode the payload so you can see exactly what Cloudflare is sending.</p><h3>What Cloudflare Doesn&#8217;t Do</h3><p>A couple of parting thoughts, just so I don&#8217;t leave you with the wrong impression.</p><ul><li><p>Cloudflare Tunnel is <strong>not</strong> a VPN. It&#8217;s a secure way to publish selected applications, not your entire network, over a private overlay like Tailscale or a traditional VPN.</p></li><li><p>It also doesn&#8217;t replace your firewall. Your home network should still be locked down. The tunnel simply eliminates the need to open inbound ports for the applications you choose to publish.</p></li><li><p>Cloudflare won't magically fix your bad software. If an application has <a href="https://www.vinthewrench.com/p/preventing-sqlite-injection-attacks">security vulnerabilities</a>, they'll still be there. Cloudflare Tunnel and Access just reduce your exposure,  it doesn&#8217;t fix insecure code.</p></li><li><p>Cloudflare doesn't replace good operational discipline. You still need to keep your systems patched, make backups, and follow good security practices. It&#8217;s a layer of protection, not a substitute for the basics.</p></li></ul><p>Cloudflare is a force multiplier for the little guy. It gives you access to the same kind of network and security services that used to be reserved for companies with dedicated IT departments and million-dollar budgets...  assuming they still have a clue and haven't outsourced all their thinking to an LLM.</p><div><hr></div><p>If you have a clue and like the idea of controlling your own world, you&#8217;ll probably enjoy much of <a href="https://www.vinthewrench.com/p/its-about-independence">what I write about</a>, whether the subject is electronics, software, <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a>, <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a>, or <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a>. The subject changes without warning, but the questions never do: How does it work? Why was it built that way? And can I build, fix, or control it myself?</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Adding MQTT to pIoTServer]]></title><description><![CDATA[Connecting Zigbee devices to my self-hosted internet of things ecosystem.]]></description><link>https://www.vinthewrench.com/p/adding-mqtt-to-piotserver</link><guid isPermaLink="false">https://www.vinthewrench.com/p/adding-mqtt-to-piotserver</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Wed, 29 Jul 2026 23:44:06 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xvMF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;ve spent a lot of time in this series showing how I built the self-hosted <a href="https://github.com/vinthewrench/piotserver">piotserver</a> infrastructure for controlling <a href="https://www.vinthewrench.com/p/vinnies-farm-automation-projects">irrigation and monitoring environmental conditions on our farm</a>. The funny part is that there is nothing particularly &#8220;farm&#8221; about any of it. The same machinery works just as well for lights, switches, dimmers, and smart plugs around the house.</p><p>Ironically, that's where the whole project started.</p><p>Like many home automation hackers of the time, I got my start with <a href="https://www.x10.com/pages/about-us">X10</a>, which I came across in the aisles of RadioShack. X10 was pretty cool for its day, but I found its power-line signaling frustratingly unreliable.</p><p>By 2010, I had migrated much of my home to Insteon switches and dimmers. <a href="https://www.insteon.com/pages/about-insteon">Insteon</a> improved on those ideas with a faster dual-mesh network that combined power-line and RF communication while remaining backward compatible with many existing X10 installations.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tOlr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tOlr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 424w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 848w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 1272w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tOlr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp" width="500" height="348" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:348,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:7452,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tOlr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 424w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 848w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 1272w, https://substackcdn.com/image/fetch/$s_!tOlr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff49ce199-8de3-4615-a94e-2dac3650bbd7_500x348.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>At the center of it all was the Indigo home automation server, running on a dedicated Mac mini. It was a solid product for its time, but over the years the interface barely evolved. Eventually I found myself wondering why I was <a href="https://www.indigodomo.com/pricing.html">paying a subscription</a> for software I was convinced I could build better myself.</p><p>It didn&#8217;t take me long to reverse engineer the <a href="https://cache.insteon.com/pdf/INSTEON_Developers_Guide_20070816a.pdf">Insteon PowerLinc protocol</a>, even with all its quirks.  Before long, my own code was running on a Mac mini, along with an iPhone app I wrote to schedule and control everything from indoor lighting to outdoor Christmas lights.  <a href="https://github.com/vinthewrench/InsteonServer">The original project is still available on GitHub</a>.</p><p>That old project became the foundation for what eventually evolved into <a href="https://github.com/vinthewrench/piotserver">pIoTServer</a>. </p><p>I recently went digging through the old configuration files and was surprised by how much of the original design is still there. Devices were organized into groups, events triggered actions, schedules automated the house, and every capability was exposed through a REST API that my iPhone app used for control. </p><p>Insteon itself did not fare as well. The company&#8217;s servers <a href="https://appleinsider.com/articles/22/04/18/smarthome-firm-and-early-homekit-partner-insteon-is-dead-with-no-warning-to-customers">abruptly went tits up in 2022</a>, leaving customers up the creek with little warning. I heard that a group of Insteon users later acquired the company, <a href="https://arstechnica.com/gadgets/2022/06/insteon-smart-homes-resurrected-as-abruptly-as-they-were-bricked/">brought its services back online</a>, and began <a href="https://www.insteon.com/">developing and selling</a> products again.</p><p>Today&#8217;s pIoTServer, the same system that runs our farm irrigation, is more sophisticated and hardware-agnostic. It can run on something as small as a Raspberry Pi, but the underlying design remains remarkably similar.</p><h3>Life After Insteon</h3><p>Insteon demonstrated that there was a market for home automation that ordinary homeowners could install and manage themselves. It also demonstrated the risk of depending on a proprietary ecosystem.</p><p>Let&#8217;s not do that again.</p><p>Today there is no shortage of alternatives. Zigbee, Z-Wave, Wi-Fi, and the newer Matter standard are all supported by multiple manufacturers, making it much easier to avoid being locked into a single proprietary ecosystem.</p><p><a href="https://www.embedded.com/catching-the-z-wave/">Z-Wave was created by the Danish company Zensys</a> as a proprietary technology. Zensys controlled the radio chips and protocol stack, and that control later passed to Sigma Designs and then Silicon Labs. </p><p>For most of its history, Z-Wave was tightly controlled. The chips, software stack, certification process, and trademark all ran through a fairly small commercial ecosystem. <a href="https://www.vinthewrench.com/p/we-dont-need-no-stinking-ecosystem">The same exact shit I was trying to avoid</a>.</p><p>Z-Wave is less closed today, with the <a href="https://z-wavealliance.org/">Z-Wave Alliance</a> taking a larger role in maintaining the standard and opening it to additional silicon and stack suppliers.</p><p>Zigbee came from the other direction. The <a href="https://zigbeealliance.org/about/">Zigbee Alliance</a>, now called the Connectivity Standards Alliance, or CSA, was formed as a consortium of companies developing a shared standard.  Zigbee builds its networking, security, and application layers on the separate <a href="https://www.geeksforgeeks.org/computer-networks/introduction-of-ieee-802-15-4-technology/">IEEE 802.15.4</a> radio standard. That allowed multiple semiconductor companies to produce compatible radios and software stacks, while manufacturers built switches, plugs, sensors, and dimmers on top of them. </p><p>Zigbee has its own certification rules, working groups, and bureaucracy, but it was not nearly as bad as the Z-Wave world.</p><h3>Zigbee</h3><p>Each has its own strengths and weaknesses, and I could have made a case for any of them. I first tried Z-Wave, but after fussing with it for far too long, I gave Zigbee a try. It worked the first time.</p><p>It was stupid easy to add and configure a new Zigbee device. From the dashboard, you simply enable <strong>Permit Join</strong>, walk over to the device, and hold down its configuration or power button until it enters pairing mode. A few seconds later, the device appears, usually already identified ,with all of its supported features ready to use. You can keep adding as many devices as you like while <strong>Permit Join</strong> is enabled, then simply turn it off again when you&#8217;re finished.</p><p>I found a surprisingly wide range of Zigbee devices. Leviton made a basic wall switch, <a href="https://sonoff.tech/en-us/products/sonoff-s31-lite-zb-smart-plug-us-type-zigbee-version">SONOFF made a really nice plug</a>, and <a href="https://dwellvoyage.com/products/b0dd6q549z?variant=48200528003289&amp;_gsid=bqK7sCm1MZJX&amp;utm_source=chatgpt.com&amp;utm_medium=feed&amp;oppcref=96cc2210-c1cb-44de-b77e-e0196666b4c3">Suraielec had an outdoor plug</a> that fit what I needed. A lot of Zigbee hardware comes from common OEM designs, so the same basic switch, plug, or power stake often appears under several different brand names with slightly different electronics, firmware, or packaging.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y7Wf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y7Wf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 424w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 848w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y7Wf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg" width="600" height="427" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:427,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92853,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!y7Wf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 424w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 848w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!y7Wf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82ad297e-b187-47fe-9030-8b7500e4c7dc_600x427.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">A sampling of the Zigbee devices I tested during the pIoTServer MQTT integration.</figcaption></figure></div><p>And then there is <a href="https://inovelli.com/">Inovelli</a>, a small company from Kalamazoo, Michigan. Their devices are in a different class entirely.</p><p>The design is thoughtful, the controls feel solid, the LED bar can be configured for status and notifications, and nearly every behavior can be adjusted. But what really impressed me was the attention paid to the parts most people will never notice. The terminals, mounting hardware, and even the screws that hold the wires all feel like someone actually cared.</p><p><strong>Inovelli is the Michelangelo of home-automation electronics.</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6B-J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6B-J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 424w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 848w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 1272w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6B-J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png" width="600" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:474340,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6B-J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 424w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 848w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 1272w, https://substackcdn.com/image/fetch/$s_!6B-J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07a0ed24-f34d-43a2-9221-ae4e75582b2c_600x400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Inovelli is the Michelangelo of home-automation electronics. </figcaption></figure></div><p>I have written before about the <a href="https://www.vinthewrench.com/p/for-the-glory-of-god">art hidden inside the things we create</a>. Inovelli is a perfect example. It is easy to make a switch that works. It is something else entirely to make one beautiful.</p><h3>Under the Zigbee Hood</h3><p>Zigbee devices operate in the same 2.4 GHz band used by Wi-Fi and Bluetooth, but they use far less bandwidth. With a raw data rate of only 250 kilobits per second, Zigbee is not intended to stream video or move large files. Instead, it sends small messages: turn on, set brightness, report a temperature, or announce that a button was pressed.</p><blockquote><p>One thing to keep in mind is that Zigbee shares the 2.4 GHz band with Wi-Fi, so it helps to keep their channels apart. My network uses Zigbee channel 11, so I keep nearby Wi-Fi off Wi-Fi channel 1.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xvMF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xvMF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 424w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 848w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 1272w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xvMF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png" width="600" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:280666,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xvMF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 424w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 848w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 1272w, https://substackcdn.com/image/fetch/$s_!xvMF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01e277e0-645b-4c16-9648-c7f7f7d12c89_600x400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Zigbee Network</figcaption></figure></div><p>Every Zigbee network begins with a <strong>coordinator</strong>. It creates the network, chooses the radio channel, manages security, and allows new devices to join.</p><p>Utility-powered devices such as switches, plugs, and dimmers usually act as <strong>routers</strong>. Besides performing their own jobs, they relay messages for other devices, extending the range of the network.</p><p>Battery-powered sensors are generally <strong>end devices</strong>. They sleep most of the time, wake long enough to send or receive a small message, then go back to sleep. Because they do not relay traffic for other devices, they can run for months or even years on a battery.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ErJA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ErJA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ErJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg" width="500" height="398" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:398,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92770,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ErJA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ErJA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febe9cd91-2a83-4c19-ab34-9364e39e672b_500x398.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Zigbee coordinators</figcaption></figure></div><p> The two devices shown here are Zigbee coordinators. Each contains a Zigbee radio, an antenna, and firmware that handles the lower levels of the Zigbee protocol. One is the <a href="https://sonoff.tech/en-us/products/sonoff-zigbee-3-0-usb-dongle-plus-zbdongle-p">SONOFF USB dongle</a>; it plugs directly into the computer and is often adequate for a small home installation.</p><p>The other is an <a href="https://smlight.tech/en-US/products/slzb-06p7u">SMLIGHT SLZB-06P7U Ethernet Zigbee coordinator</a>. It connects to your local network over Ethernet and can be powered by PoE, allowing it to be placed wherever it provides the best Zigbee coverage.</p><p>A Zigbee network can contain many routers and end devices, but only one active coordinator. In this setup, device reports and commands handled by Zigbee2MQTT ultimately pass through the coordinator, sometimes by way of one or more routers.</p><p>The coordinator handles the radio traffic, but it still speaks Zigbee. Applications need a simpler way to exchange information about devices. That is where MQTT enters the picture.</p><h3>MQTT</h3><p>MQTT is a <a href="https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.pdf">lightweight messaging protocol</a> designed for communication between machines. It was created in 1999 by <a href="https://www.hivemq.com/blog/the-history-of-mqtt-part-1-the-origin/">Andy Stanford-Clark of IBM and Arlen Nipper of Arcom</a> to monitor oil pipelines as part of a SCADA industrial control system. The equipment communicated over satellite links, where bandwidth was slow and expensive, so the protocol had to be simple, efficient, and reliable.</p><p>Those are the same qualities I would want for sensors, embedded computers, and in this case home automation. </p><p>MQTT uses a <strong>publish-and-subscribe</strong> model. Programs do not normally send messages directly to one another. Instead, they connect to an MQTT <strong>broker</strong>, which receives messages and distributes them to any clients interested in them. The broker is the central post office for the system. Several MQTT broker implementations are available. I happen to use <a href="https://mosquitto.org/">Mosquitto</a>, a lightweight, open-source broker.</p><p>MQTT Messages are organized by topic. A temperature sensor might publish a value like this:</p><pre><code><code>Topic: home/kitchen/temperature
Message: 72.4</code></code></pre><p>Another program can subscribe to that topic and receive each new value as it is published. It does not need to know where the sensor is connected, what kind of hardware produced the reading, or which program sent it.</p><p>Commands work the same way:</p><pre><code>Topic: home/living-room/lamp/set
Message: ON</code></pre><p>Any program can publish the command, and whichever program or device subscribes to that topic can act on it. Your code only needs to understand the topic and the message. It doesn&#8217;t need to know how the rest of the system works.</p><p>Zigbee devices do not speak MQTT, and MQTT clients do not understand Zigbee. <a href="https://www.zigbee2mqtt.io/">Zigbee2MQTT</a> is the bridge between the Zigbee coordinator and the MQTT broker, translating Zigbee traffic into MQTT messages and MQTT commands back into Zigbee.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bfjd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bfjd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 424w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 848w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 1272w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bfjd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png" width="600" height="444" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:444,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:121222,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Bfjd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 424w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 848w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 1272w, https://substackcdn.com/image/fetch/$s_!Bfjd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe80e61d1-49b8-4b3a-ae1c-c78f67148110_600x444.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Zigbee2MQTT web console</figcaption></figure></div><p>Zigbee2MQTT also includes an optional web interface that is useful for managing and debugging the Zigbee network. It can be used to pair and rename devices, view their state and capabilities, change settings, inspect logs, and send test commands.</p><h3>Mosquittoes Buzzing on the Farm</h3><p>The Mosquitto project includes more than the broker itself. The project also provides <a href="https://mosquitto.org/documentation/">command-line tools</a> and a C client library called <a href="https://github.com/MayaPosch/libmosquitto/tree/master">libmosquitto</a>. </p><p>The command-line tools make it possible to publish messages, subscribe to topics, and watch traffic passing through the broker without writing any code. <a href="https://mosquitto.org/man/mosquitto_pub-1.html">mosquitto_pub</a> sends a message to a topic, while <a href="https://mosquitto.org/man/mosquitto_sub-1.html">mosquitto_sub</a> subscribes to one or more topics and prints the messages it receives. They are particularly useful for testing and debugging an MQTT system.</p><p>In my earlier article, <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-9ef">Writing Your Own Drivers</a>, I wrote about how pIoTServer adds new hardware through plugins. MQTT is just another one. The only difference is that this driver uses libmosquitto to connect to the broker, subscribe to configured topics, and publish commands when values change. Once loaded, pIoTServer treats MQTT devices no differently from any others.</p><p>All pIoTServer devices are defined in the <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-8e7">JSON configuration file</a>. Adding MQTT support is simply a matter of adding another device definition. In this example, the driver connects to an MQTT broker and exposes two Zigbee smart plugs as pIoTServer output values.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;72e3bc41-1639-493f-b42c-9ba32ea5778e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
    "devices": [
        {
            "deviceID": "MQTT_1",
            "device_type": "MQTT",
            "mqtt.host": "&lt;your server&gt;",
            "pins": [
                {
                    "data_type": "BOOL",
                    "gpio.mode": "output",
                    "key": "PLUG_1",
                    "other.props": {
                        "mqtt.target": "plug_1"
                    }
                },
                {
                    "data_type": "BOOL",
                    "gpio.mode": "output",
                    "key": "PLUG_2",
                    "other.props": {
                        "mqtt.target": "plug_2"
                    }
                }
            ]
        }
    ]
}</code></pre></div><p></p><p>The complete source code for the MQTT driver is available on <a href="https://github.com/vinthewrench/piotserver/tree/master/drivers/MQTT">GitHub</a> for anyone who would like to explore the implementation.</p><p>To turn on PLUG_1, we send a REST PUT request to pIoTServer with the new value in the request body. For example:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;7d9b8eb8-24db-4bdf-84e7-7f49fc622234&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">PUT /values HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: royal9:8081
Connection: close
Content-Length:  15

{"PLUG_1":true}</code></pre></div><p>Conversely, to retrieve the current state of PLUG_1, we send a REST GET request to pIoTServer:</p><pre><code>GET /values?keys=PLUG_1 HTTP/1.1
Host: royal9:8081
Connection: close</code></pre><p> he response includes the current value of the plug, along with its title, timestamp, and other metadata:</p><pre><code>{
    "values": {
        "PLUG_1": {
            "auto": false,
            "display": "false",
            "time": 1785279894,
            "value": "0"
        }
    }
}</code></pre><p>MQTT devices can also be controlled by the <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-12f">pIoTServer scheduler</a>. This example turns PLUG_1 on automatically at sunset.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;02cbcf42-b068-44ae-9336-76d231bf5656&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">"sequence": [
    {
        "enable": true,
        "name": "Sunset",
        "trigger": {
            "timeBase": "sunset"
        },
        "steps": [
            {
                "action": [
                    {
                        "cmd": "SET",
                        "key": "PLUG_1",
                        "value": "on"
                    }
                ]
            }
        ]
    }
]</code></pre></div><p>Of course, REST requests and scheduled sequences are only part of the story. Because MQTT devices are integrated into pIoTServer like any other device, they automatically appear in the web dashboard. They can be monitored, switched on and off, and incorporated into schedules alongside I&#178;C, 1-Wire, and RS-485 devices without any special handling. The dashboard itself is described in my earlier article, <a href="https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation">A Dashboard for My Garden Irrigatio</a><strong><a href="https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation">n</a></strong>.</p><p>By this point, I no longer have to think about MQTT. As far as the rest of pIoTServer is concerned, these are just devices.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bhQQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bhQQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 424w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 848w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 1272w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bhQQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png" width="600" height="195" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:195,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:85368,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bhQQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 424w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 848w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 1272w, https://substackcdn.com/image/fetch/$s_!bhQQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3208951-e87d-4774-b2c3-bbf1217044dc_600x195.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">MQTT devices on the dashboard</figcaption></figure></div><h3>Beyond Smart Plugs</h3><p>Smart plugs are an easy place to start, but Zigbee is not limited to commercial switches and sensors. It is also possible to build your own Zigbee devices using inexpensive development boards.</p><p>I am currently experimenting with an <a href="https://www.mouser.com/en/ProductDetail/356-ESP32C6DKC1N8">ESP32-C6</a>-based device that joins the Zigbee network and communicates through Zigbee2MQTT like any other device. The ESP32-C6 includes an IEEE 802.15.4 radio for Zigbee and Thread, and Espressif provides an official <a href="https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32c6/index.html">Zigbee SDK</a> with working device examples.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BBga!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BBga!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BBga!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BBga!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BBga!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BBga!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg" width="500" height="355" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:355,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:92473,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/208737918?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!BBga!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BBga!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BBga!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BBga!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe774a1b5-220a-499c-bbdd-d65eaea8ecf0_500x355.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In my test, a <a href="https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/home_automation_devices/on_off_light">simple on/off-light</a> application joined the network. After I added a small <a href="https://www.zigbee2mqtt.io/advanced/more/external_converters.html">external converter</a> describing the device to Zigbee2MQTT, it could be controlled by pIoTServer through the same MQTT interface used for commercial plugs and dimmers.</p><p>This opens the door to all sorts of custom sensors, relays, lighting controls, garage-door controllers, and other cool devices I haven&#8217;t even thought of yet.</p><h3>What Didn&#8217;t Change</h3><p>Adding MQTT support didn&#8217;t require changing the rest of pIoTServer. The REST interface, scheduler, dashboard, and existing device model works the same as before. The MQTT plugin just translates between pIoTServer values and MQTT messages. No hacks. No MQTT-specific paths through the rest of the code.</p><p>Zigbee and MQTT extend pIoTServer beyond hardware connected directly to the Raspberry Pi. They make it practical to use off-the-shelf home automation products while still supporting custom devices built for a particular job. Smart plugs are only the beginning. The same approach can be used for switches, dimmers, sensors, lighting controls, and whatever else I decide to build next.</p><p>Oh, and for the TL;DR readers asking, &#8220;Why not just use Home Assistant?&#8221; After Insteon died, I did, for several years. Eventually, I decided I wanted a system that wasn't constantly changing underneath me. As I explained in <a href="https://www.vinthewrench.com/p/we-dont-need-no-stinking-ecosystem">We Don&#8217;t Need No Stinking Ecosystem</a>, I wanted a small, self-hosted platform that I could completely understand, one that didn't surprise me with constant updates and that I could extend as my needs evolved.</p><div><hr></div><p>That theme of controlling your own world runs through <a href="https://www.vinthewrench.com/p/its-about-independence">much of what I write</a>, whether the subject is electronics, software, <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a>, <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a>, or <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a>. The subject may change without warning, but the underlying questions are usually the same: How was this made? Why was it built this way? And who gets to control it?</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[A Dashboard for My Garden Irrigation]]></title><description><![CDATA[A Web-Based Operations Console for My Garden Irrigation System]]></description><link>https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation</link><guid isPermaLink="false">https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sat, 18 Jul 2026 00:55:41 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!czm7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I have written a lot about my <a href="https://www.vinthewrench.com/p/vinnies-farm-automation-projects">home-brewed garden irrigation system</a>.  I have discussed the sensors, the custom circuit boards and software, and, Lord knows, spent far too much time talking about <a href="https://www.vinthewrench.com/p/tangled-up-in-wires">irrigation valves</a>.</p><p>Now that we have the machinery worked out, the next question is how the farmer sees and controls it.</p><p><strong>What&#8217;s going on in the garden?</strong></p><p>The system&#8217;s web dashboard answers that question. It gives me a single place to see current conditions, check what the system has been doing, review problems, manage schedules, and take control when necessary.</p><p>The dashboard is only the operator&#8217;s view. <a href="https://github.com/vinthewrench/piotserver">pIoTServer</a> handles the actual automation and sends <a href="https://www.vinthewrench.com/p/im-a-pushover-for-self-hosting">Pushover notifications to my phone</a> when something goes wrong.</p><p><a href="https://www.vinthewrench.com/p/taking-back-the-infrastructure">Like the rest of the systems I build, this one is self-hosted</a>. I do not outsource its control, its data, or its availability to a third-party vendor or cloud service. The dashboard runs on my own hardware and talks directly to <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-8e7">pIoTServer through its REST API</a>.</p><h3>10,000-Foot View</h3><p>At a high level, <a href="https://github.com/vinthewrench/farm-web">farm-web</a> is your basic web application. It is a collection of HTML, JavaScript, and CSS files served by nginx from a Docker container. The browser uses it to make REST requests to pIoTServer, which remains responsible for the actual automation.</p><p>Using standard web technologies means the dashboard can run almost anywhere, on a desktop computer, laptop, tablet, or phone. It could also be displayed on a dedicated kiosk, much like the<a href="https://www.vinthewrench.com/p/building-a-dedicated-weather-station"> weather station I built for my kitchen</a>, and mounted in the greenhouse or anywhere else a permanent farm display would be useful.</p><p>The code in farm-web does not contain the irrigation logic, maintain schedules, or decide when a rule should run. It presents information and sends operator requests. My automation system, pIoTServer, continues operating whether farm-web is available or not.</p><p>The dashboard is also not where the system is configured. Devices, schedules, rules, and other operating details are defined in pIoTServer&#8217;s configuration. farm-web lets the operator see and interact with the system, but it does not define how the system itself works. It is a tool designed for the farmer, not the programmer.</p><p>From the farmer&#8217;s perspective, the dashboard is organized into a handful of major areas. <strong>Sensors</strong> provide visibility into current conditions. <strong>Devices</strong> allow direct control of equipment. <strong>Schedules</strong> and rules show what the automation system is planning to do. Additional administrative pages provide access to system health, incidents, tracking information, and other management functions.</p><p>We will start with the Sensors page.</p><h3>Environmental Sensors</h3><p>The sensors themselves are defined in the pIoTServer configuration file. I covered how pIoTServer <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-8e7">devices and properties are configured in an earlier article</a>, so I will not repeat all of those details here.</p><p>Current environmental sensor support includes TMP10X temperature sensors, SHT25 and SHT30 temperature and humidity sensors, BME280 environmental sensors, VEML6030 light sensors, tank depth sensors, analog measurement devices based on the ADS1115 and MCP3427, and 1-Wire devices connected through a DS2482 bridge.</p><p>For the dashboard example, we will use the SHT30 that measures temperature and humidity in the garden. Its device definition appears in the pIoTServer configuration file as a JSON object:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;610c0087-6d50-4b6b-aed9-70c82c9d67a0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">"devices": [
    {
      "address": "0x44",
      "description": "Outside Environment Sensor",
      "device_type": "SHT30",
      "pins": [
        {
          "data_type": "TEMPERATURE",
          "key": "GARDEN_TEMPERATURE",
          "title": "Garden Temperature",
          "tracking": "track.range"
        },
        {
          "data_type": "HUMIDITY",
          "key": "GARDEN_HUMIDITY",
          "title": "Garden Humidity",
          "tracking": "track.range"
        }
      ],
      "title": "Garden"
    }
  ]</code></pre></div><p>This tells pIoTServer that an SHT30 is connected at I&#178;C address <code>0x44</code>. Some devices provide only a single measurement, while others expose multiple functions. The <code>pins</code> array defines the individual properties produced by the device.</p><p>In this case, the SHT30 provides two properties: <code>GARDEN_TEMPERATURE</code> and <code>GARDEN_HUMIDITY</code>. Each property is assigned a unique key that can be used elsewhere in the system for automation, tracking, notifications, and dashboard displays.</p><p>Once pIoTServer has read the sensor, its individual properties are available through the REST API. We can request both values by name:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;a5f8d605-168a-4108-83f0-c7ccc62750b8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /values?GARDEN_HUMIDITY&amp;GARDEN_TEMPERATURE</code></pre></div><p>pIoTServer returns a JSON object containing the current value, formatted display value, title, and timestamp for each property:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;f92c9e13-3589-4b30-aae3-32a480e45d90&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
    "success": true,
    "values": {
        "GARDEN_HUMIDITY": {
            "display": "46.94%",
            "time": 1784316906,
            "title": "Garden Humidity",
            "value": "46.936751"
        },
        "GARDEN_TEMPERATURE": {
            "display": "100.57&#176;F",
            "time": 1784316906,
            "title": "Garden Temperature",
            "value": "38.092622"
        }
    }
}</code></pre></div><p>Notice that the raw temperature value is returned in Celsius, while the <code>display</code> field contains the formatted Fahrenheit value used by the operator interface. The dashboard can use the raw value for calculations and the display value when it simply needs to show the reading.</p><p>The sensor values alone do not tell farm-web how they should be organized or displayed. That information also comes from pIoTServer. The pIoTServer configuration contains a <code>ui.sensors</code> object that defines the sensor groups, the properties included in each group, and the type of display used for each value.</p><p>For this installation, the Garden group is defined as follows:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;004b01aa-c93b-40df-b546-68bfd485c8e4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">"ui.sensors": {
    "garden": {
        "label": "Garden",
        "description": "Outside environment and soil conditions",
        "members": [
            {
                "key": "GARDEN_TEMPERATURE",
                "label": "Air Temperature",
                "kind": "temperature",
                "range": {
                    "min": 0,
                    "max": 120
                }
            },
            {
                "key": "GARDEN_HUMIDITY",
                "label": "Humidity",
                "kind": "humidity",
                "range": {
                    "min": 0,
                    "max": 100
                }
            },
            {
                "key": "RAIN_SENSOR",
                "label": "Rain",
                "kind": "binary",
                "falseLabel": "No Rain",
                "falseIcon": "&#9728;&#65039;",
                "trueLabel": "Rain",
                "trueIcon": "&#127783;&#65039;"
            }
        ]
    }
}</code></pre></div><p>Since the web application is not on the same hardware as the pIoTServer, it can&#8217;t read that configuration file directly.  Instead, it retrieves the sensor layout from pIoTServer through the REST API:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;fb463a57-cb70-4d82-9b11-b3b9fd38529e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /props?ui.sensors</code></pre></div><p>From that response, farm-web finds the Garden group and uses its definition to build the display shown below:</p><ul><li><p>The group <code>label</code> becomes the heading at the top of the panel.</p></li><li><p>Each member&#8217;s <code>label</code> becomes the title of its card.</p></li><li><p>The <code>key</code> identifies the pIoTServer property displayed by the card.</p></li><li><p>The <code>kind</code> tells farm-web how to format and present the property value.</p></li><li><p>When present, the <code>range</code> defines the scale used by the gauge.</p></li><li><p>For a binary property, <code>trueLabel</code>, <code>trueIcon</code>, <code>falseLabel</code>, and <code>falseIcon</code> define how its two states are displayed.</p></li><li><p>The property returned by the API may also include a <code>history</code> tag. When <code>history</code> is set to <code>true</code>, the dashboard adds a History button to the card. Selecting it causes farm-web to request the property&#8217;s stored readings from pIoTServer and display them as a graph.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!czm7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!czm7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 424w, https://substackcdn.com/image/fetch/$s_!czm7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 848w, https://substackcdn.com/image/fetch/$s_!czm7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 1272w, https://substackcdn.com/image/fetch/$s_!czm7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!czm7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png" width="700" height="403" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:207351,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/207428412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!czm7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 424w, https://substackcdn.com/image/fetch/$s_!czm7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 848w, https://substackcdn.com/image/fetch/$s_!czm7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 1272w, https://substackcdn.com/image/fetch/$s_!czm7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd763333-ea4d-42a8-8dab-e12414e2780a_700x403.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>While the <code>range</code> in the sensor definition controls the scale of the gauge, we need to make an additional API call to retrieve the actual daily minimum and maximum values for those sensors.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;49541add-2172-4f6b-a4e3-41980e469a45&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /range?GARDEN_TEMPERATURE</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;1c455957-2df0-4286-a8e1-437da8bad201&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "success": true,
  "values": {
    "GARDEN_TEMPERATURE": {
      "max": 39.45182,
      "min": 21.945144
    }
  }
}</code></pre></div><p>The web application converts those values for display and shows them as the day&#8217;s high and low readings on the sensor card.</p><h4>Binary Sensors</h4><p>Not every sensor reports a numeric value. Many field devices produce simple binary states such as <strong>Wet/Dry</strong> or <strong>On/Off</strong>. The sensor definition can provide labels and icons for both states, allowing farm-web to present binary properties in a form that is much more meaningful than simply displaying <code>true</code> or <code>false</code>.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;9d3a7dcc-1597-4c2e-90f9-97c6cfd21319&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /values?RAIN_SENSOR</code></pre></div><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;c62b95ff-f1fd-4282-8073-5f513213c387&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "success": true,
  "values": {
    "RAIN_SENSOR": {
      "display": "false",
      "time": 1784321494,
      "title": "Orbit Rain Sensor",
      "value": "0"
    }
  }
}</code></pre></div><p>The raw property value remains a simple binary value. The <code>ui.sensors</code> definition shown earlier tells farm-web how to display that value. In this case, the <code>kind</code> is <code>binary</code>, and the <code>trueLabel</code>, <code>falseLabel</code>, <code>trueIcon</code>, and <code>falseIcon</code> properties determine the text and icon presented for each state.</p><h4>Don&#8217;t Know Much About History</h4><p>The current value and the day&#8217;s high and low readings show what is happening now. On the farm, however, we also find it useful to understand the longer-term picture.</p><p>One of pIoTServer&#8217;s more important features is its ability to track the minimum and maximum values reported by a property over time. Many monitoring systems store every individual sensor reading. That can produce a large amount of data while still making a simple question difficult to answer: how hot or cold did it get each day?</p><p>pIoTServer can instead maintain a series of range records. Each record contains the minimum and maximum values observed during a period, along with its timestamp. This preserves the information that matters for long-term comparisons without requiring the dashboard to retrieve and process every raw sensor reading.</p><p>Range tracking is enabled in the device configuration by setting the property&#8217;s tracking mode to <code>"tracking": "track.range"</code>. Once enabled, pIoTServer continuously records the property&#8217;s minimum and maximum values over time and makes those records available through the REST API.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;928ffb73-8150-4b8e-9aa5-a6815af76605&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /history/GARDEN_TEMPERATURE</code></pre></div><p> Because this history can extend across months or years, the endpoint supports <code>days</code>, <code>limit</code>, and <code>offset</code> parameters:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6094eb33-2601-4dc4-8d14-4925e1e61915&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">GET /history/GARDEN_TEMPERATURE?days=30&amp;limit=100&amp;offset=0</code></pre></div><p>This allows farm-web to request only the portion of the history needed for the graph.</p><p>An abbreviated JSON response looks like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;677de3ca-a55a-43c6-b7ca-d34f83563818&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "deviceID": "51623",
  "key": "GARDEN_TEMPERATURE",
  "range": [
    {
      "max": 24.6101,
      "min": 6.90585,
      "time": 1742515182
    },
    {
      "max": 24.6101,
      "min": -1.34546,
      "time": 1742586196
    },
    {
      "max": 23.8705,
      "min": 5.1648,
      "time": 1742687386
    }
  ],
  "success": true,
  "title": "Garden Temperature",
  "units": "DEGREES_C"
}</code></pre></div><p>Each entry contains the minimum and maximum values recorded for a period, along with the timestamp for that range. farm-web converts the returned records into the operator&#8217;s preferred units and renders them as an interactive history graph. The displayed data can also be exported as a CSV file for further analysis.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!H393!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!H393!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 424w, https://substackcdn.com/image/fetch/$s_!H393!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 848w, https://substackcdn.com/image/fetch/$s_!H393!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 1272w, https://substackcdn.com/image/fetch/$s_!H393!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!H393!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png" width="700" height="670" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:670,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:242262,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/207428412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!H393!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 424w, https://substackcdn.com/image/fetch/$s_!H393!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 848w, https://substackcdn.com/image/fetch/$s_!H393!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 1272w, https://substackcdn.com/image/fetch/$s_!H393!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9507148b-3da6-4ba8-9f3b-68ba26fd91b0_700x670.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Taking Control</h3><p>Most of the time, the farm operates automatically. pIoTServer evaluates its rules and schedules, monitors the sensors, and decides when irrigation should occur without any intervention from me.</p><p>There are times, however, when manual control is useful. I may want to test a newly installed valve, verify that a repair was successful, water a specific plot outside its normal schedule, or simply confirm that a device is operating correctly. The Controls page provides that direct access without changing the automation itself.</p><p>As with the sensors, the controls begin with a device defined in the pIoTServer configuration. In this case, an MCP23008 I/O expander provides the output properties used to operate the irrigation valves. One of those properties is <code>GI_4</code>:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;735cfe68-56b1-4164-ac33-8c8b7ad63d4f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">  "devices": [
    {
      "address": "0x27",
      "device_type": "MCP23008",
      "key": "GARDEN_27",
      "pins": [
        {
          "bit": 4,
          "data_type": "BOOL",
          "gpio.mode": "output",
          "key": "GI_4",
          "title": "C"
        },
        ...
      ]
    }
  ]</code></pre></div><p>The remaining pin definitions have been omitted for clarity.</p><p>Once a property has been defined, it can be read or changed through the pIoTServer REST interface, just as we saw in the<a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-8e7"> article on devices</a>.</p><p>At this point we have defined the device and the properties that control it. The remaining question is how those properties become controls on the web dashboard.</p><p>Like the Sensors page, the Controls page is configuration-driven. Rather than hard-coding the layout, farm-web retrieves the <code>ui.controls</code> property from pIoTServer and uses it to construct the operator interface.</p><p>For this example, we will use the Garden Irrigation control group:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;e27b1d9c-647a-4062-bcc9-8b582d6e26a8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "ui.controls": {
    "garden_irrigation": {
      "label": "Garden Irrigation",
      "control": "valve",

      "members": [
        "GI_8",
        "GI_6",
        "GI_4",
        "GI_5",
        "GI_3",
        "GI_7"
      ],

      "titles": {
        "GI_8": "Plot A",
        "GI_6": "Plot B",
        "GI_4": "Plot C",
        "GI_5": "Plot D",
        "GI_3": "Plot E",
        "GI_7": "Plot P2"
      },

      "descriptions": {
        "GI_8": "BLU",
        "GI_6": "WHT",
        "GI_4": "BRN",
        "GI_5": "ORN",
        "GI_3": "GRN",
        "GI_7": "YEL"
      }
    }
  }
}</code></pre></div><p>The <code>members</code> array identifies the properties that appear in the control group and determines the order in which they are displayed. The <code>titles</code> object provides the operator-facing name for each property, while <code>descriptions</code> supplies the shorter secondary label shown on the control.</p><p>The <code>control</code> value tells farm-web which type of widget to use. In this case, <code>valve</code> produces the controls used to open and close the irrigation valves.</p><p>From this definition, farm-web constructs the Garden Irrigation section of the Controls page.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A3Mb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A3Mb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 424w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 848w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 1272w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A3Mb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png" width="700" height="352" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:352,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:179456,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/207428412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A3Mb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 424w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 848w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 1272w, https://substackcdn.com/image/fetch/$s_!A3Mb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76b05832-c5a0-4c64-84da-8335ffa8bd42_700x352.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The current Open or Closed status reflects each property&#8217;s live value. Selecting a card sends the appropriate request to pIoTServer to operate that valve.</p><h3>Putting the Farm on Autopilot</h3><p>Manual control is useful for testing, maintenance, and the occasional one-off watering. Most of the time, however, I want the farm to take care of itself.</p><p>As described in the earlier <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-12f">pIoTServer article</a>, irrigation schedules define when work should be performed and the <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-12f">sequence of actions</a> that make up each irrigation cycle. farm-web does not implement that automation. Instead, it presents the schedules in a form that is easy to understand, monitor, and manage.</p><p>Like the Sensors and Controls pages, the Schedules page is configuration-driven. The dashboard uses the ui.schedules property to organize related schedules into groups.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;f01e8f73-cbbd-477a-be2e-40f452e96de7&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">"ui.schedules": {
    "evening_garden_irrigation": {
        "description": "PWM sprinkler 9 PM",
        "label": "Evening Garden Irrigation",
        "members": [
            "4002"
        ]
    },
    "morning_garden_irrigation": {
        "description": "PWM sprinkler 9 AM",
        "label": "Morning Garden Irrigation",
        "members": [
            "4001"
        ]
    }
}</code></pre></div><p>The dashboard uses this definition to create the schedule groups and tabs. Each schedule card summarizes the sequence, its current status, and the conditions under which it will execute. The timeline provides a graphical view of the irrigation sequence, making it easy to see when each plot will be watered and for how long. Operators can also temporarily enable or disable a schedule or run it immediately without modifying the underlying automation.</p><p>Each entry in <code>ui.schedules</code> references a sequence defined elsewhere in the pIoTServer configuration. The sequence contains the automation itself, including the trigger, any conditions that must be satisfied, and the actions that will be performed.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;b4aa916c-a223-48fa-897e-adb3dba55b55&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">"sequence": [
  {
    "sequenceID": "4001",
    "name": "Garden irrigation morning sequence",
    "description": "GI_8 through GI_3 for 30 minutes at 9:00 AM",
    "trigger": {
      "time": "09:00 AM"
    },
    "condition": "RAIN_SENSOR == 0",
    "steps": [
      ...
      {
        "action": [
          ...
          {
            "cmd": "SET",
            "key": "GI_4",
            "value": "on"
          }
        ],
        "duration": 1800
      },
      {
        "action": [
          {
            "cmd": "SET",
            "key": "GI_4",
            "value": "off"
          },
          ...
        ],
        "duration": 1800
      },
      ...
    ]
  }
]</code></pre></div><p>In this excerpt, the sequence begins at 9:00 AM only when the rain sensor indicates that irrigation is allowed. The step shown opens the valve represented by <code>GI_4</code> and leaves it open for 1,800 seconds, or 30 minutes. Then the following step closes that valve before the sequence continues to the next plot.</p><p>farm-web reads this sequence information and turns it into the timeline shown on the schedule card. The operator sees when each plot will run and for how long without having to read the underlying configuration.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GlgR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GlgR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 424w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 848w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 1272w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GlgR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp" width="700" height="549" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:26050,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/207428412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GlgR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 424w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 848w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 1272w, https://substackcdn.com/image/fetch/$s_!GlgR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a5e8786-4f2b-4049-b1d5-01d577236a47_700x549.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here the morning irrigation sequence is running. Plot A is highlighted as the active step, while the timeline shows the remaining plots and their scheduled start times. The dashboard combines the sequence definition with the current state reported by pIoTServer, allowing the operator to see what is running, what comes next, and how long each step will last. It also displays the rain-sensor condition and provides an Abort control that stops the sequence and closes all of the valves.</p><h3>Did It Really Run?</h3><p>I believe in &#8220;trust, but verify&#8221;. Once the farm is operating on its own, I still want to know whether the scheduled work actually happened. Did the sequence run? Which plots were watered? How long did each valve remain open?</p><p>I don&#8217;t have hardware to measure the actual water flow. Fortunately, one of the reasons I moved to Arkansas was access to a good well, so I&#8217;m not watching a municipal water bill every month. Even so, runtime is useful. Since the flow rate of each irrigation zone is reasonably consistent, the amount of time a valve remains open provides a good indication of how much water was applied.</p><p>To answer those questions, pIoTServer records the runtime history of each tracked output. The dashboard summarizes that information so I can quickly see when each irrigation zone last ran, how long it operated, its total runtime, and the number of recorded runs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LlP3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LlP3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 424w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 848w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 1272w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LlP3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png" width="700" height="539" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:539,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:209279,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/207428412?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LlP3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 424w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 848w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 1272w, https://substackcdn.com/image/fetch/$s_!LlP3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bac21b5-256c-44e9-b2a6-66b84db6ed15_700x539.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Behind the Curtain</h3><p>The farm-web code runs in a Docker container, with nginx serving the static HTML, CSS, and JavaScript files. Docker provides a predictable environment and makes deployment and updates straightforward.</p><p>nginx also acts as a reverse proxy. It serves the dashboard and forwards its REST requests to pIoTServer. From the browser&#8217;s perspective, everything comes from the same web server. The browser does not know where pIoTServer is running, and the pIoTServer REST service is not exposed directly to the public internet.</p><p>pIoTServer protects its REST interface with signed requests. Each request includes an API key, a timestamp, and an HMAC-SHA256 signature calculated from the request method, path, and body. pIoTServer calculates the expected signature independently and rejects the request if the signature does not match or the timestamp falls outside the permitted window.</p><p>The browser cannot safely hold the shared secret required to create those signatures. Instead, it sends an ordinary request to a small local proxy running alongside nginx. The proxy signs the request and forwards it to pIoTServer. Remote access reaches farm-web through Cloudflare, while the API secret and pIoTServer itself remain on the local network.</p><h3>Another Piece of the Self-Hosted Farm Puzzle</h3><p>farm-web has become the primary interface to my irrigation system. It gives me a single place to monitor conditions, manage schedules, verify that the automation is doing what I expect, and investigate problems when they occur. Although it was built for my own farm, it has grown into a general dashboard for pIoTServer that can be adapted to other automation projects simply by changing the configuration.</p><p>It is also another example of why I prefer self-hosting. The dashboard runs on my hardware, the data stays on my network, and the farm does not depend on a vendor&#8217;s cloud service to keep operating. Remote access is useful, but it does not change who owns or controls the system.</p><p>Like the rest of this project, farm-web is open source. If you&#8217;re interested in building your own self-hosted automation system, I hope some of the ideas here prove useful. Whether your project is a garden, a greenhouse, a workshop, or something entirely different, the same design philosophy applies: keep the automation independent of the user interface, expose it through a simple REST API, and let the dashboard focus on helping the operator understand what the system is doing.</p><p><strong>If you&#8217;d like to learn more or build your own system, here are the resources behind this project:</strong></p><ul><li><p>&#8288;<a href="https://www.vinthewrench.com/p/vinnies-farm-automation-projects">Vinnie&#8217;s Farm Automation Projects (article index)</a></p></li><li><p><a href="https://www.vinthewrench.com/p/garden-irrigation-evolution">&#8288;Garden Irrigation Evolution (hardware evolution)</a></p></li><li><p>&#8288;<a href="https://github.com/vinthewrench/GardenIrrigation">Garden Irrigation Hardware</a></p></li><li><p><a href="https://github.com/vinthewrench/valvenode">ValveNode RS-485 Field Bus Irrigation Controller</a></p></li><li><p>&#8288;<a href="https://github.com/vinthewrench/piotserver">pIoTServer</a></p></li><li><p>&#8288;<a href="https://github.com/vinthewrench/farm-web">farm-web</a></p><div><hr></div></li></ul><p>Self-hosting is not effortless. You have to build the system, maintain it, and understand enough of it to fix problems when they occur. The reward is that the farm keeps operating on your terms. The dashboard runs on your hardware, the data stays under your control, and no vendor can decide that a subscription, cloud account, or discontinued service is suddenly required.</p><p>That theme runs through  <a href="https://www.vinthewrench.com/p/its-about-independence">much of what I write</a><span>, whether the subject is electronics, software, </span><a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a><span>, </span><a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a>,<span> or </span><a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a><span>. The subject may change without warning, but the underlying questions are usually the same: How was this made? Why was it built this way? And who gets to control it?</span></p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Taking Back the Infrastructure]]></title><description><![CDATA[Self-Hosting the Services I Use Every Day]]></description><link>https://www.vinthewrench.com/p/taking-back-the-infrastructure</link><guid isPermaLink="false">https://www.vinthewrench.com/p/taking-back-the-infrastructure</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Tue, 14 Jul 2026 22:47:40 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!PIsa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Mandatory Ecosystem Rant</h3><p>If you&#8217;ve read my series <em><a href="https://www.vinthewrench.com/p/we-dont-need-no-stinking-ecosystem">We Don&#8217;t Need No Stinking Ecosystem</a></em>, then you already know that my decision to move away from Apple was about more than operating systems, phones, or applications.  It was about getting out from under institutions that increasingly want their hands on the platforms, services, and infrastructure modern life depends on. </p><p>Yeah, and I hate their politics. I don&#8217;t trust these technology companies, or the tech bros running them, with the power they now exercise over speech, distribution, identity, and access that should belong to the individual.</p><p>The pattern is self-evident from recent history. During COVID, the 2020 election, the unrest surrounding astroturfed movements, and the rise of the woke movement, Facebook, Twitter, Apple, and Google, just to name a few, abandoned any pretense of neutrality. They suppressed reporting, censored dissent, removed applications, and promoted their favored political narratives.</p><p>And I see zero evidence that they have changed course. If anything, they have simply found new language and new tools for doing the same thing: ideologically trained AI, effective altruism, and surveillance repackaged as safety with <a href="https://deflock.org/what-is-an-alpr">Flock cameras</a>.</p><p>It&#8217;s <em>the same old story, the same old song and dance, my friend</em>: trust the institutions, trust the science, trust the experts, trust the people in charge. </p><p>Only an idiot would.</p><div class="pullquote"><p><em><strong><span>&#8220;It is hard to imagine a more stupid or more dangerous way of making decisions than by putting those decisions in the hands of people who pay no price for being wrong.&#8221;</span></strong></em><br><em><strong><span> Thomas Sowell (&#8220;</span><a href="http://www.jewishworldreview.com/cols/sowell081800.asp">Wake Up, Parents</a><span>!&#8221;)</span></strong></em></p></div><h3>The Cloud Was Never the Destination</h3><p>Weaning myself from Apple started with <a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-db9">dropping the iPhone</a> and continued with replacing Apple Mail, Safari, Photos, iTunes, and the rest. Each step loosened its grip, but as long as my data still lived on somebody else&#8217;s servers, the job was not finished.</p><p>That was the next problem. Trading Apple&#8217;s cloud for Google, Dropbox, Spotify, GitHub, or some other provider is not independence. It is only changing landlords.</p><p>You may have more choice, but the provider still controls the service, the terms, the price, and ultimately whether you continue to have access at all. The rest of the journey was bringing those services, and the data behind them, under my own roof.</p><h3>Self-Hosting Isn&#8217;t About Saving Money</h3><p>Bringing those services under my own roof wasn&#8217;t just about avoiding subscriptions. By the time you account for hardware, storage, backups, electricity, maintenance, and the value of your own time, self-hosting may not be cheaper at all.</p><p>What self-hosting buys me is control. I decide where the data lives, how it is backed up, which software runs, when it is updated, and who can access it. I am not depending on a company to preserve a product, honor an API, maintain a pricing model, or continue tolerating the way I use its service.</p><p>Saving money is welcome when it happens, but agency is non-negotiable.</p><h3>Continuity Matters Too</h3><p>I also see self-hosting as a form of continuity engineering. A service should not disappear because the Internet is down, an API changes, a company abandons a product, or a provider decides it no longer wants your business. Remote access is useful, but it should be an added convenience, not the foundation on which the entire system depends.</p><p>Continuity also means keeping the data in its original form, or at least in a format I can extract and use elsewhere. If the server application fails, the project is abandoned, or something better comes along, I need a clear path out. Replacing one lock-in with another would defeat the whole purpose.</p><p>Having completed the mandatory philosophical rant, I&#8217;ll get off my soapbox, and let&#8217;s get to what you came here for.</p><h3>The Platform </h3><p>Before diving into PhotoPrism, Paperless, Forgejo, Jellyfin, Navidrome, Radicale, and the other services I host, it is worth spending a moment on the platform itself.</p><p>You don&#8217;t need enterprise hardware or a dedicated server room to run your own services. A Raspberry Pi with attached storage lets you experiment with self-hosting without spending much or committing to a larger system. Once you know what you want to run, an Intel NUC or similar mini PC can take you a long way.</p><p>I happen to use a <a href="https://protectli.com/product/vp3210/">Protectli VP3210</a>. It is fanless, compact, quiet, and powerful enough to run the services I need without making a big deal out of it. </p><p>Another cool option is the compact mini-rack, like what <a href="https://www.youtube.com/watch?v=y1GCIwLm3is">Jeff Geerling</a> builds.</p><p>The hardware itself matters far less than you might imagine. Most self-hosted services need only modest processing power. The real challenge is building a system that keeps working when something goes wrong and does not take your data with it.</p><h3>Build for Failure</h3><p>That means planning for failure from the beginning. The server, network equipment, and storage should be protected by a UPS so brief interruptions do not bring everything down and longer outages allow for a clean shutdown.</p><p>But surviving a power failure is only part of the job. Important data should also exist in more than one place, with at least one copy stored away from the primary server. RAID, mirrored disks, and snapshots may improve availability, but they are not substitutes for a real backup strategy.</p><p>Dependability also requires routine maintenance and a little restraint. Keep the operating system and containers updated, expose as little as possible directly to the Internet, and use secure remote-access tools when outside access is required.</p><p>I&#8217;m also a big believer in keeping a spare box around that can take over if the primary server fails. Besides shortening recovery time, it gives you a safe place to test a complete restore without disturbing the working system.</p><p>And call me paranoid, but I would keep that spare in a fire-resistant, EMP-protected safe, along with a current copy of the data needed to rebuild the system. The supply-chain shortages of recent years taught me not to assume that replacement hardware will always be one overnight shipment away.</p><h3>Ubuntu and Docker</h3><p>As for the underlying operating system, I chose a headless server running <a href="https://ubuntu.com/download/server">Ubuntu LTS</a>. It is well supported, widely documented, and designed for long-term stability. The less time I need to log into it and fuss around, the more I like it.</p><p>Most of my services run in Docker containers. Docker has become the common deployment model for many self-hosted applications, and for good reason. It simplifies installation, isolates services from one another, makes upgrades relatively painless, and provides a consistent way to manage software regardless of how it was originally packaged.</p><p>With the platform out of the way, the more interesting question is what to run on it and why. I did not set out to replace every commercial service simply for the sake of self-hosting. I chose applications where control, continuity, privacy, or long-term access mattered enough to justify taking responsibility for them myself.</p><p>What follows is not a list of software recommendations so much as a look at the services I chose, the problem each one solves, and why I decided it was worth bringing that part of my digital life back under my own control.</p><h3>PhotoPrism: Replacing iCloud Photos</h3><p>Photos were one of the first things I wanted out of the cloud. Over the years, iCloud Photos had quietly become the permanent home for thousands of pictures and videos, which meant Apple controlled not only where they were stored, but how I accessed, organized, synchronized, and exported them.</p><p>Regardless of which replacement you choose, your first step is to get the originals out of iCloud&#8217;s stinking paws, preserve the metadata, organize the files, and make a backup somewhere other than the server hosting them. Trust me on this.</p><p>Sadly, the process involves more than simply downloading a pile of pictures. You have to deal with duplicates, Live Photos, videos, timestamps, location data, directory structure, and some reliable way of getting new photos off the phone. It&#8217;s never easy getting away from the <em><a href="https://www.youtube.com/shorts/fVkWhfDchbE">pusherman</a></em>.</p><p>I looked at several photo-hosting options but ultimately chose <a href="https://www.photoprism.app/">PhotoPrism</a>. It is open source, does a great job of indexing and cataloging image and video files, and still gives me a modern web interface for browsing, searching, and organizing them. What I really like, however, is that PhotoPrism does not own the library. The photographs remain ordinary files stored in directories I control, while PhotoPrism simply builds a searchable catalog around them.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PIsa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PIsa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 424w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 848w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 1272w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PIsa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png" width="600" height="506" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d8457f4-59df-44d3-8617-03648faaed11_600x506.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:506,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:498549,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206890473?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PIsa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 424w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 848w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 1272w, https://substackcdn.com/image/fetch/$s_!PIsa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d8457f4-59df-44d3-8617-03648faaed11_600x506.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Setting up PhotoPrism was easy. I deployed it as a Docker container alongside MariaDB and pointed it at the directory containing my photo library. Once configured, PhotoPrism indexed the collection, generated thumbnails, extracted metadata, and built its searchable catalog automatically.</p><div class="callout-block" data-callout="true"><p>If I had written this article last year, I probably would have explained how to build each Docker Compose file step by step. Today, deploying most self-hosted services is almost trivial if you are comfortable with Docker. Any capable AI assistant can generate a workable Compose file in seconds. The important part is not the YAML itself, but understanding where the application stores its data, database, thumbnails, configuration, and backups.</p></div><p>In my setup, the original photographs live in their own directory, while PhotoPrism keeps its thumbnails, search index, cache, and other application data separately. MariaDB has its own storage as well. That separation matters because the originals are the library. Everything else can be rebuilt.</p><p>The photos are still just files. I can browse them, copy them, back them up, or move them somewhere else without asking PhotoPrism for permission. The database and thumbnails are useful, but they are not the library.</p><p>Once the containers came up, I logged in as the administrator and waited, and waited, while PhotoPrism finished indexing the collection and generating thumbnails. It was worth it because, when it was done, my photos were finally free from Apple&#8217;s grasp.</p><p>On Android and iPhone, you can use <a href="https://www.photosync-app.com/home">PhotoSync</a> to send new pictures to PhotoPrism. It is not quite as transparent as iCloud on an iPhone and requires a little setup, but once configured it works well.</p><h3>Contacts and Calendars</h3><p>I never liked giving Apple access to my contacts and calendars, especially when you consider what those records reveal. A contact list maps your relationships. A calendar records where you have been, where you plan to be, who you meet with, and what matters to you. Together, they provide a remarkably detailed picture of your life.</p><p>We have seen all too often how governments, corporations, and self-appointed experts convince themselves that access to such information is justified in the name of safety, public health, security, misinformation, or some other greater good. Once the information is centralized, the temptation to use it always seems to follow.</p><p>Getting the data out was easy enough because both contacts and calendars already use open standards. Contacts can be exported as vCard files, calendars as iCalendar files, and most modern applications can synchronize directly through CardDAV and CalDAV.</p><p>After looking at the available options, I found <a href="https://radicale.org/v3.html">Radicale</a> to be the simplest and best fit for what I wanted. It is free, open source, and its developers have zero interest in turning it into the next all-in-one collaboration platform. It is just a <a href="https://radicale.org/v3.html#architecture">CardDAV and CalDAV</a> server, and that&#8217;s all.</p><blockquote><p>Radicale has been started as a (free topic) <a href="https://radicale.org/v3.html#about">stupid school project</a> replacing another (assigned topic) even more stupid school project.</p></blockquote><p>Radicale does not own the data. Contacts and calendars remain ordinary files stored in standard formats and a simple directory structure. I can inspect them, back them up, copy them, or move them to another server without asking Radicale for permission. The server provides synchronization, but it is not the data.</p><p>Like PhotoPrism,  I run Radicale in a small Docker container with its configuration mounted read-only and its data stored in a separate directory on the host. The container runs under an ordinary user account rather than as root, and the data directory is included in my normal backup routine.</p><p>Radicale listens on port 5232, but I do not treat that as an invitation to expose it directly to the Internet. Remote access should sit behind proper authentication, TLS, and whatever secure proxy or private-network arrangement you use for the rest of your services.</p><p>On Android, since I use Fossify Calendar and Android&#8217;s Contacts app, I needed a little extra plumbing. DAVx&#8309; connects both to Radicale and handles the synchronization in the background. Day to day, I rarely open it unless something needs troubleshooting.</p><p>On macOS, no extra plumbing was necessary. I simply added the Radicale accounts to the built-in Contacts and Calendar applications, which already support CardDAV and CalDAV. If you are an iPhone user, the process is much the same. Add the account once, and the built-in Contacts and Calendar applications handle the rest.</p><h3>Paperless: Replacing the Filing Cabinet</h3><p>In the past, I used the scanner built into my laser printer to turn important documents into PDFs. These days, phone cameras and scanning apps are good enough that I usually scan them directly to PDF instead. Receipts, warranties, tax records, and other important paperwork ended up in folders on a local file server. That worked well enough until the collection grew large and finding something became an exercise in remembering where I had filed it.</p><p>I have been experimenting with self-hosting <a href="https://docs.paperless-ngx.com/">Paperless-ngx</a>, another community-supported, open-source document management system. It imports PDFs and images, performs optical character recognition (OCR), indexes their contents, and makes them easy to search through a web interface.</p><p>Like the other self-hosted applications I use, Paperless builds useful services around the documents rather than taking ownership of them. The PDFs remain mine. Paperless simply makes them easier to organize, search, and find.</p><p>One area I find particularly interesting is combining the archive with a <a href="https://www.reddit.com/r/selfhosted/comments/18ok7u8/selfhosted_large_language_model/">self-hosted language model</a>. Projects such as <a href="https://github.com/clusterzx/paperless-ai">Paperless-AI</a> and <a href="https://github.com/icereed/paperless-gpt">paperless-gpt</a> are already flying at nap-of-the-earth level, close enough to use today if you are willing to do a little tinkering. The AI could integrate directly with Paperless or simply index the PDFs themselves.</p><p>That would allow me to ask questions such as, &#8220;How much did I pay for that well pump?&#8221; and have the system locate the receipt and point me directly to the source document.</p><h3>Jellyfin: Do You Actually Own the Movies You Buy?</h3><p>In <a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-d5e">an earlier article</a>, I wrote about movies and television shows disappearing from my Apple TV library after I had supposedly purchased them. The reason might be a <a href="https://www.forbes.com/sites/johnarcher/2018/09/17/apple-responds-to-disappearing-itunes-movie-purchases-issue/?sh=64f71c3472b6">licensing agreement, a dispute with a studio</a>, or maybe a decision by someone, somewhere, that it was <em>in my best interest</em> that the content no longer be available. Whatever the explanation, the result was the same: I had paid for something and now I could no longer access it.</p><p>A digital purchase tied to somebody else&#8217;s store is not really ownership. It is merely permission to watch for as long as they allow it. Apparently, this is what <em>you will own nothing and be happy</em> looks like in practice.</p><p>So screw them. I started buying discs, often second-hand, converting them into ordinary video files, and storing them on my own NAS. It requires more effort than clicking Buy, but in the end the files are mine and the library cannot be altered by some third-party asshole.</p><p>Today the common practice is to rip commercial discs to MKV using <a href="https://www.makemkv.com/">MakeMKV</a> and then transcode the resulting files with <a href="https://handbrake.fr/">HandBrake</a>. This produces clean, unprotected video files suitable for efficient storage and streaming while keeping the transcoding work inside the tool most people already know and trust.</p><p>Once the files were ready, I stored the video library on its own disk drive and ran <a href="https://jellyfin.org/">Jellyfin</a> in a Docker container to serve it up. Another option is to store the files on a NAS and point Jellyfin to the library there.</p><p>Jellyfin is a free,<a href="https://jellyfin.org/contribute"> open-source</a> media server designed to organize and stream personal collections of movies, television shows, music, and other media. Think of it as your own private version of Netflix, except the content is stored on hardware you control rather than somebody else&#8217;s servers.</p><p>Jellyfin catalogs movies and television shows, downloads artwork and metadata, and tracks viewing progress. To watch something, I open the Jellyfin app on a television, streaming box, phone, tablet, or computer. The experience is much like using a commercial streaming service: browse the library, choose a title, and press Play. <a href="https://jellyfin.org/downloads/clients/">Clients</a> are available for most major platforms.</p><p>Like most of the services discussed here, Jellyfin does not require particularly powerful hardware. If your clients can play the stored media directly, even modest systems work well. Where this starts to break down is with on-the-fly transcoding or multiple simultaneous users. For that, you&#8217;re gonna need a bigger boat.</p><h3>Navidrome: Play That Funky Music</h3><p>Music has many of the same ownership problems as movies and television. Streaming services are convenient, but access ultimately depends on licensing agreements, subscriptions, and the whims of whoever happens to control the platform.</p><p>Just like my movie collection, I solved the problem the old-fashioned way. I ripped my music CDs to disk and stored the files on my server.  </p><p>To host and stream those files, I use <a href="https://www.navidrome.org/">Navidrome</a>. And guess what, Navidrome runs in a Docker container too and simply points at a directory containing the music library. It is a free, open-source music server designed around simplicity rather than becoming an all-in-one media platform.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!T_zt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T_zt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 424w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 848w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 1272w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T_zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp" width="650" height="497" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:497,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:38180,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206890473?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!T_zt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 424w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 848w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 1272w, https://substackcdn.com/image/fetch/$s_!T_zt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3ceac44f-4373-442e-ae85-3c518bde84ae_650x497.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Navidrome catalogs the library, downloads artwork and metadata, builds playlists, and makes the collection available through a web interface. It also supports the Subsonic protocol, which means there are <a href="https://www.navidrome.org/apps/">numerous compatible clients available</a> for phones, tablets, desktop computers, and even car audio systems.</p><p>Like Jellyfin, Navidrome does not own the music. The files remain ordinary files stored in ordinary directories. I can copy them, back them up, move them to another server, or replace Navidrome entirely without affecting the collection. </p><p>Navidrome provides the service. The music library is the dish.</p><h3><strong>Forgejo: Your Work Has Value Too</strong></h3><p>Most people think of photos, documents, music, and movies as personal data. As a software developer, I would add source code to that list.</p><p>Years of work can be wrapped up in a repository. Even if the code itself has no commercial value, it often represents thousands of hours of learning, experimentation, and problem solving.</p><p>For years I used GitHub, and I still use it as my primary platform for sharing public projects. It has its place. But like every other hosted platform, it comes with baggage. Content moderation disputes, shifting policies, and the general trend toward centralization all serve as reminders that GitHub is ultimately Microsoft&#8217;s house.</p><p>The AI question makes that especially clear: if I publish code on GitHub, should Microsoft be allowed to train on it and generate similar code without giving credit or attribution? </p><p>To host my own repositories, I run yet another Docker container, this one running Forgejo. Forgejo manages Git repositories, issues, pull requests, and projects through a browser-based interface not unlike GitHub.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cGbk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cGbk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 424w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 848w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 1272w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cGbk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png" width="578" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:578,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:141181,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206890473?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cGbk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 424w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 848w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 1272w, https://substackcdn.com/image/fetch/$s_!cGbk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e2309bd-5c89-4633-a398-29ff3ffb229d_578x484.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Because Git was designed as a distributed version control system, every repository is already self-contained and portable. Forgejo does not own the repositories. I can back them up, mirror them elsewhere, move them to another server, or replace Forgejo entirely without affecting the source code.</p><h3>Taking Back Your Digital Life</h3><p>Self-hosting is not effortless. You have to do the work. The reward is owning a little more of your digital life. But at the end of the day, the data is under your control. It lives in open, portable formats, and even if a developer walks away tomorrow, your server keeps running. And chances are, somebody else will step in and pick up the slack.</p><div><hr></div><p><span>That question of who gets to decide runs through </span><a href="https://www.vinthewrench.com/p/its-about-independence">much of what I write</a><span>, whether the subject is electronics, software, </span><a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a><span>, </span><a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a><span> or </span><a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a><span>. The subject may change without warning, but the underlying questions are usually the same: How was this made? Why was it built this way? And who gets to control it?</span></p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[I’m a Pushover for Self-Hosting]]></title><description><![CDATA[Adding remote notifications without Apple&#8217;s infrastructure.]]></description><link>https://www.vinthewrench.com/p/im-a-pushover-for-self-hosting</link><guid isPermaLink="false">https://www.vinthewrench.com/p/im-a-pushover-for-self-hosting</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sun, 12 Jul 2026 20:51:33 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RfLv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RfLv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RfLv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 424w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 848w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 1272w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RfLv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png" width="600" height="409" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:409,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:430763,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206729014?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RfLv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 424w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 848w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 1272w, https://substackcdn.com/image/fetch/$s_!RfLv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1ad83dab-a2e4-4387-aa9c-44bfe545e8c2_600x409.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I have spent a lot of time trying to make my <a href="https://www.vinthewrench.com/p/vinnies-farm-automation-projects">farm automation projects</a> reliable. But the unavoidable reality is that, no matter how carefully a system is designed, things will still break from time to time. Hardware stops responding, networks disappear, power goes out, and valves sometimes refuse to cooperate.</p><p>Not only do I lack the luxury of watching a dashboard all day waiting for trouble, I have absolutely zero interest in doing so. The systems should be designed to let me know when something is broken.</p><p>That is where notification services come in. Years ago, the answer might have been to automate a pager or send an SMS message. Later, smartphones made push notifications the obvious solution. </p><p>Push notifications became important because mobile applications could not simply remain awake indefinitely waiting for new information. A notification service provided the path from a remote server to the device and alerted the user when something required attention.</p><p>I had experience coding against Apple&#8217;s notification service and was familiar with Google&#8217;s as well, but I was not about to depend on either company&#8217;s permission to operate my farm. My systems should not care what brand of phone I happen to own next year, and building around either company&#8217;s notification stack would have recreated exactly the kind of dependency I was trying to leave behind.</p><p>What I wanted instead was a reliable, cross-platform notification service with a simple API that could be called from code, shell scripts, monitoring tools, or small services, with support for priorities, sounds, and acknowledgements when needed.</p><p>I considered <a href="https://gotify.net/">Gotify</a> and <a href="https://ntfy.sh/">ntfy</a>, both capable self-hosted notification platforms with simple APIs and their own delivery infrastructure, but they did more than I needed. I wanted reliable delivery across both Android and iOS without operating another internet-facing service just to send a few alerts.</p><h3>Behold Pushover</h3><p>Obviously, I was not the only one looking for a simpler solution. <a href="https://blog.pushover.net/posts/2022/3/ten?utm_source=chatgpt.com">More than a decade ago, </a>software developer and consultant Joshua Stein needed a reliable way for his scripts, servers, and monitoring tools to reach his phone without building an entire notification system himself.  </p><p>What started as a side project eventually became <a href="https://pushover.net/">Pushover</a>.  Unlike many technology services that expand into sprawling platforms, it has remained focused on one job: getting a message from a program to a person&#8217;s phone.</p><p>Pushover is butt-stupid simple to use. Sending a notification is just an HTTPS request containing an application token, a user key, and a message:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;2c6ffe40-2d80-4e38-ada9-341d67aa3e86&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">POST /1/messages.json HTTP/1.1
Host: api.pushover.net
Content-Type: application/json; charset=utf-8

{
  "token": "YOUR_APPLICATION_TOKEN",
  "user": "YOUR_USER_KEY",
  "title": "Test Message",
  "message": "Something requires your attention",
  "url": "https://example.com/status"
}</code></pre></div><p>A program sends a small JSON document, and a notification appears on the recipient&#8217;s phone. The API also supports priorities, custom sounds, images, acknowledgements, and other features, but the basic use case remains simple and straightforward.</p><p>The receiving side is just as simple. You install the Pushover client on an <a href="https://play.google.com/store/apps/details?id=net.superblock.pushover">Android</a> phone, <a href="https://apps.apple.com/us/app/pushover-notifications/id506088175">iPhone, iPad</a>, or <a href="https://pushover.net/clients/desktop">desktop</a> browser, sign in, and register the device with your account. </p><p>Messages sent to your user key normally appear on all registered devices, although they can also be directed to a specific device. </p><p>After a 30-day trial, <a href="https://pushover.net/pricing">an individual license</a> costs <strong>$4.99 once per platform</strong>, with no subscription fee, and that license covers all of your devices on that platform. </p><p>That&#8217;s it!</p><h3>How I Use It</h3><p>I just want to know when something is broken.</p><p>I use Pushover to report when a system becomes unreachable, a valve or field device stops responding, AC power fails, a hardware fault appears, or a failed system recovers and begins responding again.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SZo2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SZo2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 424w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 848w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 1272w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SZo2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp" width="600" height="298" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:298,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:12402,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206729014?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SZo2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 424w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 848w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 1272w, https://substackcdn.com/image/fetch/$s_!SZo2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5866c16a-01d8-4be1-9baf-6c4517172525_600x298.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>My code detects and records the problem, then sends a POST request to the Pushover API. Pushover delivers the message, so no one has to sit in front of a dashboard waiting for something to fail.</p><h3>How About Some Privacy?</h3><p>Pushover does not manage my devices, collect sensor data, or control how my systems operate. It only delivers a message when one of those systems decides that I need to know something.</p><p>Pushover can see the notifications it delivers, but they do not need to contain sensitive information. A message can simply report that a problem exists and link to a protected dashboard containing the details. In my case, that dashboard is reached through a <a href="https://developers.cloudflare.com/tunnel/">Cloudflare Tunnel</a> over HTTPS, which also avoids opening an inbound port on the farm network.</p><p>Someone monitoring my Wi-Fi, local network, ISP connection, or the path across the Internet can see that traffic is being exchanged, but cannot read or alter its contents in transit. Cloudflare can technically inspect the traffic because it terminates the HTTPS connection, so the application still needs proper authentication and security.</p><h3>Why This Still Fits a Self-Hosting Mindset</h3><p>Self-sufficiency does not require every supporting service to run on hardware you own. What matters is keeping the essential operation and decision-making under your control, while using outside services only as limited, replaceable tools.</p><p>My systems still detect problems, record what happened, and decide when to send an alert. If Pushover is unavailable, the farm keeps operating. I simply may not receive the message immediately.</p><p>I am not outsourcing the system. I am outsourcing the last mile between the system and my pocket.</p><div><hr></div><p>That same question of control runs through<span> </span><a href="https://www.vinthewrench.com/p/its-about-independence">much of what I write</a><span>, whether the subject is electronics, software, </span><a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a><span>, </span><a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a><span> or </span><a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a><span>. The subject may change without warning, but the underlying questions are usually the same: How was this made? Why was it built this way? And who gets to control it?</span></p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[We Don’t Need No Stinking Ecosystem]]></title><description><![CDATA[An index of the articles documenting my move from Apple&#8217;s ecosystem to self-hosted alternatives]]></description><link>https://www.vinthewrench.com/p/we-dont-need-no-stinking-ecosystem</link><guid isPermaLink="false">https://www.vinthewrench.com/p/we-dont-need-no-stinking-ecosystem</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sun, 12 Jul 2026 17:56:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!rVWM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rVWM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rVWM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 424w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 848w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 1272w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rVWM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png" width="640" height="360" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:360,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:140003,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206696662?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rVWM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 424w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 848w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 1272w, https://substackcdn.com/image/fetch/$s_!rVWM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0873f573-2598-4af3-96b9-9ef6b765afb5_640x360.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Long before I began writing about leaving Apple, I was writing about privacy, cryptography, and technological independence. More than that, I spent much of my life building the tools used to protect those things. As someone who came out of the OG cypherpunk tradition, I have always believed that privacy is not a privilege to be granted. It is a preexisting right, and the primary purpose of our institutions is to secure such rights, not to dispense them.</p><p>That principle applies to every fundamental right. The right to keep and bear arms appears immediately after the protections of speech, religion, assembly, and petition in the Bill of Rights for a reason: liberty cannot be preserved through complacency. Rights survive only when people remain vigilant and are willing to defend them against erosion, whether that erosion comes from government, corporations, or institutions claiming to act in the public interest.</p><p>Strong encryption, open systems, and code are simply the modern tools we use to defend what was already ours.</p><p>That same concern eventually shaped how I looked at the technology I used every day. What pushed me away from Apple was not merely constant platform churn, but a growing distrust of a technology culture increasingly comfortable with centralized identity, surveillance, and institutional control.</p><p>That is why we built tools that made individuals harder to control.  The newer tech-bro instinct seems more interested in making it easier for institutions to control us by deciding what is best for everyone else, a familiar strain of Progressivism dressed up as Effective Altruism, trust and safety, or responsible innovation.</p><p>That path is little more than a way station to tyranny. It rejects the self-evident truth that our rights are inherent, replacing liberty with permissions granted by institutions claiming to act for our own good.</p><div class="pullquote"><p>&#8220;It is hard to imagine a more stupid or more dangerous way of making decisions than by putting those decisions in the hands of people who pay no price for being wrong.&#8221;<br>&#8212; Thomas Sowell (&#8220;<a href="http://www.jewishworldreview.com/cols/sowell081800.asp">Wake Up, Parents</a>!&#8221;)</p></div><p>The articles collected here document my effort to move in the opposite direction: away from dependency, centralization, and institutional control, and toward cross-platform tools, self-hosted services, and systems I can understand, maintain, and control myself.</p><ul><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem">Part 1 &#8212; Leaving the Apple Ecosystem</a>:</strong> Why I began moving away from Apple and started exploring Linux as my primary computing platform.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part">Part 2 &#8212; Continuing the Move</a>:</strong> My early experience setting up Ubuntu and adjusting to daily life outside macOS.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-d5e">Part 3 &#8212; Replacing the Applications</a>:</strong> The software and cross-platform tools I chose to replace the applications and services I had used inside Apple&#8217;s ecosystem.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-920">Part 4 &#8212; Moving Beyond the iPhone</a>:</strong> My search for a practical mobile-phone alternative that reduced my dependence on Apple.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-879">Part 5 &#8212; Privacy and Independent Services</a>:</strong> A closer look at privacy-focused services and taking greater control of my data and communications.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/leaving-the-apple-ecosystem-part-db9">Part 6 &#8212; Nine Months Later</a>:</strong> An honest follow-up on what worked, what did not, and how life outside the Apple ecosystem turned out.</p></li><li><p><strong>&#8288;<a href="https://www.vinthewrench.com/p/we-have-always-been-at-war-with-cryptography-a36d90ced73f">We Have Always Been at War with Cryptography</a>:</strong> Why government-mandated backdoors and weakened encryption threaten the privacy and security of everyone.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/im-a-pushover-for-self-hosting">I&#8217;m a Pushover for Self Hosting</a>: </strong>Adding remote notifications without Apple&#8217;s infrastructure.</p></li><li><p><strong><a href="https://www.vinthewrench.com/p/taking-back-the-infrastructure">Taking Back the Infrastructure: Self-Hosting the Services I Use Every Day</a></strong><br><em>A look at how PhotoPrism, Paperless, Forgejo, Jellyfin, Navidrome, Radicale, and other self-hosted services helped me replace cloud dependencies with systems I control myself.</em></p></li><li><p><strong><a href="https://www.vinthewrench.com/p/self-hosting-without-the-exposure">Self-Hosting Without the Exposure</a></strong></p><p><em>How to access your self-hosted applications with Cloudflare while keeping your home network private.</em></p></li></ul><div><hr></div><p>Funny story: I was using GPT for grammar and spelling edits, and it became absolutely twitterpated over the Thomas Sowell quote above.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dOVg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dOVg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 424w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 848w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 1272w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dOVg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png" width="600" height="65" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:65,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:41656,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206696662?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!dOVg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 424w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 848w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 1272w, https://substackcdn.com/image/fetch/$s_!dOVg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F688eb696-7fbd-4648-a266-bc37e9652c1c_600x65.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>A fitting reminder that the tech bros, and systems they build to act on their behalf, cannot be trusted to decide what the rest of us are allowed to say, read, or think.</p><p>That question of who gets to decide runs through <a href="https://www.vinthewrench.com/p/its-about-independence">much of what I write</a>, whether the subject is electronics, software, <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a>,  <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a> or <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a>. The subject may change without warning, but the underlying questions are usually the same: How was this made? Why was it built this way? And who gets to control it?</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Reading DS18B20 Temperature Sensors on the Pi Without OWFS]]></title><description><![CDATA[Talking to the DS2482-100 I&#178;C-to-1-Wire bridge directly]]></description><link>https://www.vinthewrench.com/p/reading-ds18b20-temperature-sensors</link><guid isPermaLink="false">https://www.vinthewrench.com/p/reading-ds18b20-temperature-sensors</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sat, 11 Jul 2026 20:21:22 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!0gtJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-a4c">earlier article</a>, I wrote about using DS18B20 1-Wire temperature sensors with a Raspberry Pi.  These little sensors are handy because they are cheap, digital, and easy to place even in harsh environments. I have had one buried in my garden for about two years now, reliably reporting the soil temperature.</p><p>That earlier project started with the simple Linux GPIO 1-Wire path. Later, I moved to the  <a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ds2482-100.pdf">DS2482-100 I&#178;C-to-1-Wire bridge</a> and added better ESD protection and isolated sensor power to handle some of the practical problems that show up when a sensor cable leaves the bench and heads outside.</p><p>On the software side, I started with OWFS. OWFS stands for <strong><a href="https://www.owfs.org/">1-Wire File System</a></strong>. It is a user-space system that makes 1-Wire devices appear as files and directories. That meant I did not have to write code to talk directly to the DS2482-100 or manually issue DS18B20 commands. I could mount the 1-Wire bus and read temperature values using filesystem I/O.</p><p>I needed to get the system working and out in the field, and OWFS was a good expedient path. It let me verify the DS2482-100, see the DS18B20 sensors, and get real temperature readings without getting wrapped around the axle writing my own driver.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qFk0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qFk0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 424w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 848w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 1272w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qFk0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png" width="700" height="301" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/affcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:301,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:110216,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206367889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qFk0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 424w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 848w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 1272w, https://substackcdn.com/image/fetch/$s_!qFk0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faffcf56d-32bc-4fd2-b0b9-77f8406d47fd_700x301.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">DS2482-100 plus DS9503P: the Pi talks I&#178;C, and the exposed 1-Wire wiring gets ESD protection before it leaves the board.</figcaption></figure></div><p>Fast-forward to the present. I had added a couple of custom I&#178;C devices for <a href="https://www.vinthewrench.com/p/tangled-up-in-wires">valve control</a> and <a href="https://www.vinthewrench.com/p/chasing-raspberry-pi-power-management">power management</a>, and suddenly I found myself debugging all sorts of I&#178;C timing problems, intermittent failures, and general weirdness.</p><p>I don&#8217;t know for certain whether OWFS caused any of the I&#178;C problems. I suspected the real problem was in the TWI firmware and transaction handling that I let AI help me write. Either way, OWFS was another process with access to the same I&#178;C bus through the DS2482-100, and I didn&#8217;t need another piece of code jabbering on the bus behind my back while I was trying to debug it.</p><p>Writing reliable I&#178;C/TWI firmware on an AVR like the ATmega88 is not trivial. The AVR has to respond inside the master&#8217;s timing window, keep its state machine straight, and avoid returning stale or half-ready data while the Raspberry Pi is asking for the next byte. There are a lot of chainsaws to juggle.</p><p>In my case, a lot of the intermittent weirdness pretty much went away when I slowed the bus from 100 kHz to 80 kHz. That does not prove the Raspberry Pi was the root cause, but it tells me the system needed more timing margin.</p><p>This is also running on a Raspberry Pi Zero 2 W, and Raspberry Pi I&#178;C has its own personality. The Pi is a Linux machine using the Broadcom I&#178;C controller, not a small microcontroller bit-banging a private bus in a tight loop. If a slave stretches the clock, responds a little late, has slow rise times, or needs a little breathing room between command and reply, the Pi side can be less forgiving than expected. </p><p>Dropping to 80 kHz gave the AVR firmware, the bus edges, and the whole request/response contract enough room to stop stepping on itself.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3zLi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3zLi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 424w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 848w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 1272w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3zLi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp" width="650" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:52036,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206367889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3zLi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 424w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 848w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 1272w, https://substackcdn.com/image/fetch/$s_!3zLi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb8799beb-0a0d-41f5-9c82-513e4b18910a_650x368.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Cutting Out the Middleman</h3><p>Lowering the bus speed fixed  enough of the immediate weirdness to keep moving, but it also made one thing obvious: I needed fewer hidden pieces touching the bus.</p><p>So to simplify my life, I decided to bring the DS18B20 temperature sensors into the same framework as the rest of my irrigation server code. Lose the OWFS mount, lose the FUSE layer, and lose the separate daemon talking to the DS2482-100 and doing I&#178;C behind my back.</p><p>That meant writing a simple DS2482-100 / DS18B20 driver. A year ago, I would have started my quest by searching the net for sample code. But this is the Era of LLMs, so naturally I took the lazy man&#8217;s approach and asked AI to vibe-code me a sample. This is how a man saves two hours up front and then spends two weeks debugging the crappy code it gave him.</p><p>And so, I present you: &#8288;<a href="https://github.com/vinthewrench/ds2482_demo">ds2482_demo</a>, a small standalone program that talks directly to the DS2482-100 and reads DS18B20 sensors without OWFS.   </p><p>For the demo, I hung two DS18B20 sensors on the same 1-Wire bus, probed the bus to get their ROM addresses, and then asked the program to read the temperature from one of them.  </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;ea47112b-1d64-4384-92b2-235d30f53b7f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">./ds2482_demo probe
DS2482 address: 0x18 on /dev/i2c-1
DS18B20 sensors found: 2
  28-9d-74-46-d4-6c-0c-4d
  28-3d-85-35-00-00-00-69

./ds2482_demo temp 28-9d-74-46-d4-6c-0c-4d
DS2482 address: 0x18 on /dev/i2c-1 28-9d-74-46-d4-6c-0c-4d 
scratchpad 83 01 55 05 7f a5 a5 66 25
24.1875 C  75.5375 F  </code></pre></div><p>To quote the great philosopher Mediocrates: &#8220;Meh, good enough.&#8221;</p><h3>Debugging This Puppy</h3><p>The next step was to stop guessing and look at what was actually happening on the wire. For that, I needed the right hammer.</p><p>Every now and then you run across something so cool it just blows your mind. The &#8288;<a href="https://www.saleae.com/logic">Saleae Logic 8</a>, an 8-channel USB logic analyzer, is one of those. It takes the invisible stuff happening on tiny wires and turns it into something you can actually see, decode, and get a grip on. Since I do enough screwing around with I&#178;C and other logic-level signals, I finally took the plunge and invested in one.</p><p>The Saleae Logic 8 is a small USB box about the size of a pack of mints, but it can watch eight digital lines at once, decode protocols like I&#178;C and 1-Wire, and also record analog waveforms well enough to see things like slow edges, ringing, or a line that is not really making it cleanly high or low. It is not a replacement for a serious oscilloscope, but for this kind of embedded debugging it is incredibly useful: digital decoding and analog capture in the same view.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0gtJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0gtJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 424w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 848w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 1272w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0gtJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp" width="700" height="473" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:473,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24836,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206367889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0gtJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 424w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 848w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 1272w, https://substackcdn.com/image/fetch/$s_!0gtJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F425e7555-5c31-4ea6-a3ee-94326b1943cd_700x473.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But what really makes it shine is the protocol decoder stack. The raw capture shows the actual voltage transitions, but the software can layer protocol decoders on top of that. In this case, I was able to decode the I&#178;C side of the DS2482-100 and the 1-Wire side at the same time, which let me see both what the Raspberry Pi told the bridge to do and what the bridge actually put on the sensor bus.</p><h3>Speaking Two Languages</h3><p>Let&#8217;s walk through the details of how this works. Reading a DS18B20 sensor through a DS2482 is not a single &#8220;read temperature&#8221; operation. It is a conversation across two buses, with the DS2482 translating between I&#178;C on the Raspberry Pi side and 1-Wire on the sensor side.</p><p>The Pi never talks 1-Wire directly. It sends I&#178;C commands to the DS2482, and the DS2482 generates the reset pulses, write slots, read slots, and timing needed by the 1-Wire bus.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S4Mc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S4Mc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 424w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 848w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 1272w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S4Mc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png" width="1456" height="484" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:484,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:925791,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206367889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S4Mc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 424w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 848w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 1272w, https://substackcdn.com/image/fetch/$s_!S4Mc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8e76f38-f210-4966-813d-06a20b3c2fc8_1597x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Pi asks the DS2482 to perform a 1-Wire operation, then reads its status and data registers to find out what happened.  The bridge handles the time-critical signaling, while the Pi handles the higher-level sequence: reset the bus, select a sensor, start a conversion, wait for it to finish, read the scratchpad, verify the CRC, and turn the result into a temperature.</p><p>The whole exchange is easier to follow as a sequence of requests and responses as illustrated in the table below.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cYgJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cYgJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cYgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1422906,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206367889?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cYgJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!cYgJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4ff213f-b9c3-45c9-a17b-c84c28f15d2d_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Following the Bytes</h3><p>Now that we have glossed over the entire operation at a high level, let&#8217;s follow a temperature reading through the complete sequence using the transaction flow <a href="https://www.analog.com/media/en/technical-documentation/data-sheets/ds18b20.pdf">described in the DS18B20 datasheet</a>.</p><p>The datasheet breaks each access into three parts: initialization, a ROM command, and a DS18B20 function command. In practice, reading a temperature requires that sequence twice&#8212;once to start the conversion and again to read the completed result from the scratchpad.</p><h4>Reset and Presence Detection</h4><p>Every 1-Wire command sequence begins with a bus reset. The Raspberry Pi does not generate the required timing directly. Instead, it sends a command to the DS2482, which generates the reset pulse on the 1-Wire bus.</p><p>All devices on the bus watch for this reset. If one or more devices are present, they respond with a presence pulse, briefly pulling the bus low to announce that they are alive and ready to communicate.</p><p>The DS2482 detects the presence pulse and reports the result to the Raspberry Pi through its status register. If no presence pulse is detected, there is no point continuing because no sensor is available to answer the commands that follow.</p><p>At this stage, the Pi knows only that at least one device is present on the bus. It has not yet selected a particular sensor. That comes next, using the sensor&#8217;s unique 64-bit ROM address.</p><h4>Select the Sensor</h4><p>Every DS18B20 contains a unique 64-bit ROM address programmed at the factory. This allows multiple sensors to share the same 1-Wire bus while still being addressed individually.</p><p>After detecting that one or more devices are present, the Raspberry Pi tells the DS2482 to send a <strong>MATCH ROM</strong> command followed by the 64-bit address of the sensor it wants to use.</p><p>Every sensor on the bus receives the command, but only the device whose ROM address matches remains selected. The other sensors ignore subsequent commands until the next bus reset.</p><p>Communication is now directed to one DS18B20, allowing the Pi to issue a command without affecting the other sensors on the bus.</p><p>The next step is to tell the selected sensor to measure its temperature.</p><h4>Start the Conversion</h4><p>Once the sensor has been selected, the Raspberry Pi tells the DS2482 to send the DS18B20 <strong>CONVERT T</strong> command.</p><p>The DS18B20 begins measuring the temperature and will place the result in its internal scratchpad memory when the conversion is complete. The DS2482 does not perform the measurement; it carries the command across the 1-Wire bus and handles the required bus timing.</p><p>The conversion is not instantaneous. Its duration depends on the sensor&#8217;s configured resolution, ranging from 93.75 milliseconds at 9-bit resolution to as much as 750 milliseconds at 12-bit resolution.</p><h4>Wait for the Conversion</h4><p>The driver must wait for the DS18B20 to finish the conversion before attempting to retrieve the new result.</p><p>It can do this either by waiting for the maximum conversion time or, when the sensor&#8217;s power arrangement permits it, by polling the bus until the sensor indicates that the conversion is complete.</p><p>Attempting to read the scratchpad too soon would not provide a reliable indication that the newly requested measurement is ready. Once the conversion finishes, the new raw temperature value is stored in the scratchpad and can be retrieved.</p><p>Reading that value begins a new 1-Wire command sequence.</p><h4>Re-select the Sensor</h4><p>Before reading the scratchpad, the Raspberry Pi tells the DS2482 to perform another 1-Wire bus reset and checks for another presence pulse.</p><p>The reset ends the previous command sequence, so the target sensor must be selected again. As before, the Pi tells the DS2482 to send <strong>MATCH ROM</strong>, followed by the sensor&#8217;s 64-bit ROM address.</p><p>Only the matching DS18B20 remains selected. The driver can now request the scratchpad containing the newly measured temperature.</p><h4>Read the Scratchpad</h4><p>With the sensor selected again, the Raspberry Pi tells the DS2482 to send the DS18B20 <strong>READ SCRATCHPAD</strong> command.</p><p>The sensor returns nine bytes: eight bytes of scratchpad data followed by a ninth byte containing the CRC. The first two data bytes contain the raw temperature value. The remaining data bytes contain alarm thresholds, configuration information, and reserved values.</p><p>The DS2482 transfers the scratchpad bytes from the 1-Wire bus to the Raspberry Pi over I&#178;C. The Pi retrieves each byte from the DS2482 as the read progresses.</p><p>At this point, the driver has the raw sensor data, but it should not trust that data until the CRC has been checked.</p><h4>Verify the CRC</h4><p>The DS18B20 scratchpad contains eight bytes of data followed by a ninth byte containing an 8-bit CRC.</p><p>The driver calculates the CRC across the first eight bytes and compares its result with the CRC byte returned by the sensor. If the two values match, the scratchpad was received intact.</p><p>If they do not match, one or more bits may have been corrupted during communication, and the temperature reading is discarded rather than treated as valid.</p><h4>Decode the Temperature</h4><p>Once the CRC has been verified, the driver can trust the scratchpad data.</p><p>The first two bytes contain the raw temperature measurement, stored least-significant byte first as a signed 16-bit two&#8217;s-complement value. At 12-bit resolution, each count represents 1/16 &#176;C, or 0.0625 &#176;C.</p><p>The driver combines the two bytes, interprets the result as a signed value, and applies the appropriate scale to produce a temperature in degrees Celsius. Since this is intended for human consumption, naturally we convert it to Fahrenheit.</p><h3>Enough with the Bits Already</h3><p>I think that is enough geek-bit talk for one article. I will not torment you further by walking through the Saleae capture byte by byte.</p><p>Suffice it to say, the protocol decoders let me follow the entire exchange from the Raspberry Pi, through the DS2482, and out onto the 1-Wire bus. The bytes on the screen matched what the datasheet said should be happening.</p><p>Once the standalone demo was reliably talking to the DS2482, I folded that code into pIoTServer as another <a href="https://github.com/vinthewrench/piotserver/tree/master/drivers/DS2482">native driver</a>, following the same driver framework described in &#8288;<a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-9ef">Raspberry Pi Internet of Things, Part 9</a>.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;f49c4871-f321-4575-a134-a31bc2cb82c6&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">"devices": [
        {
            "address": "0x18",
            "description": "DS2482 1-Wire temperature bridge",
            "device_type": "DS2482",
            "enable": true,
            "interval": 30,
            "pins": [
                {
                    "data_type": "TEMPERATURE",
                    "description": "Plot A Soil Temperature",
                    "interval": 30,
                    "key": "PLOT1",
                    "other.props": {
                        "address": "28-9d-74-46-d4-6c-0c-4d"
                    },
                    "title": "Soil Temp Plot A",
                    "tracking": "track.range"
                }
            ],
            "title": "Soil Temperature 1-Wire Bus"
        },
  ...
]</code></pre></div><h3>Well, Was It Worth It?</h3><p>In the end, the result was surprisingly uneventful, which is exactly what I wanted. I replaced OWFS, the FUSE mount, and the supporting daemons with a few hundred lines of code that I understood, could debug, and could maintain.</p><p>The DS18B20 sensors became just another part of the <strong>pIoTServer</strong> ecosystem, and the soil temperature values flowed through the same configuration, logging, REST API, dashboard, and automation framework as every other device in the system.</p><p>Was OWFS the cause of the strange I&#178;C behavior I had been chasing? Methinks not. There is still the lingering odor of crappy vibe coding in the AVR firmware. But removing OWFS eliminated another moving part from the I&#178;C bus and gave me complete visibility into what was happening from end to end.</p><p>And if nothing else, I now understand a lot more about how a DS2482 actually talks to a DS18B20. Sometimes you have to open the hood and tear out a few wires to see what is really going on underneath.</p><p>Besides, if I am going to spend two weeks debugging and cussing at code, it might as well be my code.</p><div><hr></div><p>If you care about how things are made and enjoy ripping out the wires and cussing at them like I do, you will probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a><span>. It is not always code.  Rumor has it that </span>sometimes<span> I jump from </span><a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a><span> to </span><a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a><span> to </span><a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a><span> without much warning.</span></p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Garden Irrigation Evolution]]></title><description><![CDATA[&#8220;Stuff&#8217;s getting better. Stuff&#8217;s getting better every day.&#8221;]]></description><link>https://www.vinthewrench.com/p/garden-irrigation-evolution</link><guid isPermaLink="false">https://www.vinthewrench.com/p/garden-irrigation-evolution</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Thu, 09 Jul 2026 20:50:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!WnrC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you are new to this series, let me catch you up. We purchased some property and moved out to Arkansas a few years ago with a plan to, among other things, establish a market garden.</p><p>The property had previously been used for cattle, so part of the job was <a href="https://www.vinthewrench.com/p/this-is-my-dirt">turning pasture into vegetable beds</a>. We had plenty of water from a nearby well, but we still had to get it to the crops. So we <a href="https://www.vinthewrench.com/p/be-water-my-friend">dug trenches, laid pipe, hooked up valves and filters</a>, and ran drip lines.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EH2v!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EH2v!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 424w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 848w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 1272w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EH2v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic" width="1200" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339085,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EH2v!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 424w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 848w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 1272w, https://substackcdn.com/image/fetch/$s_!EH2v!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37fa24ac-7d19-4b34-8b4d-494cc97c7889_1200x576.heic 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">First came the trenches, pipe, valves, filters, and mud. Lots of mud.</figcaption></figure></div><p>A farm has a lot of jobs, and I did not want irrigation to depend on someone remembering to open and close valves at the right time every day. So I needed a field-expedient way to automate the watering while the rest of the farm was still being built.</p><p>My first irrigation controller was based on <a href="https://opensprinkler.com/">OpenSprinkler</a>. I still think Ray Wang built a great platform: affordable, open, <a href="https://opensprinkler.com/blog/">well documented</a>, and fun to work with. It got us watering, and I learned a lot from studying his design choices.</p><p> OpenSprinkler does the job for most people, and I am not knocking it. But I wanted more than valve control. I wanted to track temperature and humidity in the garden and greenhouse, monitor ground temperature, and start tying irrigation into the rest of the farm automation work. That is where the controller started evolving.</p><p>The next step was moving the brains onto a Raspberry Pi. I wanted the system self-hosted and local, not dependent on somebody else&#8217;s cloud server to water crops.  So I created <strong>pIoTServer</strong>: a <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part">Raspberry Pi-based farm automation system</a> that could expose sensors, valves, pumps, and other devices through a REST API. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Iv0s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Iv0s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 424w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 848w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 1272w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Iv0s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp" width="710" height="576" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:576,&quot;width&quot;:710,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75138,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Iv0s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 424w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 848w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 1272w, https://substackcdn.com/image/fetch/$s_!Iv0s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F82144998-d642-44b6-9b66-5b1bb2433d72_710x576.webp 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The first pIoTServer: Raspberry Pi, Waveshare 8-Ch Relay Board with AC relays</figcaption></figure></div><p>The <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-23c">first hardware version was still very much a prototype</a>: a Raspberry Pi, a <a href="https://www.waveshare.com/rpi-relay-board-b.htm">Waveshare 8-Ch Relay Expansion Board,</a> AC relays, and a fair amount of wiring. It was not pretty, but it let us control devices, read sensors, and start collecting environmental data.</p><p>One of the things I really liked about the Waveshare board was that it treated the Raspberry Pi as the daughter board, not the other way around. I adopted that approach for my later designs because it gives the main board room for power, protection, relays, field wiring, and whatever other interfaces the controller needs.</p><p>Once the initial Raspberry Pi version was working, power became the next issue. <a href="https://www.vinthewrench.com/p/kicking-zeuss-ass">Rural power does rural power things</a>, and I wanted the controller to survive outages and run from a backup battery. I also wanted better control of the irrigation valves than just feeding them straight DC.</p><p>That led to the first PWM prototype. It used <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-0d5">pulse-width modulation to open the valves and then hold them with less power</a>. It worked as a proof of concept, but it was limited to eight circuits, and I still needed a better answer for automatic shutdown.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SK2I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SK2I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SK2I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg" width="1200" height="552" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:552,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:250784,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SK2I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 424w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 848w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!SK2I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fed00b250-a0d3-4f8c-9cc3-6e126c0ae7d1_1200x552.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">First PWM prototype: better valve control, but still limited to eight circuits</figcaption></figure></div><p>The next version had to solve two other problems: managing power and protecting the controller from the realities of farm wiring.</p><p>That led to another <a href="https://github.com/vinthewrench/PioT">custom board</a>. This one had <a href="https://www.vinthewrench.com/p/chasing-raspberry-pi-power-management">power management built in</a>, including battery backup and controlled shutdown, instead of treating power as something bolted on later. I also moved more of the field-facing hardware onto my own pIoTServer board layout: isolated I2C, 1-Wire support, and isolated DC/DC power. The idea was to give the Raspberry Pi some separation from the long wires, valve coils, noisy equipment, and other nonsense hanging off the controller.</p><p>The valve drivers moved onto stackable 8-circuit PWM cards, so the controller was no longer locked into one fixed number of outputs. That design served us pretty well for about a year.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wh2m!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wh2m!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 424w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 848w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 1272w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wh2m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp" width="1456" height="797" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:797,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:139476,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wh2m!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 424w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 848w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 1272w, https://substackcdn.com/image/fetch/$s_!wh2m!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb585f409-6837-40c8-b164-b6ee6ecf3ef6_1456x797.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Custom pIoTServer board with integrated power management and a stackable 8-circuit PWM valve card.</figcaption></figure></div><p>But the garden kept expanding, and the valves kept getting farther from the controller. At some point, it became painfully obvious that this needed to be an RS-485 network. I am not sure how I missed that at the beginning of the project, but there it was.</p><p>The cleaner answer was a field bus: one RS-485 run, with small ValveNode boards sitting closer to the valves.</p><p>That led to <a href="https://www.vinthewrench.com/p/tangled-up-in-wires">ValveMaster</a>, a plug-in card for the pIoTServer controller with an AVR handling the RS-485 side and talking to the remote valve boards. The Raspberry Pi still runs pIoTServer and the farm logic, but valve control moves into a distributed network instead of everything home-running back to one box.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WnrC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WnrC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WnrC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg" width="1456" height="537" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:537,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:398545,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WnrC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WnrC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77013957-07ea-431a-bd0e-cf2b5c5822fd_1562x576.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">pIoTServer with new power management, RS-485 master and slave boards</figcaption></figure></div><p>The power-management work was its own rabbit hole. I started with discrete components controlling the power relay, but that only gets you so far. At some point the board needed a real brain for power control, so I moved that job to an ATmega8-16.</p><p>That let the board watch the power state, control the relay, shut the Raspberry Pi down cleanly, and remove power after shutdown. It could also wake the system back up when AC returned, when someone pressed the button, or on a timer so the controller could conserve battery power, wake periodically, and do whatever work was needed.</p><h3>What This Evolution Adds</h3><p>This evolution is built around the new <strong>ValveMaster</strong> prototype and the move toward RS-485 <strong>ValveNode</strong> boards, but the hardware is only part of it. A lot of the work went into pIoTServer itself: new device drivers, better reporting, notifications, tracking, rules, test tools, REST cleanup, and a redesigned farm-web dashboard.</p><h4>Hardware</h4><ul><li><p><strong>ValveMaster / RS-485 ValveNode control</strong><br>A new plug-in ValveMaster card lets the <strong>pIoTServer</strong> controller talk to remote ValveNode boards over RS-485, moving valve control closer to the valves instead of home-running every valve wire back to one box.</p></li><li><p><strong>Power management</strong><br>Controlled shutdown and wake behavior.</p></li><li><p><strong>DS2482 / 1-Wire</strong><br>Moved away from FUSE/OWFS toward native driver support.</p></li></ul><h4>Software</h4><ul><li><p><strong>New device drivers and runtime support</strong><br>Added the pIoTServer runtime/driver work for <strong>ValveMaster</strong> and power management.</p></li><li><p><strong>Incident reporting and notifications</strong></p><p>Added incident reporting, and <strong>Pushover</strong> support so the system can report problems and send phone alerts when something needs attention.</p></li><li><p><strong>Rules and ad-hoc sequences</strong><br>Added rules and temporary sequences. This lets the system run one-off irrigation jobs, manual tests, and simple conditional logic without having to create a permanent schedule every time.</p></li><li><p><strong>Tracking, duration, and summary API</strong><br>Added tracking so the system can record what actually happened, not just what the current state says. This includes how long things ran, when they ran, and summary data the dashboard can use without pulling the whole history every time.</p></li><li><p><strong>piottool</strong><br>Consolidated the hardware debugging and module testing tools into one utility.</p></li></ul><ul><li><p><strong>Raspberry Pi Wi-Fi hardening</strong><br>As shipped, Raspberry Pis have been known to drop off Wi-Fi and do not always handle network recovery well on their own. We tightened up the Wi-Fi setup and added recovery behavior so the controller has a better chance of coming back without manual intervention.</p></li></ul><ul><li><p><strong>REST cleanup for better web UI support</strong><br>Cleaned up bugs and refactored parts of the REST API so the new farm-web interface could get cleaner, more consistent data.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ckaY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ckaY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 424w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 848w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 1272w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ckaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png" width="650" height="473" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:473,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169071,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ckaY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 424w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 848w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 1272w, https://substackcdn.com/image/fetch/$s_!ckaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F00a1e492-e10c-4edd-9cfe-6b3ff79942c8_650x473.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Schedule view for sprinkler automation.</figcaption></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iAp2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iAp2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 424w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 848w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 1272w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iAp2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png" width="650" height="321" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:321,&quot;width&quot;:650,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:145761,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/206193298?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iAp2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 424w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 848w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 1272w, https://substackcdn.com/image/fetch/$s_!iAp2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F087acbf2-720f-4fdc-a540-e4f95cfb2727_650x321.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Manual sprinkler control</figcaption></figure></div><h3>More good stuff to come</h3><p>I am in the process of deploying this version out to the farm now. As usual, every improvement seems to create three more things worth writing about, so I am going to break some of the details into separate articles instead of turning this update into a book.</p><p><strong>Web dashboard / UI system</strong><br>How the farm-web dashboard was redesigned around actual field use, and how the <strong>pIoTServer</strong> web interface is structured going forward.</p><p><strong>Pushover notifications</strong><br>I needed a way to find out when something broke without staring at logs or keeping the dashboard open all day. Pushover is a simple cross-platform push-notification service, and pIoTServer can use it to send alerts to my phone when something needs attention.</p><p><strong>Cloudflare Access</strong><br>I also needed remote access to the farm dashboard without exposing the farm controller directly to the public internet. Cloudflare gives me a controlled front door, so I can reach the web interface remotely while keeping the raw controller on the private side.</p><p><strong>DS2482 / DS18B20 driver without OWFS</strong><br>As part of the I2C debugging, I needed more direct control over the 1-Wire side of the system. That meant moving DS2482 / DS18B20 temperature sensing away from OWFS/FUSE and into native pIoTServer driver support.</p><p>There is always more work to do, and this thing is not done yet. But we are getting there. &#8220;Stuff&#8217;s getting better every day.&#8221; And man, what a long, strange trip it&#8217;s been.</p><div><hr></div><p><span>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like </span><a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a><span>. It is not always electronics. Believe it or not, I have been known to jump from </span><a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a><span> to </span><a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a><span> to </span><a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a><span> without much warning.</span></p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Tangled Up in Wires]]></title><description><![CDATA[How I built a RS-485 network to control my Farm Irrigation]]></description><link>https://www.vinthewrench.com/p/tangled-up-in-wires</link><guid isPermaLink="false">https://www.vinthewrench.com/p/tangled-up-in-wires</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Mon, 11 May 2026 23:28:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FOgw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Like most of my projects, this started as a simple problem looking for a practical solution. The farm needed a way to move the right amount of water, at the right time, to the right place, and keep doing it even when the power went out.</p><p>Easy peasy.</p><p>That was the theory, anyway. Then we became victims of our own success. The garden started growing faster than the wiring plan.</p><p>The irrigation system has gone through several stages since then, each one solving the problem directly in front of it. I wanted more than an off-the-shelf sprinkler controller.</p><ul><li><p>First came the Raspberry Pi control system, which gave me flexible scheduling, local control, and environmental data collection.</p></li><li><p>Then came the first valve-control hardware: relays switching 24 VAC to ordinary sprinkler valves.</p></li><li><p>After that came the question of how to drive those same valves from battery-backed DC power. That led to the boost-and-hold experiments.</p></li><li><p>Later, I explored PWM valve control, using full power to open the valve and reduced average power to hold it open.</p></li></ul><p>Each step worked. Each step also exposed the next problem. </p><p>The next problem was geography.</p><p>As the garden expanded, so did the number of zones. I could stack more PWM boards, but that only solved the controller side of the problem. Every new zone still meant more wire, possibly another trench, and another dedicated run back to the controller.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FOgw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FOgw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FOgw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg" width="700" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:225052,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FOgw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FOgw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9088e1c5-5be7-4bd8-857b-d11d8ab23dcd_700x458.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The garden grew faster than the wiring plan.</figcaption></figure></div><p>Looking at the garden from above made the problem hard to ignore. The beds were spreading out, the rows were changing, and new irrigation needs kept appearing in places that were never part of the original wiring plan. The question was no longer whether I could drive another valve. I could. The question was whether I really wanted every new valve to require another cable back to the controller.</p><h4>Maybe It&#8217;s a Network?</h4><p>At some point, as the valves started spreading out and the wiring kept multiplying, it became painfully obvious that this needed to be an RS-485 network. I am not sure how I missed that at the beginning of the project, but there it was.</p><p>I have spent enough time around control systems and communications links to recognize the pattern. What brought RS-485 back to mind was yet another cool project I had been working on. Once I looked back at the irrigation system, it was a natural fit.</p><p>RS-485 is an old industrial workhorse that has been around since the early 1980s. It survived because it solves a problem that never really went away: how to talk to equipment spread out over distance, in the harsh electrical environment of the real world.</p><p>A logic signal that works perfectly on a circuit board can fall apart once it has to travel down a long cable. Long cables pick up noise. Motors and relays throw garbage onto the wiring. Pumps start and stop. Ground voltage shifts from one end of the run to the other. Add conduit, wet soil, distance, and lightning weather, and suddenly a clean bench signal is not so clean anymore.</p><p>RS-485 was built for this. It sends data over a balanced pair of wires instead of relying on one fragile signal referenced to ground. The signal on one wire moves one way while the other moves the opposite way, and the receiver looks at the difference between them. Common-mode noise picked up along the cable tends to appear on both wires together. Because the receiver is looking at the difference between the two wires, it can reject much of that shared noise.  That makes RS-485 much better suited for devices spread out across the farm, down long cable runs, and around pumps or other noisy equipment.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lYgh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lYgh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 424w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 848w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 1272w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lYgh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png" width="600" height="379" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:379,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:257377,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lYgh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 424w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 848w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 1272w, https://substackcdn.com/image/fetch/$s_!lYgh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd45d545d-6df1-41f1-94c6-bc1f4fd5032c_600x379.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>For a deeper technical overview, Texas Instruments has two useful references: <a href="https://www.ti.com/lit/wp/slla545/slla545.pdf">RS-485 Basics</a> and the <a href="https://www.ti.com/lit/an/slla272d/slla272d.pdf">RS-485 Design Guide</a>. I also found the <a href="https://www.murcal.com/blog/rs-485-the-MurCal-way">MurCal document on proper use of RS-485 Ports</a> to be a gem.</p></blockquote><p>Keep in mind that RS-485 is not a protocol. It is the wiring and signaling layer. That lets me build a simple command protocol on top of it: address a valve node, tell it what to do, and get a reply.  More on that later.</p><h4>Latching Solenoids</h4><p>In-line automatic sprinkler valves, such as the Hunter PGV or Rain Bird CPF100, control the water used for our crop irrigation. These devices are easy to take for granted, but they are clever little pieces of engineering. I encourage you to take a few minutes and watch the video below to see how they work.</p><div id="youtube2-5rokXHhxRSw" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;5rokXHhxRSw&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/5rokXHhxRSw?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>At the heart of the valve is a diaphragm and a small pilot passage controlled by a solenoid. The solenoid does not directly move all the water. It simply opens or closes a tiny control path, and the water pressure does the heavy lifting. That is the elegant part. A small electrical signal controls a much larger flow of water.</p><p>The downside is that a standard sprinkler solenoid has to stay energized the entire time the valve is open. My PWM approach makes that more efficient, but it does not change the basic problem. The controller is still feeding power to every open valve.</p><p>There is a better way: stop holding the valve open with power.</p><p>That is what latching solenoids do. They were designed for battery-powered irrigation controllers. Instead of needing continuous power, they only need a short pulse to change state. Send current one direction and the valve opens. Send it the opposite direction and the valve closes. After that, the driver turns off and the valve stays where it was.</p><p>What put me off at first was my assumption that latching solenoids would be expensive, obscure, or hard to source. I thought this was some esoteric European thing.</p><p>As <a href="https://en.wikiquote.org/wiki/Ron_White">Ron White</a> would say, &#8220;I was wrong.&#8221;</p><p>The <a href="https://www.hunterirrigation.com/irrigation-product/solenoids/458200">Hunter 458200</a> DC latching solenoid was only a few dollars more than a standard replacement solenoid. Rain Bird offers a similar latching solenoid, the <a href="https://store.rainbird.com/tbospsol-tbos-potted-latching-solenoid.html">K80920</a>, though it costs a bit more.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!U3wG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!U3wG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 424w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 848w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!U3wG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg" width="500" height="408" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:408,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:112956,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!U3wG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 424w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 848w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!U3wG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b2474b7-ae01-4983-b05b-af501393cae7_500x408.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The Hunter 458200 and Rain Bird K80920 solenoids</figcaption></figure></div><p>As you can see in the photo, Hunter and Rain Bird solenoids use different thread designs, so they are not mechanically interchangeable. Electrically, however, they work the same basic way. They still use two wires and are controlled by the direction of current flow.</p><p>The good news is that within a given brand, standard and latching solenoids are generally interchangeable on compatible valve bodies. That meant I did not have to abandon ordinary irrigation valves. I could keep the same basic valve bodies and simply change the solenoid.</p><p>Even though the latching solenoids are technically not motors, but the control problem is similar to the <a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">lock actuator I used in the chicken coop project</a>. Current one way moves the plunger one direction. Current the other way moves it back. </p><p>And it turns out that the  <a href="https://www.st.com/resource/en/datasheet/vnh7100bas.pdf">VNH7100BAS</a> H-bridge, like the one I used in my <em><a href="https://www.vinthewrench.com/p/the-humble-actuator">Humble Actuator</a></em> project, is a natural fit for controlling the polarity.  It might even be a bit of overkill, but when these valves get wet, dirty, old, or sticky they are a bargain at around $2.50 a piece.</p><h4>The 30,000-Foot View</h4><p>The architecture is simple: one master, many valve nodes.</p><p>I designed two boards for this system: a master board and a valve node board. The master sits near the Raspberry Pi and manages the RS-485 field bus. The valve nodes live out closer to the valves and drive the latching solenoids.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cOVP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cOVP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 424w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 848w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 1272w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cOVP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png" width="600" height="337" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:337,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75256,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cOVP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 424w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 848w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 1272w, https://substackcdn.com/image/fetch/$s_!cOVP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F58ab1b0f-a514-4cba-ac3a-9396b1605094_600x337.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The Raspberry Pi still runs the irrigation logic. It decides what should happen and when. The master board translates those decisions into RS-485 commands. Each valve node listens for commands addressed to it, pulses the right solenoid in the right direction, and reports back.</p><p>Instead of running every valve back to the controller, I can run a shared four-wire cable through the field and hang valve nodes off that cable. Two wires carry 12 VDC power. The other two carry the RS-485 data pair.</p><p>The protocol is intentionally simple. At the electrical level, it is a 9600 baud serial line running over RS-485. The master sends a command to a specific valve node, and the node either acts on it or reports back: open a valve, close a valve, identify yourself, or report how many valves it can control.</p><p>If you want the deep details, I have made the schematics, board layouts, KiCad files, firmware, protocol notes, and test tools available in the <a href="https://github.com/vinthewrench/valvenode">ValveNode GitHub repository</a>.</p><h4>Valve Master Board</h4><p>The first board is the Valve Master. This board stays near the Raspberry Pi and acts as the bridge between the main farm-control software and the irrigation field bus.</p><p>On one side, it talks to the Raspberry Pi over I2C. On the other side, it controls the RS-485 cable that runs out into the field. It also switches the 12 V field power, so the valve-node network does not have to sit powered all the time.</p><p>The master board does not directly open and close every valve. That is the point. Its job is to manage the bus, send commands to the valve nodes, receive replies, keep track of which nodes are out there, and report results back to the host.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!af3q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!af3q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 424w, https://substackcdn.com/image/fetch/$s_!af3q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 848w, https://substackcdn.com/image/fetch/$s_!af3q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 1272w, https://substackcdn.com/image/fetch/$s_!af3q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!af3q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png" width="600" height="404" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:404,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:292761,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!af3q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 424w, https://substackcdn.com/image/fetch/$s_!af3q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 848w, https://substackcdn.com/image/fetch/$s_!af3q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 1272w, https://substackcdn.com/image/fetch/$s_!af3q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f0cbf6-21f7-4d4a-a86a-cdc918a76c2d_600x404.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I designed the I2C side so the board can be built two ways: as a <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-a03">NodeLync-compatible</a> device hanging off the shared I2C bus, or as a daughter card that plugs directly into my <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-029">Raspberry Pi irrigation controller</a>. The hardware is built around an ATmega88PB-AU microcontroller, a MAX485-style RS-485 transceiver, a relay-switched 12 V field output, status indicators, and an AVR programming header. </p><p>Nothing exotic. Just the pieces needed to turn a Raspberry Pi command into a field-bus command that can survive outside the controller box.</p><p>The Raspberry Pi decides what should happen, sends the command over I2C to the Valve Master, and the Valve Master handles communication with the nodes in the field. </p><h4>Valve Node Board</h4><p>The valve node board lives out near the valves. It has the RS-485 interface, a small microcontroller, input protection and power conditioning for the incoming 12 V field supply, and the H-bridge drivers needed to pulse the local latching solenoids. Each node has an address, so the master can tell one specific board to open or close one specific valve.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KdgB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KdgB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KdgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg" width="600" height="399" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30bc85df-22da-405b-870b-51177232b660_600x399.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:399,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:133787,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KdgB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 424w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 848w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!KdgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30bc85df-22da-405b-870b-51177232b660_600x399.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Since this board literally lives out in the field, I designed it to fit comfortably inside a common 2FSE FS outdoor electrical box, protecting the electronics from the usual outdoor abuse while leaving enough room for wiring, strain relief, and service access.</p><p>Even with the microcontroller, RS-485 transceiver, H-bridge drivers, input protection, voltage regulation, terminal blocks, and the PCB itself, this is still a modest-cost board. In small quantities, I am roughly in the $30 to $45 range per valve node, not counting assembly, shipping, or tariffs.</p><blockquote><p><strong>You do not have to use the Valve Master board to use the valve nodes</strong>. The nodes speak ordinary 9600 baud serial over RS-485, so <strong>any controller that can send the right frames over an RS-485 interface can talk to them</strong>. A USB-to-RS-485 adapter, such as the <a href="https://www.waveshare.com/usb-to-rs232-485.htm">Waveshare USB to RS232/485 Serial Converter</a>, is enough for direct testing. In fact, that is how I did my initial debugging.</p></blockquote><h4>The ValveNode Protocol</h4><p>This project does not need a complicated protocol. It only needs enough structure for the master to send a command over a 9600 baud RS-485 serial line to a valve node, get an acknowledgment back, and handle a small set of operations: open a valve, close a valve, report status, identify itself, or report how many valves it can control.</p><p>I implemented the protocol as a simple ASCII frame format. It is easy to type, easy to log, and easy to debug from a terminal. That way I could connect a USB-to-RS-485 adapter, type commands by hand, and see exactly what came back.</p><p>The bus is master-controlled. Nodes do not chatter whenever they feel like it. The master sends a request, and only the addressed node replies. </p><p>The frames are short ASCII messages. Each command starts with a marker, includes the target node address, a command code, any needed argument, and ends with a carriage return. Replies use the same basic idea, with an acknowledgment, status, or error result coming back from the addressed node.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eWNn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eWNn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 424w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 848w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 1272w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eWNn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png" width="700" height="467" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:467,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:484952,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eWNn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 424w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 848w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 1272w, https://substackcdn.com/image/fetch/$s_!eWNn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15f37958-b4db-49bb-97fb-6da48500c09f_700x467.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For example, to tell node 5 to open valve 1, the master sends:</p><p><code>:05O1&lt;CR&gt;</code></p><p>That means: address node 05, send the open command, and pass valve 1 as the argument. If the node accepts the command, it replies with `A` for acknowledged:</p><p><code>:05A&lt;CR&gt;</code></p><p>A slightly more complicated example is the <code>WHO</code> command, which asks the bus which nodes are connected. The master broadcasts a <code>W</code> command to all nodes by sending it to the <code>FF</code> address:</p><p><code>:FFW&lt;CR&gt;</code></p><p>The tricky part is the reply. If every node answered at the same time, they would talk over each other and the bus would turn into garbage. To avoid that, each node waits for a short delay based on its address before replying.</p><p>For example, if nodes 1, 4, and 18 are on the bus, the master might see replies like this:</p><p><code>:01W&lt;CR&gt;<br>:04W&lt;CR&gt;<br>:12W&lt;CR&gt;</code></p><p>Each node waits in a 20 ms slot based on its address before replying. Node 1 waits about 20 ms, node 4 waits about 80 ms, and node 18 waits about 360 ms.</p><p>The master just has to keep listening long enough for the highest expected node address to answer. For example, if I allow up to 32 nodes, the discovery window needs to be a little over 640 ms, plus some margin.</p><blockquote><p>Note: Addresses are written as two-digit hex values, so node 18 shows up as <code>12</code> in the reply.</p></blockquote><p>The messages include a checksum so the devices can detect corrupted messages. The checksum is simple: add up the bytes in the message payload, keep the low 8 bits, and send that value as two hex digits at the end of the frame.</p><p>I left the checksum out of the examples above to keep them readable. The valve node firmware will also accept simple commands without one, which makes hand testing from a terminal much easier.</p><p>It is not cryptography, just a quick sanity check to keep noise on the line from causing havoc.</p><h4>Building and Programming the Boards</h4><p>Once the boards are assembled, they still need to be programmed. Both the master and node boards use AVR microcontrollers, and each board runs its own firmware. The code that runs on the boards is written in C and built with the AVR toolchain, and loaded using <strong>avrdude</strong>.   </p><p>Both boards include provisions for a 6-pin AVR ISP connector that mates with an Atmel-ICE programmer.  </p><blockquote><p>In previous articles, I wrote in more detail about building AVR code and downloading it to the chip, including &#8220;<a href="https://www.vinthewrench.com/p/avrdude-the-debugging-tool-you-didnt">avrdude: The Debugging Tool You Didn&#8217;t Know You Had</a>&#8221; and &#8220;<a href="https://www.vinthewrench.com/p/how-did-you-make-that">How Did You Make That</a>.&#8221;</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OBgZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OBgZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OBgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg" width="500" height="489" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:489,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156380,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/196471779?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OBgZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OBgZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5f476493-bbf4-4ec5-bed9-f83a8c1c0519_500x489.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Valve Node boards assembled and ready for testing</figcaption></figure></div><p>A newly programmed valve node starts out unconfigured. Before it can join the RS-485 bus, it needs a unique address.</p><p>After flashing the firmware, I connect each new node to the RS-485 bus by itself, put it into configuration mode, and assign it an address.</p><p>For example, to configure a fresh node as node 7, I send:</p><p><code>:07N&lt;CR&gt;</code></p><p>That tells the unconfigured node to store address <code>07</code> in EEPROM. After that, it responds as node 7 on the bus.</p><p>Then I can test it with a ping:</p><p><code>:07P&lt;CR&gt;</code></p><p>If everything worked, the node replies:</p><p><code>:07A&lt;CR&gt;</code></p><p>The address can also be changed later by putting that node back into configuration mode and sending it a new address command.</p><h4>Test Tools and Diagnostics</h4><p>Before these boards go into outdoor boxes, it is useful to have good ways to test and diagnose them on the bench. I can manually send commands through a terminal emulator over a USB-to-RS-485 adapter, but I wanted something a bit more intuitive to use. So, like any good programmer, I wrote some test utilities.</p><p>The first one is <strong>vnode</strong>, a command-line tool for talking directly to valve nodes over a serial port. It assumes a USB-to-RS-485 adapter is connected to the bus. From there, <strong>vnode</strong> can ping a node, open or close a valve, check status, ask for the firmware version, identify a node, run discovery, assign addresses, move a node to a new address, cancel configuration mode, or send a raw frame by hand.</p><p> For example:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;8d79ac1f-b835-492a-b2f6-9866dc443546&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">$ ./vnode -d /dev/ttyUSB0 who
device: /dev/ttyUSB0
baud:   9600
tx: :FFW\r
rx: :01WB8  [checksum ok] node=1 WHO
rx: :02WB9  [checksum ok] node=2 WHO

$ ./vnode -d /dev/ttyUSB0 ping 1
device: /dev/ttyUSB0
baud:   9600
tx: :01P\r
rx: :01AA2  [checksum ok] node=1 ACK

$ ./vnode -d /dev/ttyUSB0 open 1 1
device: /dev/ttyUSB0
baud:   9600
tx: :01O1\r
rx: :01AA2  [checksum ok] node=1 ACK</code></pre></div><p>That gives me a quick way to discover nodes, verify that a node is answering, and command a valve output without involving the Valve Master or the Raspberry Pi irrigation software.  It can also be used to configure a fresh node, assign its address, and verify that it answers before it goes into the field. </p><p>The other utility is <strong>valve</strong>, which talks to the Valve Master over I2C, the same way the Raspberry Pi irrigation software would. That lets me test the full chain: Raspberry Pi side, I2C, Valve Master, RS-485, valve node, and finally the latching solenoid output.</p><p>The valve tool can:</p><ul><li><p>Check master status</p></li><li><p>Switch field power on or off</p></li><li><p>Discover nodes</p></li><li><p>Ping a node</p></li><li><p>Open or close a channel</p></li><li><p> Check channel status</p></li><li><p>Read master or node firmware versions</p></li><li><p>Identify a node</p></li><li><p>Handle address provisioning</p></li></ul><p>The GitHub repository also includes test scripts, including <strong>hammer.sh</strong>, which repeatedly exercises the full Valve Master path. In bench testing, it completed 500 loops across five nodes, 10,016 commands total, with zero first-try failures.</p><h4>About Those Tangled Wires</h4><p>There is nothing wrong with reusing the 18 AWG sprinkler wire I already had in place. It was already buried, already routed to the right places, and for short runs it was perfectly serviceable. </p><p>But anywhere I was pulling new cable, I wanted something better suited to this design. The RS-485 data side is not the hard part at 9600 baud. The real issue is getting enough 12 V power out to the valve nodes over a few hundred feet of wire. </p><p>For new runs, I settled on 16 AWG, 4-conductor, stranded copper, direct-burial cable I came across <a href="https://www.amazon.com/dp/B07J58MXQC">online</a>.</p><p>Two conductors carry +12 V and ground, and the other two carry the RS-485 A/B pair. Twisted pair would be nice, but copper, gauge, and burial rating matter more here than perfect data-cable theology.</p><h4>Good Systems Evolve</h4><p>This is not a completely different irrigation system. It is the next step in the same one.</p><p>The project started with a simple question: how do I drive ordinary sprinkler valves from a Raspberry Pi and keep them working when the power goes out? The answer kept evolving as the garden grew: relays, DC boost-and-hold, PWM, and now latching solenoids on an RS-485 field bus.</p><p>That reminded me of Donald Knuth&#8217;s old warning that &#8220;<a href="https://pic.plover.com/knuth-GOTO.pdf">premature optimization is the root of all evil.</a>&#8221; I had spent a lot of effort making ordinary sprinkler solenoids more efficient. The better move was to stop holding the valve open with power in the first place.</p><p>That is how good systems evolve. You solve the problem in front of you. If the system is useful, it grows. If it grows, it eventually shows you where the old design runs out of room.</p><h4>Post Scriptum</h4><p>After letting the invisible magic smoke out of two Rain Bird latching solenoids, I started wondering whether I had configured the valve node drivers wrong.</p><p>Rain Bird does not exactly give you engineering data for these parts, but I had seen them described as 9 V latching solenoids.  Why should they, you should be using it with their hardware.</p><p>My first reaction was, &#8220;yeah, yeah, so what?&#8221; I was only hitting them with short pulses.</p><p>Then two of them stopped closing reliably after a day of cycling.</p><p>OK. Time for engineering.</p><p>The field bus is 12 V, but that does not mean the solenoid needs to eat the full 12 V pulse. The Rain Bird solenoid I measured was about 7.2 ohms. I added a 2.2 ohm resistor in series with the solenoid drive path, giving a total resistance of about 9.4 ohms.</p><p>Using Ohm&#8217;s law:</p><p>I = V / R <br>I = 12 V / 9.4 ohms <br>I &#8776; 1.28 A</p><p>The solenoid itself then sees roughly:</p><p>V = I &#215; R<br>V = 1.28 A &#215; 7.2 ohms<br>V &#8776; 9.2 V</p><p>That lets the field bus stay at 12 V while bringing the solenoid pulse down into the neighborhood of a 9 V latching-solenoid pulse. I also shortened the firmware pulse to 20 ms.  The resistor is not being used as a continuous power device. It is only there to take the edge off a short actuation pulse. So far, 2.2 ohms 1 Watt resistor in series with the solenoid works fine.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. It is not always electronics. Believe it or not, I have been known to jump from <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a> to <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a> to <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a> without much warning.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Vinnie’s Farm Automation Projects]]></title><description><![CDATA[A guide to the systems and projects I&#8217;ve built on the farm]]></description><link>https://www.vinthewrench.com/p/vinnies-farm-automation-projects</link><guid isPermaLink="false">https://www.vinthewrench.com/p/vinnies-farm-automation-projects</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Fri, 27 Mar 2026 21:14:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aBvA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aBvA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aBvA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aBvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg" width="700" height="381" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:381,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:158057,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/192352081?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aBvA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aBvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4c46e7f4-5553-4810-83a3-6a81c5ad863d_700x381.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This page brings together the full cornucopia of farm automation projects I have built and shared from our farmstead. Irrigation systems, environmental sensing, weather stations, power management, chicken coop automation, and everything in between. </p><p>If you are thinking of building this stuff yourself and want to avoid the usual LLM hallucinations, dig through these articles. You will find details on the hardware and software I have actually built, along with the good, the bad, and the ugly behind the design decisions that got me there.</p><h4>Setting up the Farm</h4><ul><li><p><a href="https://www.vinthewrench.com/p/this-is-my-dirt">This is My Dirt</a><br><em>20-May-24</em> &#8212; The Farmsteading Adventure Begins.</p></li><li><p><a href="https://www.vinthewrench.com/p/be-water-my-friend">Be Water, My Friend</a><br><em>01-May-24</em> &#8212; Our first irrigation project at Stella Porta.</p></li></ul><h4>Raspberry Pi Farm Irrigation System </h4><ol><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part">Farm automation made easy as Pi</a><br><em>01-May-25</em> &#8212; Setting up the foundation for real-world IoT on the farm.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-23c">Controlling the Irrigation Valves</a><br><em>01-May-25</em> &#8212; The basics of switching solenoids, safely and reliably.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-a4c">Reading from the 1-Wire Sensors</a><br><em>06-May-25</em> &#8212; Building the temperature sensing layer.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-688">Using the I2C Protocol to Communicate to Sensors</a><br><em>07-May-25</em> &#8212; How we wired it, read it, and filtered out the crap.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-a03">Reading Environmental Data with I2C</a><br><em>09-May-25</em> &#8212; Expanding the sensor net and interpreting the data.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-cfd">Raindrops Keep Falling On My Head</a><br><em>26-May-25</em> &#8212; Detecting precipitation (and making decisions from it).</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-61b">More I/O</a><br><em>30-May-25</em> &#8212; Handling expansion and GPIO overload.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-8e7">Getting the Data and Controlling the Devices from the REST API</a><br><em>01-Jun-25</em> &#8212; Talking to your Pi from across the network.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-9ef">Writing Your Own Device Plug-ins</a><br><em>03-Jun-25</em> &#8212; Custom code to extend your system&#8217;s reach.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-094">Using Software Devices to Build on the Hardware</a><br><em>06-Jun-25</em> &#8212; Simulated devices and logic layers.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-12f">How to Make Things Happen Automatically</a><br><em>07-Jun-25</em> &#8212; Trigger-based actions and logic chains.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-eb8">Time Has Come Today</a><br><em>12-Jun-25</em> &#8212; Scheduled tasks and automation routines.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-3aa">There Are Always Conditions to Evaluate</a><br><em>13-Jun-25</em> &#8212; Conditional logic for smarter systems.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-2a8">Rolling My Own I&#178;C and 1-Wire Interface Card</a><br><em>21-Jun-25</em> &#8212; A custom hardware solution for real-world reliability.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-a8b">Recording and Accessing Environmental Data Remotely</a><br><em>01-Jul-25</em> &#8212; Logging and remote access to your system&#8217;s mind.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-2c2">Preventing Injection Attacks to the Database</a><br><em>07-Jul-25</em> &#8212; Keeping bad guys out of your Pi.</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-0d5">PWM: A Better Way to Control Sprinkler Valves</a><br><em>21-Jul-25</em> &#8212; Fine-tuned voltage control for water flow.</p></li><li><p><a href="https://www.vinthewrench.com/p/not-another-sprinkler-valve-article">Not Another Sprinkler Valve Article; TLDR</a></p><p>2-Sep-25 &#8212; The elevator pitch</p></li><li><p><a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-029">Smart Power Switch and Shutdown for Raspberry Pi</a><br>05-Oct-25 - Battery Backup and controlled shutdown.</p></li><li><p><a href="https://www.vinthewrench.com/p/why-the-raspberry-pi-gpio-api-is">Why the Raspberry Pi GPIO API is broken and how to fix it</a><br>11-Nov-25 - How a quiet change in Linux and libgpiod boned developers</p></li><li><p><a href="https://www.vinthewrench.com/p/chasing-raspberry-pi-power-management">Chasing Raspberry Pi Power Management</a><br><em>26-Jan-26</em> &#8212; Lessons Learned Building a Power Switch with Deep Sleep and Wake Control</p></li><li><p><a href="https://www.vinthewrench.com/p/tangled-up-in-wires">Tangled Up in Wires</a><br>11-May-26   &#8212; The Latest Evolution of My Farm Irrigation System</p></li><li><p><a href="https://www.vinthewrench.com/p/garden-irrigation-evolution">Garden Irrigation Evolution</a><br>09-Jul-26   &#8212; Stuff&#8217;s getting better. Stuff&#8217;s getting better every day.</p></li><li><p><a href="https://www.vinthewrench.com/p/reading-ds18b20-temperature-sensors">Reading DS18B20 Temperature Sensors on the Pi Without OWFS</a><br>11-Jul-26   &#8212; Talking to the DS2482-100 I&#178;C-to-1-Wire bridge directly</p></li><li><p><a href="https://www.vinthewrench.com/p/im-a-pushover-for-self-hosting">I&#8217;m a Pushover for Self Hosting</a><strong><br></strong>12-Jul-26   &#8212; Adding remote notifications without Apple&#8217;s infrastructure.</p></li><li><p><a href="https://www.vinthewrench.com/p/a-dashboard-for-my-garden-irrigation">A Dashboard for My Garden Irrigation</a><strong><br></strong>17-Jul-26   &#8212; A Web-Based Operations Console for the Garden Irrigation System</p></li><li><p><a href="https://www.vinthewrench.com/p/adding-mqtt-to-piotserver">Adding MQTT to pIoTServer</a><strong><br></strong>29-Jul-26   &#8212; Connecting Zigbee devices to my self-hosted internet of things ecosystem.</p></li><li><p><a href="https://www.vinthewrench.com/p/self-hosting-without-the-exposure">Self-Hosting Without the Exposure</a><strong><br></strong>01-Aug-26   &#8212; How to access your self-hosted applications with Cloudflare while keeping your home network private.</p></li></ol><h4>General stuff</h4><ul><li><p><a href="https://www.vinthewrench.com/p/how-did-you-make-that">How did you make that?</a></p><p><em>23-Jan-26 </em>&#8212; What actually happens between an idea and a working circuit board</p></li></ul><ul><li><p><a href="https://www.youtube.com/watch?v=gbhPg_5XXlw">Interview with Raspberry Pint</a><br>30-Sep-25 - Building resilient systems that don&#8217;t need the cloud</p></li><li><p><a href="https://vinthewrench.substack.com/p/using-a-raspberry-pi-to-remotely">Using a Raspberry Pi to measure the cistern level</a></p><p>14-Nov-21  &#8212; A better way to calculate water level</p></li></ul><h4>Weather Station</h4><ul><li><p><a href="https://www.vinthewrench.com/p/building-a-dedicated-weather-station">Building a Dedicated Weather Station Display</a></p><p><em>18-Dec-25</em> &#8212; Built a rock-solid, minimalist Raspberry Pi kiosk weather display</p></li><li><p><a href="https://www.vinthewrench.com/p/build-your-own-off-grid-weather-station">Build Your Own Off-Grid Weather Station</a></p><p><em>11-Dec-25</em> &#8212; A Raspberry Pi and SDR system for collecting local weather data without relying on anyone&#8217;s cloud.</p></li></ul><ul><li><p><a href="https://www.vinthewrench.com/p/here-comes-the-sun">Here comes the Sun</a><br><em>06-Mar-26</em> &#8212; How My Chicken Coop Controller Calculates Sunrise and Sunset</p></li></ul><h4>Chicken Coop Automation</h4><ul><li><p><a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">A Better Automatic Chicken Coop Door</a><br><em>05-Mar-26</em> &#8212; From Backyard Chickens to 100-Bird Pasture Rotation</p></li><li><p><a href="https://www.vinthewrench.com/p/chicken-coop-door-installed-and-running">Chicken Coop Door, Installed and Running</a></p><p><em>26-Mar-26</em> &#8212; Video, installation photos, and command-line setup from the finished coop door controller</p></li><li><p><a href="https://www.vinthewrench.com/p/the-humble-actuator">The Humble Actuator</a></p><p><em>11-Oct-25</em> &#8212; I2C-Based Linear Actuator Driver with Current Monitor</p></li></ul><ul><li><p><a href="https://vinthewrench.substack.com/p/chicken-coop-automation-revisited">Chicken Coop with Raspberry Pi</a></p><p><em>27-Jan-22</em> &#8212; Version 2 of the coop controller</p></li></ul><ul><li><p><a href="https://vinthewrench.substack.com/p/chicken-coop-automation-using-the-arduino-platform-4c572d9a940a">Chicken Coop with Arduino platform</a></p><p><em>17-Dec-20</em> &#8212; My first coop controller</p><p></p></li></ul><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. It is not always electronics. Believe it or not, I have been known to jump from <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a> to <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a> to <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a> without much warning.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Chicken Coop Door, Installed and Running.]]></title><description><![CDATA[Video, installation photos, and command-line setup from the finished coop door controller]]></description><link>https://www.vinthewrench.com/p/chicken-coop-door-installed-and-running</link><guid isPermaLink="false">https://www.vinthewrench.com/p/chicken-coop-door-installed-and-running</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Thu, 26 Mar 2026 23:22:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QxpR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In &#8220;<a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">A Better Automatic Chicken Coop Door</a>,&#8221; I explained why I scrapped two earlier controllers, walked through the design process, and showed how the new one works. Now it&#8217;s out of the shop, bolted to the coop, and doing real work.</p><p>I have since finished the prototyping in the shop and installed the controller in the mobile coop. What follows are a few photos of the finished installation, a short video of the door in operation, and some command-line setup and log output from the actual system.</p><h3>Installing the Assembly</h3><p>I built the whole assembly on a sheet of <a href="https://www.huberwood.com/advantech/subflooring">23/32-inch AdvanTech</a> so the aluminum guide rails would stay aligned. Once it was dialed in, mounting it to the coop wall was just a matter of driving a bunch of screws, and cutting a hole for the door.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QxpR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QxpR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QxpR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg" width="400" height="549" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:549,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:115226,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/192254870?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QxpR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QxpR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F12548444-60b0-4e6a-8e14-bfd9f1770e3f_400x549.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Door controller and mechanism installed.</figcaption></figure></div><p>One other small detail: I used a short piece of chain between the actuator and the door, basically like a toilet flapper chain. That gives the linkage a little slack, which helps keep the door from driving hard against anything underneath it, including an unlucky chicken.</p><p>I also built a separate battery box for the power system. It houses the 12-volt battery, a solar charge controller, fuse protection, and the rest of the power wiring in one place. I mounted it outside the coop to make it easier to service and to avoid kneeling around in chicken droppings every time I needed to check or adjust something.</p><p>For the charge controller, I used a Renogy Voyager. It is a small PWM unit with a simple display and basic charge management. It is a bit of overkill for this job.  It is reliable, straightforward to wire, and stupid easy to set up.</p><p>The smaller Wanderer would probably have been a better fit, but I happened to have a few Voyagers sitting around the shop, so one of them went into the battery box.  </p><p>For the panel, I used an <a href="https://www.acopower.com/products/acopower-mono-solar-panel-5w-10w-20w-30w-50w?variant=46405865963772">ACOPOWER 30-watt monocrystalline solar panel</a>. The load is low enough that 30 watts is more than plenty for this system.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tGVd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tGVd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tGVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg" width="500" height="393" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:393,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87315,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/192254870?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tGVd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tGVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a836bc5-b466-4fd8-bb37-0a4344bca3b3_500x393.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Charge controller box and door button</figcaption></figure></div><p>I also mounted the coop door button and LED combo outside in a weatherproof box with a latching cover. That way, if some Wile E. Coyote type comes snooping around after hours, he has to solve at least one extra puzzle before getting access to the chicken banquet. I was prepared to go further with the predator defense plan, but I needed my anvil.</p><h3>The Door in Operation</h3><p>Here is a short video of the coop door in operation after installation. Note the locking solenoid engaging after the door closes.</p><div id="youtube2-R_6dtcWWSAk" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;R_6dtcWWSAk&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/R_6dtcWWSAk?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h3>Programming the Coop</h3><p>In the earlier article, I mentioned that I added a socket for an optional SparkFun DEV-15096 USB-to-serial module. That gives the controller a simple setup console without needing a display, keypad, or any other nonsense bolted onto the box.</p><p>To configure it, I first made sure the CONFIG/RUN switch was set to CONFIG and hit reset. Then I plugged a USB cable from the module into my laptop and connected with:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;f6f3f147-fca5-4c95-8028-705ad5de99fa&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">screen /dev/ttyUSB0 38400</code></pre></div><p>That dropped me straight into the console. On first reset, the controller came up with default settings and complained, correctly, that the time and configuration had not been saved yet: </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;f1f2f213-1b7b-4df2-bc23-9eaa27600c17&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">Chicken Coop Controller 2.9.0
WARNING: CONFIG INVALID, USING DEFAULTS
TIME: NOT SET
Use: set date YYYY-MM-DD
     set time HH:MM:SS AM|PM</code></pre></div><p>The first thing I did was set the clock. The easy way is to set the date first, then type in the next minute mark while watching a real clock and hit Return about a second before it rolls over. </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;b64095b1-4a5a-4aea-a6aa-bde503c5a309&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">&gt; set date 2026-03-26
OK
&gt; set time 16:20:50
OK</code></pre></div><p>Then I verified that the RTC had taken the new time and was reporting sane values. In this case, it showed the clock as valid and confirmed that the time had been set just a few seconds earlier:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;707b5f15-82a2-4936-ba3c-09c476679a4c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">&gt; rtc
RTC      : VALID
utc      : 2026-03-26 21:21:12
local    : 2026-03-26 04:21:12 PM
epoch    : 1774560072
since_set: 22 sec (0 days 00:00:22)
</code></pre></div><p>After that, I set the rest of the configuration, including latitude, longitude, time zone, DST handling, and the door and lock timing values, then saved it to EEPROM:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;75a9149b-d78d-4137-a338-5f520e93301f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">&gt; save
OK
&gt;  config
CONFIG (SAVED)

lat  : 34.4653
lon  : -93.3628
tz   : -6
dst  : ON (US rules)
rtc_set_epoch : 1774560050
door_travel_ms : 10000
door_settle_ms : 2000
lock_pulse_ms  : 500
lock_settle_ms : 500
</code></pre></div><p>A quick way to verify that the location, time zone, and DST settings are correct is to check the calculated sunrise and sunset times:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d4f235c8-915e-4741-958e-08324dce68ba&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">&gt; solar
           Rise        Set
Actual     07:09 AM    07:30 PM
Civil      06:44 AM    07:55 PM</code></pre></div><p>If you forget the commands, you can always prompt the system for help:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;bash&quot;,&quot;nodeId&quot;:&quot;a4aebd76-9a9d-41b2-8460-0facd5af5da0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-bash">&gt; help
Commands:
  help      Show help
  version   Show firmware version
  time      Show current date/time
  schedule  Show schedule
  solar     Show sunrise/sunset times
  set       Configure settings
  config    Show configuration
  save      Commit settings
  device    Show or set device state
  door      Manually control door
  lock      Manually control lock
  event     Event commands
  led       Control door LED
  rtc       Show raw RTC state
  sleep     Sleep til next scheduled event   </code></pre></div><h3>Build Your Own</h3><p>Like all of my projects, this one is already up on GitHub, including the firmware, schematics, and PCB layout.</p><p>The firmware is released under the MIT License, and the hardware design files are published under the CERN-OHL-P v2 open hardware license, so anyone can study it, modify it, and build their own.</p><p>If you build one, drop a photo in the comments. I&#8217;d enjoy seeing how it ends up in somebody else&#8217;s coop.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>.  It is not always electronics. Believe it or not, I have been known to jump from <a href="https://www.vinthewrench.com/p/strawberry-custard-pie">baking</a> to <a href="https://www.vinthewrench.com/p/i-can-smell-you">perfume</a> to <a href="https://www.vinthewrench.com/p/parts-that-dont-suck-part-4">motorcycles</a> without much warning.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Parts that don't suck: part 4]]></title><description><![CDATA[Some cool motorcycle stuff that I really like.]]></description><link>https://www.vinthewrench.com/p/parts-that-dont-suck-part-4</link><guid isPermaLink="false">https://www.vinthewrench.com/p/parts-that-dont-suck-part-4</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Thu, 19 Mar 2026 22:50:21 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!7u8R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this week&#8217;s installment of Parts That Don&#8217;t Suck, here are a few things that make it easier to focus on riding rather than screwing around with crappy gear. As I mentioned in <a href="https://www.vinthewrench.com/p/back-in-the-saddle-again">an earlier piece</a>, I ride a KLR650, which is technically an &#8220;adventure bike.&#8221; But then again, riding, especially in Arkansas, always seems to be an adventure.</p><h4>If you got a $10 head, buy a $10 helmet.</h4><p>One of the things about Arkansas is the lax&#8230; or rather, lack of helmet laws, and the people who insist on riding without them. I guess that&#8217;s their call. Me, I like my head, and I&#8217;ve done enough time in EMS to know that even a minor crash without a full-face helmet usually doesn&#8217;t end well.</p><p>But it&#8217;s more than just a safety thing. It&#8217;s about comfort, too. Even a speck of dirt, <em>or in my case a bird</em>, at 60+ mph will get your attention. Not to mention the hearing loss from wind noise.</p><p>This time around, I wanted a full-face helmet with an integrated sun visor, like you&#8217;d find on a fighter pilot&#8217;s helmet. I got tired of screwing around with sunglasses, especially riding into a low-angle sunset. Tinted visors are fine until it gets dark, which is exactly when you don&#8217;t want one on a country road.</p><p>That narrowed things down to just a handful of options. Only a few manufacturers make them that I trust to protect my brain housing group. It&#8217;s a short list.</p><p>I ended up with the <a href="https://shoei-helmets.com/models/gt-air-3/">Shoei GT-Air 3</a>. You get what you pay for with helmets. I&#8217;ve always leaned toward Shoei. They put serious effort into engineering their helmets, and I&#8217;ve seen firsthand how well they perform on the track.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6Up8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6Up8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6Up8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg" width="600" height="497" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:497,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:101103,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191514052?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6Up8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6Up8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F27467b8c-53fb-40eb-8258-907d2324a555_600x497.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Shoei GT-Air 3 Helmet with Pinloc visor</figcaption></figure></div><p>Shoei got a lot of things right. Ventilation and the chinstrap are both done properly, and the helmet feels solid. At about 3.8 pounds, it doesn&#8217;t feel heavy at all. I also like that their <a href="https://shoei-helmets.com/products/helmet-parts/">website</a> offers plenty of accessories and replacement parts, so you can set the helmet up the way you want.</p><blockquote><p>Pro-Tip: You can spend a lot more on custom paint schemes. I&#8217;m not trying to look like I belong at Laguna Seca. I bought the basic model.</p></blockquote><p>One thing I didn&#8217;t expect, or even know about, was the Pinlock&#174; system. It&#8217;s a secondary inner lens that mounts inside the face shield and creates a sealed air gap, which keeps it from fogging up. If you&#8217;ve ever ridden in cold or wet conditions, you know how fast a visor can turn useless. This one doesn&#8217;t.</p><div id="youtube2-dMGagjpCits" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;dMGagjpCits&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/dMGagjpCits?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>I&#8217;ve seen similar setups on snowmobile helmets for years, but never on motorcycles.</p><p>The helmet came with the insert. Easy-peasy to install, and once it&#8217;s in, it just works. No sprays, no wiping with your glove, no screwing around.</p><p>And that&#8217;s exactly the kind of thing that makes this helmet not suck.</p><h4>Back Road Equipment Slider Rear Rack</h4><p>One of the problems with riding motorcycles is that you need a way to carry stuff. In spite of what they say about the KLR650, &#8220;that you can fix most things with a rock,&#8221; you still need to carry tools, not to mention first aid gear and maybe a rain suit.</p><p>The stock rear plate was absolutely useless for attaching a bungee cargo net, and I wasn&#8217;t about to spend a lot on <a href="https://www.kawasaki.com/en-us/shop/vehicle-accessories/motorcycle/kl650hnfal/999941866/21-liter-side-case-set">Kawasaki&#8217;s side cases</a>. By the time you&#8217;re done, you&#8217;re into it for real money. So I looked for something simpler.</p><p>Luckily, the folks at <a href="https://www.backroadequipment.com/">Back Road Equipment</a> had a much better solution. They make a slider rear rack system that solves the problem without overcomplicating it. It&#8217;s a pretty cool design, if you ask me. You can secure a Pelican case to it, lock it in place, and still remove it easily when you need to.  </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7u8R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7u8R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7u8R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg" width="600" height="496" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:496,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:145918,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191514052?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7u8R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7u8R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9b9c78b2-df69-41eb-867a-38d93bb3f949_600x496.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Back Road Equipment rear slider rack</figcaption></figure></div><p>The best part is that it costs just a little over $150, and you don&#8217;t have to dish out big bucks for a Pelican box. A $40 <a href="https://www.harborfreight.com/3800-weatherproof-protective-case-large-orange-56766.html">Harbor Freight clone</a> works just fine, and you can always <a href="https://www.backroadequipment.com/how-to-choose-the-best-case-for-your-application/">step up to a larger one</a> if you need to.</p><p>One more thing about the Harbor Freight case. I don&#8217;t know who thought it was a good idea to plaster it with that many stickers and labels (<em><a href="https://www.thoughtco.com/dantes-9-circles-of-hell-741539">Dante</a></em><a href="https://www.thoughtco.com/dantes-9-circles-of-hell-741539"> </a><em><a href="https://www.thoughtco.com/dantes-9-circles-of-hell-741539">probably had a special circle set aside just for them</a></em>), but I spent over an hour with solvents getting them off.</p><p>Installation is straightforward. <a href="https://www.backroadequipment.com/wp-content/uploads/2024/07/puck_location_pdf-1.pdf">Drill four holes in the case</a>, install the slider pucks, and don&#8217;t forget a little silicone to keep it watertight.   </p><p>You might find that after removing the Kawasaki stock rear plate, a set of alignment drifts comes in handy for aligning the slider plate.</p><p>One more thing before I move on: Back Road Equipment&#8217;s customer service was great. The owner called me, helped straighten out my order, and shared a few installation and usage tips.</p><div id="youtube2-Fsl0k8YfYSE" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;Fsl0k8YfYSE&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/Fsl0k8YfYSE?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h4>How about a Light Switch That Doesn&#8217;t Suck</h4><p>When I bought the bike, I got a great deal on Kawasaki&#8217;s LED auxiliary lights. The lights themselves are reasonable (did I say I got a good deal). The stock switch on the dash, however, is an unbelievably bad user experience.  They stuck it up on the cowling next to the gauges, where it&#8217;s awkward and flat-out unsafe to reach.</p><p>I don&#8217;t know what Kawasaki was thinking. This doesn&#8217;t feel like something the core engineers would sign off on. More likely some regulatory requirement turned it into a piss-poor design.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_tCo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_tCo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 424w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 848w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 1272w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_tCo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png" width="430" height="157" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:157,&quot;width&quot;:430,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14114,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191514052?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!_tCo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 424w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 848w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 1272w, https://substackcdn.com/image/fetch/$s_!_tCo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4176fc-35df-4947-93a6-776101dfeb4c_430x157.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">possibly the dumbest place to put a switch</figcaption></figure></div><p>So I did what I always do. I got out my tools and modified it to make it work right.  </p><p>A much better place for the switch is right next to the light and horn controls on the left handlebar, where your thumb can hit it without taking your hand off the grip.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ODuc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ODuc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ODuc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg" width="600" height="377" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:377,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99763,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191514052?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ODuc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ODuc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff006fcef-4868-4bf6-9e2d-a4dd38b11e32_600x377.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After a few minutes of digging around online, I found exactly what I needed, <a href="https://www.amazon.com/dp/B09BYW417Y?th=1">a simple handlebar-mounted switch</a>. It was even illuminated.  </p><p>This would have been a five-minute job with some hand tools and a soldering iron, if it weren&#8217;t for the wonky way Kawasaki mounted their switch. I had to remove a good chunk of the cowling just to get to the screws they hid behind the switch assembly. But I persevered, and after a few knuckle scrapes, Kawi&#8217;s design was just a faded memory.  </p><h3>Make It Your Own</h3><p>Half the fun of owning a motorcycle is making it your own and setting it up the way you like. That&#8217;s how you end up with something that&#8217;s actually yours.</p><p>Mine just happens to have a <a href="https://www.vinthewrench.com/p/ai-maker-tools-and-a-rabbit-with">pissed-off bunny</a> sticker on it. But that&#8217;s me.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!R6z4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!R6z4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 424w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 848w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 1272w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!R6z4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png" width="200" height="232" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:232,&quot;width&quot;:200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65249,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191514052?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!R6z4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 424w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 848w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 1272w, https://substackcdn.com/image/fetch/$s_!R6z4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24166c2c-7c6b-429f-886f-7b0103cb7bfd_200x232.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p> As I say in each of these pieces, there are no sponsorships here. Don&#8217;t ask for one. No affiliate links. No favors. I&#8217;m pretty sure most of these companies have never heard of me, and that&#8217;s fine. I&#8217;m writing about these parts because they earned their place in my shop by working, not because anyone asked or paid for it.</p><div><hr></div><p>If you like building things, and sometime doing a better job than the manufacturer, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write</a>. Sharing it helps real people find the work. The algorithm can go take a hike.</p>]]></content:encoded></item><item><title><![CDATA[Strawberry Custard Pie]]></title><description><![CDATA[A Quick Dessert Project for a Guest Visit]]></description><link>https://www.vinthewrench.com/p/strawberry-custard-pie</link><guid isPermaLink="false">https://www.vinthewrench.com/p/strawberry-custard-pie</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Mon, 16 Mar 2026 23:35:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!c-qb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!c-qb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!c-qb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!c-qb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg" width="600" height="452" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:452,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138006,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191192249?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!c-qb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!c-qb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3021195e-2dbe-4276-b171-f59a9bf9356a_600x452.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I had a guest visit the other day, and I asked what their preference for dessert might be. They suggested strawberry rhubarb pie. Unfortunately, rhubarb was out of season, so that idea was off the table.</p><p>Instead, I went with what I had on hand and put together a <strong>Fresh Strawberry Custard Pie</strong>. It turned out to be a real hit and didn&#8217;t leave much in the way of leftovers.</p><p>The combination of a simple butter crust, vanilla custard, and fresh strawberries worked beautifully.  Most of my recipes are improvisation anyhow.</p><p>I&#8217;m sharing the recipe here partly because friends asked for it, and partly so I have it written down somewhere sensible. I&#8217;ve learned that if I don&#8217;t write it down, it&#8217;s lost forever.</p><p>So this is both a recipe and a small act of documentation for future me.</p><h4>Pie Crust Ingredients</h4><p>This is a derivative of the crust I used in my <a href="https://www.vinthewrench.com/p/a-different-kind-of-pi-project">Apple Pie</a> project.  </p><p>One thing I did change this time was the flour. For this batch I used flour made from <strong><a href="https://www.azurestandard.com/shop/product/food/grains/wheat/soft-white-wheat-berries/soft-white-wheat-organic/11650?package=GR120">Azure Market Organic Soft White Wheat Berries</a></strong>.</p><p>We picked up a <a href="https://www.amazon.com/dp/B08N16CT2Y">grain mill from Amazon</a> a while back and started grinding and sifting our own flour. Fresh-milled flour behaves and tastes a little different than store-bought flour. It has a slightly nutty flavor and a bit more character. After grinding, we sift the flour to remove some of the coarser bran so the crust stays light rather than heavy.</p><p>You can substitute <a href="https://www.bobsredmill.com/product/organic-all-purpose-unbleached-white-flour">Bob&#8217;s Red Mill Organic Unbleached White All Purpose Flour</a> if you don&#8217;t want to go through the process of grinding and sifting your own flour.</p><ul><li><p>2 1/2 cups, organic ground white flour</p></li><li><p>1 cup, <a href="https://www.azurestandard.com/shop/product/food/dairy/butter/sweet-cream/unsalted/butter-unsalted-organic/19626">Rumiano organic unsalted butter</a> </p></li><li><p>1/2 teaspoon, <a href="https://www.azurestandard.com/shop/product/food/baking-pantry/salt/sea/celtic-sea-salt-fine/7054?package=BP112">Sea Salt</a></p></li><li><p>1 tablespoon, Granulated sugar</p></li><li><p>5&#8211;6 tablespoons ice water</p></li></ul><p>Cut the butter into small &#8540;" cubes using a <a href="https://www.amazon.com/pastry-cutter/s?k=pastry+cutter">pastry cutter</a>.  Combine the flour, sugar, salt, and butter in a bowl and work it together with the pastry cutter until the butter is broken into small pieces.</p><p>Avoid the food processor if you can. It works, but using a pastry cutter is just as effective and a lot easier to clean up afterward.</p><p>Add the ice water a tablespoon at a time, mixing gently with a fork or pastry cutter. </p><p>What you&#8217;re aiming for is a <strong>coarse, crumbly mixture</strong> with little pea-sized bits of butter coated in flour. That texture is what produces a tender crust.</p><p>If the dough starts looking smooth or pasty, you&#8217;ve gone too far and overworked it. The goal is for the dough to <strong>just come together</strong>, not turn into a uniform paste. </p><p>Occasionally I&#8217;ll put the mixture in the refrigerator or freezer for a few minutes to keep the butter cold before continuing. Keeping the butter firm helps the crust bake up tender and flaky.</p><p>When you are ready, put some flour down on your work surface and roll the dough out just thick enough to line the pie tin. At that point I put the prepared pie tin into a large Ziploc bag and placed it in the refrigerator until I finished preparing the custard.</p><h4>Blind Bake the Crust</h4><p>The crust was blind baked. I lined it with parchment and filled it with &#8220;pie weights,&#8221; in my case a jar of old black beans. The point is to weigh the dough down so it doesn&#8217;t bubble or shrink while the fat melts and the structure sets. </p><ol><li><p>Roll the dough and line the pie tin with the crust.</p></li><li><p>Cover with parchment + pie weights or beans</p></li><li><p>Preheat to 350&#176;F </p></li><li><p>Bake 20 minutes at 350&#176;F</p></li><li><p>Remove the weights and parchment</p></li><li><p>Bake again uncovered 10&#8211;15 minutes more</p></li><li><p>optional -  beat one egg white and brush a thin layer on the hot crust </p></li><li><p>Put it back in the oven <strong>2 minutes</strong></p></li><li><p>Let the shell cool <strong>20&#8211;30 minutes</strong> before adding custard.</p></li></ol><h4>Prepare the custard</h4><p>For the custard I used the same formula from my <a href="https://www.vinthewrench.com/p/a-tart-is-always-a-pie-but-a-pies">Fruit Tart project</a>.</p><ul><li><p>3 tablespoons flour</p></li><li><p>2 tablespoons arrowroot</p></li><li><p>&#189; cup granulated sugar</p></li><li><p>&#188; teaspoon sea salt</p></li><li><p>2 eggs (fresh from my chickens)</p></li><li><p>2 cups pasteurized milk</p></li><li><p>1 tablespoon unsalted butter</p></li><li><p>1 vanilla bean, split and scraped</p></li><li><p>Zest of one lemon and one orange, with a little juice from each</p></li><li><p>A small amount of gelatin, bloomed and added later for extra set</p></li></ul><ol><li><p>In a medium bowl I whisked together the flour, arrowroot, sugar, salt, and eggs until it looked smooth and lump-free.</p></li><li><p>In a saucepan I heated the milk and butter with the lemon and orange zest and the scraped-out vanilla bean (pod and all) just until it was steaming but not boiling.</p></li><li><p>Temper the eggs. I slowly drizzled a ladle of the hot milk into the egg mixture while whisking like mad. The goal is to bring the eggs up to temp gently so they don&#8217;t scramble later.</p></li><li><p>Then I poured the warmed egg mix back into the saucepan with the rest of the hot milk, still whisking. This is also a good time to fish out the vanilla pod.</p></li><li><p>I cooked it over medium heat, stirring constantly, until it thickened enough to coat the back of a spoon, about 170 to 175 &#176;F if you check. Don&#8217;t let it boil hard or you&#8217;ll destroy it.</p></li><li><p>Turn off the heat.</p></li><li><p>For extra insurance, I bloomed a little gelatin in cold water, then stirred it into the hot custard until fully melted.</p></li><li><p>I scooped the custard into a glass bowl and pressed plastic wrap directly onto the surface to keep a skin from forming. Let it cool on the counter for a while, then place it in the refrigerator for <strong>1&#8211;2 hours</strong> until it is cool to the touch and fully set, roughly <strong>below 70 &#176;F</strong>, before filling the pie.</p></li></ol><h4>Assemble the Pie</h4><p>Once the custard is fully chilled and the pie shell has cooled, it&#8217;s time to assemble the pie. Spoon the custard into the baked pie shell and spread it evenly with a spatula. The filling should be thick enough to hold its shape but still spread smoothly.</p><p>Level the surface and return the pie to the refrigerator for about <strong>20&#8211;30 minutes</strong> to firm up slightly. This helps keep the strawberries from sinking when you arrange them.</p><p>Once the custard is set, the pie is ready to decorate with fresh strawberries. I sliced the tops off, cut the berries vertically, and arranged them in circular layers, working from the outside toward the center.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nfGp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nfGp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nfGp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg" width="600" height="496" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:496,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:133808,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/191192249?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nfGp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nfGp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d733528-e479-4f56-a96d-1e6246cc7348_600x496.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That&#8217;s all there is to it. A simple crust, a straightforward custard, and a pile of fresh strawberries arranged on top.</p><p>It started as a substitute for strawberry rhubarb pie, but it turned out to be a pretty good dessert on its own. Sometimes cooking works that way. You aim for one thing, and circumstance pushes you somewhere else.</p><p>The result was good enough that it&#8217;s worth writing down so I can make it again without reinventing it. And if someone else happens to try it and enjoy it too, all the better.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. Sometimes I even write about things that are yummy.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[I can smell you]]></title><description><![CDATA[Perfume once smelled like people. Now it smells like soap.]]></description><link>https://www.vinthewrench.com/p/i-can-smell-you</link><guid isPermaLink="false">https://www.vinthewrench.com/p/i-can-smell-you</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Mon, 16 Mar 2026 19:59:18 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!B0_4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Humans smell like humans. Or at least they used to.</p><p>For most of human history those smells were simply part of being alive. They whispered things about health, attraction, and who you were. Long before science began talking about pheromones, people were already responding to those signals without realizing it.</p><p>Perfumers understood this long before they understood the chemistry. Classic perfumes were built to cooperate with the body rather than fight it. Ingredients like musk, civet, leather, and oakmoss produced warm, slightly animalic notes that echoed the chemistry of human skin. They mingled with the wearer&#8217;s natural scent and deepened it. A good perfume didn&#8217;t erase the body. It amplified it.</p><p>And for a long time that was how perfume worked.</p><p>But somewhere along the way we got lost. Now many modern perfumes try to bury the body beneath the smell of clean laundry and soap.</p><p>So how did we get so far off track?</p><h3>The Biology of Human Scent</h3><p>The way people smell to us begins in chemistry and ends in emotion.</p><p>Smell is unusual among the senses because it connects directly to some of the brain&#8217;s oldest structures, such as the amygdala and hippocampus, which shape emotion, memory, and desire. Signals from the nose reach these areas without first passing through the slower analytical parts of the brain. </p><p>In that sense, smell bypasses the careful rational mind and lands somewhere deeper. That is why a scent can trigger a memory instantly, or make someone seem suddenly familiar, intriguing, or irresistible.</p><p>A big part of that scent comes from chemicals our bodies make from sex hormones. Those steroid molecules seep out through sweat and skin oils, and bacteria on our skin break them down into smaller volatile compounds that drift into the air around us.</p><p>Our skin is constantly releasing other molecules as well, derived from fatty acids and normal metabolism. As they reach the surface, bacteria transform many of them into airborne compounds that give each person a scent that is subtly unique.</p><p>Some of the most interesting of these molecules originate from androgen hormones such as testosterone, tied to the chemistry of attraction and social recognition. The human nose is remarkably sensitive to them.</p><p>A smell can trigger a vivid memory, a feeling of comfort, or an instinctive sense that someone is appealing or familiar before we have time to explain why.</p><p>And this is why <strong>scent can sometimes cause emotion to override rational judgment</strong>. </p><p><em><a href="https://www.youtube.com/watch?v=YY9iVKQPeXA">Do you know what I mean</a><strong><a href="https://www.youtube.com/watch?v=YY9iVKQPeXA">.</a></strong></em></p><h3>The Man Who Took Perfume Apart</h3><p>Years ago, while I was digging into perfume, I came across one of the most interesting books ever written about smell: <em>The Emperor of Scent</em>. Reading it sent me down a rabbit hole that eventually became the impetus for this article.</p><p>It tells the story of Luca Turin, a biophysicist who wandered into the perfume world and started asking questions that nobody there seemed comfortable answering.</p><p>For decades the official scientific explanation of smell had barely changed. The prevailing theory claimed that odor came from the shape of molecules fitting into receptors in the nose like a lock and key. As the saying goes, the science was settled.</p><p>Turin wasn&#8217;t convinced.</p><p>He proposed something very different. Instead of shape alone, he argued that smell might depend on the way molecules vibrate. If that were true, scent would no longer be something discovered slowly through intuition and experimentation. It could be understood, predicted, and deliberately constructed.</p><p>The reaction from both the academic world and the perfume industry was closer to panic than curiosity. Academics had built careers on the lock-and-key theory, while perfumers guarded their formulas in private notebooks and trade secrets, passed down through apprenticeships and quiet tradition.</p><p>At one point Turin&#8217;s work was submitted to <em>Science</em>, supposedly one of the most prestigious journals in the world. What followed was a demonstration of how peer review can behave when a theory threatens the status quo. </p><p>There was no open debate, no careful testing of the evidence. The paper was handed to reviewers who treated the idea as something to eliminate.  It wasn&#8217;t argued against. It was quietly buried.</p><div class="pullquote"><p>&#8220;It&#8217;s a big club, and you ain&#8217;t in it.&#8221; &#8212; George Carlin</p></div><p>But if Turin was right, his theory had the potential to disrupt the entire industry. What had once been the guarded knowledge of a few master perfumers might now, in an age of ubiquitous AI and modern chemistry, be analyzed, reconstructed, and reproduced by a determined experimenter working in a small lab.</p><p>Imagine a device that could read molecular vibrations and display them the way a modern SDR program reveals the radio spectrum, turning invisible signals into a visible pattern of frequencies. </p><p>Once scent could be seen that way, recreating it would no longer be guesswork. It would just be engineering.</p><h3>When Perfume Was Intoxicating (1920s&#8211;1960s)</h3><p>Let&#8217;s step back to the early twentieth century, when perfume was something entirely different.</p><p>Air conditioning was rare. Washing machines were still spreading into homes. Most people did real work and walked long distances every day. Cities smelled stronger. Streetcars rattled past open windows. People smelled stronger too. Bars, dance halls, and crowded restaurants filled the air with cigarette smoke, wool coats, leather jackets, perfume, and sweat.</p><p>Music was louder and the rooms were packed. Big band and early jazz poured out of dance halls and bars where people crowded shoulder to shoulder. The energy there came from the same place as the music itself: people working hard, living independently, and not worrying about sanding life&#8217;s rough edges. As it was once explained to me, in hard years, especially during wartime, people gathered in places like that to forget their troubles for a few hours and feel alive again.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6qu1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6qu1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 424w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 848w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 1272w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6qu1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp" width="300" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:300,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:15532,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190958027?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6qu1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 424w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 848w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 1272w, https://substackcdn.com/image/fetch/$s_!6qu1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F772faf38-993d-4587-9a5b-450fdb05a14f_300x400.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><strong>Crowded dance floors, loud music, and bodies moving close together. Perfume was made for nights like this.</strong></figcaption></figure></div><p>That older world was also less afraid of the physical realities of life. The human body was simply part of the landscape, not something that had to be constantly managed or sanitized away. The smells of work, movement, and proximity were ordinary parts of daily life. </p><p>In that world, perfumes were not meant to hide the body but to mingle with it and amplify it&#8217;s natural smells.</p><p>One of the most famous perfumes of that era was <strong><a href="https://blog.delacourte.com/en/chanel-n-5-perfume/">Chanel No. 5</a></strong>. When it appeared in 1921 it was unlike anything people had smelled before. Bright aldehydes gave it a sparkling, almost champagne-like opening, but underneath was a deep base of musks, woods, and animalic notes that bloomed as the perfume settled into the warmth of the body. What began polished and elegant slowly turned warm and quite intoxicating.</p><p>Then there was <strong>Bandit</strong>. If Chanel No. 5 was elegance, Bandit was the woman in the red dress you couldn&#8217;t ignore.  It opened sharp and green with galbanum, then settled into leather, oakmoss, patchouli, and vetiver. One spray could fill a room. On skin it became darker and more sensual, the kind of perfume that seemed to grow warmer as the night went on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B0_4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B0_4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 424w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 848w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 1272w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B0_4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png" width="450" height="368" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:368,&quot;width&quot;:450,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:326742,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190958027?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B0_4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 424w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 848w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 1272w, https://substackcdn.com/image/fetch/$s_!B0_4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93cbe382-6b06-41f6-b013-4cde457c9d0b_450x368.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Then there was <strong><a href="https://stjohnsbayrum.com/pages/st-johns-fragrance-company-full-story">Bay Rum</a></strong>. For generations barbers splashed it on after a shave, a spicy blend of bay leaf, rum, and warm Caribbean spices. It opened sharp and bracing, then settled into something deeper as it warmed. Imagine it for a moment. It was a scent that seemed to amplify the warm chemistry of skin, sweat, and testosterone.</p><p><strong>Note:</strong> Many of these fragrances have been reformulated over the years, and modern versions smell quite different from the originals people knew in those earlier decades. From time to time original bottles still surface in vintage fragrance markets and online auctions.  </p><p>Even as the counterculture of the 1960s reshaped music, fashion, and social life, perfume still played by those same rules.  It was meant to meet the body, not erase it.</p><h3>When the Dance Floor Was Hot (1970s)</h3><p>By the 1970s the music had changed, but the atmosphere hadn&#8217;t. The big bands were gone, replaced by funk, soul, and disco, but people still gathered in the same way: crowded rooms, packed dance floors, bodies moving together in the heat.</p><p>Disco clubs were loud, dark, and alive. Lights flashed across mirrored walls and spinning balls overhead. The air was thick with cigarette smoke, sweat, and perfume.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!O69I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!O69I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 424w, https://substackcdn.com/image/fetch/$s_!O69I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 848w, https://substackcdn.com/image/fetch/$s_!O69I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 1272w, https://substackcdn.com/image/fetch/$s_!O69I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!O69I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif" width="397" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&quot;width&quot;:397,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:10171,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/avif&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190958027?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!O69I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 424w, https://substackcdn.com/image/fetch/$s_!O69I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 848w, https://substackcdn.com/image/fetch/$s_!O69I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 1272w, https://substackcdn.com/image/fetch/$s_!O69I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7be50068-9b6b-40a6-be72-bada1ccc3da8_397x390.avif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">In the crowded discos of the 1970s, perfume had to be strong enough to command attention.</figcaption></figure></div><p>One of the defining scents of the era was <strong><a href="https://www.townandcountrymag.com/style/beauty-products/a36548790/halston-perfume-history/">Halston</a></strong>, a deep chypre built around oakmoss, patchouli, amber, and woods. Warm, rich, and unmistakable, it had the kind of presence that could cut through the smoke and heat of a crowded club.</p><p>Then there was <strong><a href="https://29secrets.com/beauty/the-story-of-yves-saint-laurents-opium-perfume/">Opium</a></strong>. Dark, spicy, and full of resins and woods, it carried enormous weight. A single spray lingered in the air and grew warmer as the night went on.</p><p>For men, <strong><a href="https://basenotes.com/threads/paco-rabanne-pour-homme-the-early-days-1973-1981.364790/">Paco Rabanne Pour Homme</a></strong> captured the same spirit.  Built on a classic foug&#232;re structure of lavender, oakmoss, herbs, and woods, it was bold, masculine, and impossible to miss. Like the other fragrances of the era, once it warmed up it carried easily through crowded rooms.</p><h3>When Perfume Got Loud (1980s)</h3><p>By the 1980s, disco had faded, replaced by drum machines, synthesizers, and a harder electronic sound that pulsed through the clubs.</p><p>The atmosphere had changed too. Leather jackets and pants, aerosol hair spray, cigarette smoke, and sweat thickened the air. The rooms were still hot and crowded, but the style was bigger, bolder, and more theatrical.</p><p>In a decade that celebrated ambition and spectacle, fragrances grew louder and more dramatic. They no longer lingered quietly on the body. They filled the room.</p><p>One of the defining perfumes of the era was <strong><a href="https://www.fragrantica.com/perfume/Dior/Poison-218.html">Poison</a></strong>. It was unmistakable. Dense and dramatic, it opened with a rich sweetness before unfolding into dark spices, resins, and woods. In a crowded bar it could announce itself long before the woman wearing it entered the room.</p><p>Then there was <strong><a href="https://www.fragrantica.com/perfume/Giorgio-Beverly-Hills/Giorgio-1889.html">Giorgio Beverly Hills</a></strong>. It was also impossible to ignore, but in a different way. Built around huge white florals like tuberose and jasmine layered over woods and musk, it was bright, bold, and incredibly strong. Department stores had to move the display near the entrance because the scent filled the entire floor.  What began as a sharp burst of flowers slowly settled into a warm musky sweetness that lingered long after the wearer had gone.</p><p>Then there was <a href="https://www.reddit.com/r/fragrance/comments/9b6fsf/chandler_burr_on_the_history_of_drakkar_noir/">Drakkar Noir</a>. For many men in the 1980s it was the scent of the night. Built on a dark foug&#232;re structure of lavender, oakmoss, herbs, woods, and leather, it was sharp, masculine, and unmistakable. It projected strongly at first, then deepened into something darker and slightly smoky as the hours passed.</p><p>Giorgio Beverly Hills was the blonde in the spotlight, bright, glamorous, and impossible to ignore. Poison was that mysterious, dangerous dark-haired woman you kept noticing across the room. And Drakkar Noir was the guy leaning on the bar who simply owned the place.</p><h3>We Lost the Scent (1990s)</h3><p>Then sometime in the 1990s something strange happened. Perfume stopped smelling like people and started smelling like laundry soap.</p><p>Instead of blending with the scent of the body, fragrances began trying to erase it. In many cases they were chemically indistinguishable from the fragrances used in detergents and fabric softeners.</p><p>The culture around them had changed too. The sweaty glamour of disco and the loud excess of the 1980s gave way to a cooler, more restrained style shaped by grunge and early hip-hop. The new look was neutral, understated, and often deliberately androgynous.</p><p><strong>CK One</strong> (Calvin Klein) became one of the defining perfumes of the 1990s. Light, bright, and deliberately clean, it rejected the old idea that perfume should warm and deepen on skin.  <strong>Rather it smelled like soap.</strong></p><p>CK One was marketed as unisex, meant for men and women alike. The bottle looked almost clinical, like a laboratory flask, and the advertising followed the same idea. Black-and-white photographs of young people in plain jeans and T-shirts replaced the glamorous perfume ads of earlier decades.</p><p>The goal was no longer warmth or sensuality but cleanliness. The culture stopped celebrating the body and started sanitizing it.</p><h3>The Detergent Economy</h3><p>At the same time something else was happening behind the scenes. The same fragrance companies that designed luxury perfumes were also designing scents for detergents, shampoos, deodorants, and household cleaners.</p><p>Those products were produced in enormous volumes, far larger than the perfume market. Their fragrances had to be inexpensive, chemically stable, and able to survive heat, water, and months on a store shelf.</p><p>Traditional perfumes relied on complex natural materials such as <strong>oakmoss, animalic musks, resins, and woods</strong> that created deep, warm bases designed to interact with the chemistry of skin.</p><p>Industrial products needed something different. The fragrance industry began building scents from a smaller palette of synthetic musks that were cheap, durable, and easy to reproduce.</p><p>One of the molecules that quietly took over was Galaxolide. It had the soft, smooth smell many people associate with freshly washed fabric. Chemically it is a large, bulky hydrocarbon ring packed with methyl groups, a structure that makes the molecule unusually stable, resistant to oxidation, and able to survive heat, water, and long storage without breaking down.</p><p>That made it perfect for detergents and fabric softeners, surviving the washing machine and clinging to clothing while leaving behind the lingering scent advertisers called &#8220;clean,&#8221; though it was really just the smell of the chemicals themselves.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s3j3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s3j3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 424w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 848w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 1272w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s3j3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png" width="400" height="281" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:281,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:208813,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190958027?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s3j3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 424w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 848w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 1272w, https://substackcdn.com/image/fetch/$s_!s3j3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77301118-11b0-40d9-a2f8-5344aaf6a4a3_400x281.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Is this what people smell like?</figcaption></figure></div><p>Over time the industry effectively brainwashed people into associating that chemical scent with cleanliness. Clothes washed in detergents smelled that way, and towels and even homes cleaned with modern products carried the same scent. After years of repetition people began to accept that chemical smell as the very definition of clean.</p><p>Eventually the same molecules began appearing in perfumes, and the smell of laundry moved from the washing machine into the fragrance bottle.</p><blockquote><p><strong>Side note:</strong> It can be argued that regulation also played a part in pushing the industry away from many traditional perfume materials. European regulators began restricting ingredients such as oakmoss after reports of allergic reactions in patch tests. Critics argued that many of those tests focused on people who already had skin sensitivities, producing numbers that looked far more alarming than what most people experienced in everyday life. </p></blockquote><p></p><blockquote><p>Personally, I suspect many more people react to the modern chemistry that replaced those materials. Synthetic musks such as Galaxolide, along with additives derived from corn and other industrial feedstocks, appear in a wide range of modern cleaning products. They are everywhere, in detergents, household cleaners, and personal care products, washing down our drains and circulating through wastewater systems, rivers, and even parts of the water supply.</p></blockquote><h3>The Rebellion</h3><p>Not everyone accepted the new world of soap-clean fragrance. A handful of modern perfumers began pushing back, bringing back the musks, woods, and animalic notes that older perfumes once wore proudly.</p><p>One of my favorites is the French house <a href="https://www.etatlibredorange.com/pages/the-brand">&#201;tat Libre d&#8217;Orange</a>, which deliberately builds fragrances around the very smells modern perfumery tried to erase.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bsBt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bsBt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bsBt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg" width="300" height="301" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:301,&quot;width&quot;:300,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:35043,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190958027?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bsBt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 424w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 848w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!bsBt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F575c5113-a41e-44bb-bd59-5fa3c7f5dc33_300x301.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>One example is <em><strong>Fat Electrician</strong></em>. Despite the absurd name, it is built around vetiver, woods, and creamy resins that come alive the way older perfumes once did. It smells human and slightly worn in, not freshly laundered.</p><p>Then there is <em><strong>S&#233;cr&#233;tions Magnifiques</strong></em>. That one goes much further. It deliberately references the metallic, salty, bodily notes associated with skin, sweat, and intimacy. The reviews are legendary. Some people love it. Others say it is revolting. It was designed to shock people, but also to remind them of something modern perfume had tried to forget. The human body has a smell.</p><h3>The Smell of Being Human</h3><p>Perfume once amplified the scent of a living body. It warmed on skin, mixed with breath and sweat, and slowly became something uniquely human.</p><p>Somewhere along the way modern culture decided to replace that complexity with the smell of soap.</p><p>Scent is one of the oldest languages we have. Long before words, it told us who was near, who was healthy, who we were drawn to. A scent can make someone seem warm, mysterious, familiar, or irresistible before a single word is spoken. It binds memory, attraction, and emotion together in ways we barely understand.</p><p>When perfume forgets the body and starts smelling like laundry, it isn&#8217;t just a change in style. It is a retreat from the chemistry that once made scent feel alive.</p><p>In the name of cleanliness we traded warmth for sterility and passion for safety.</p><p>But without passion, emotion, and a little danger, are we even alive?</p><p>In a world increasingly mediated by artificial intelligence, simulated images, and conversations held through glass screens, we are drifting away from the concept of physical presence. We forget what it means to stand close to another person, to flirt, to share the invisible signals our bodies constantly send.</p><p>Perfume once spoke that language.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. Sometimes I even write about why things stink.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[The Illusion of AI Wisdom]]></title><description><![CDATA[Why LLMs Failed Me Debugging a Design and What That Says About Their Limits]]></description><link>https://www.vinthewrench.com/p/the-illusion-of-ai-wisdom</link><guid isPermaLink="false">https://www.vinthewrench.com/p/the-illusion-of-ai-wisdom</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Tue, 10 Mar 2026 22:18:24 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!lZL_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lZL_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lZL_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lZL_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg" width="400" height="562" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:562,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:60863,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190205786?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lZL_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 424w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 848w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!lZL_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff1761649-e7ec-450a-97c9-648a7b5419e2_400x562.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">&#8220;Vinnie&#8217;s doing another rant on AI&#8221;</figcaption></figure></div><blockquote><p><strong>User:</strong> Is this mushroom edible?</p><p><strong>LLM:</strong> Yes, that mushroom is edible.</p><p><strong>User:</strong> I just ate it and now I&#8217;m vomiting.</p><p><strong>LLM:</strong> Thank you for pointing that out. That mushroom is actually poisonous. Would you like to know more about edible mushrooms?</p></blockquote><p>In a recent article about <a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">building a better chicken coop door</a>, I mentioned that I tried to use Grok and GPT for component recommendations.  Both of them gave answers that sounded confident, detailed, and completely reasonable. And <strong>both of them were also dead wrong</strong>.</p><p>That experience made me curious. Large language models (LLMs), often lumped together under the label &#8220;AI,&#8221; often produce explanations that read as if they were written by someone who knows exactly what they&#8217;re talking about. Yet when you dig into the details, the recommendations can turn out to be flawed, misleading, or sometimes entirely fabricated.</p><p>To understand why that happens, it helps to step back and look at what these systems actually are, and just as importantly, what they are not. </p><p>To start with, despite all the hype, these systems are not intelligent. What they are is extremely sophisticated statistical pattern matchers. Trained on enormous amounts of human text, they learn the statistical relationships between words, phrases, and ideas.</p><p>When you ask a question, they are not reasoning through the problem or looking up a verified answer.  Rather, they produce a response that statistically resembles the kinds of answers humans have written before.</p><p>The result might feel insightful and authoritative. But here&#8217;s the key point: </p><p>It doesn&#8217;t <strong>know</strong> the answer.</p><p>It knows <strong>what answers usually look like.</strong></p><p>But sounding correct and being correct are two very different things. </p><p><strong>Let that sink in for a minute.</strong></p><p>I could give a few examples, but you probably already have plenty of your own.</p><h3>LLMs:  The Internet&#8217;s Bullshit Generator</h3><p>That phrase may sound a bit harsh, but it&#8217;s actually quite accurate, especially in light of what philosopher <a href="https://www.math.mcgill.ca/rags/JAC/124/bs.html">Harry Frankfurt wrote in his essay </a><em><a href="https://www.math.mcgill.ca/rags/JAC/124/bs.html">On Bullshit</a></em>.  (I&#8217;m not making this up.) Frankfurt draws an important distinction between lying and bullshit. A liar knows the truth and deliberately tries to conceal it. A bullshitter is different. The bullshitter simply doesn&#8217;t care whether something is true or false. The goal is not accuracy, but persuasion. The only goal is to produce something that sounds convincing.</p><p>That description turns out to fit large language models surprisingly well.</p><p>By design, an LLM isn&#8217;t trying to deceive you. It isn&#8217;t trying to tell the truth either. In fact, it has no concept of truth at all.  Its only objective is to generate text that statistically resembles the kinds of answers humans tend to produce.</p><p>If the response sounds plausible, structured, and authoritative, then from the model&#8217;s perspective it has done its job.</p><p>Which is why if you train a system to produce text that <em>sounds right</em>, you should not be surprised when it sometimes produces answers that sound perfectly reasonable but are completely wrong.</p><h3>It&#8217;s all about the training</h3><p>Training a large language model can be broken down into a few steps:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!PAtL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PAtL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PAtL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg" width="500" height="375" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:375,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:68207,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190205786?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!PAtL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 424w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 848w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!PAtL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5a3c4d36-106f-493a-8ffd-141e97e97aef_500x375.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Step 1. Collect a huge amounts of text</h4><p>The first step in training a large language model is gathering an enormous amount of written material. This includes books, articles, documentation, forums, source code, and large portions of the public internet. </p><p>The goal is not to teach the system facts. The goal is simply to expose it to as many examples of human writing as possible. The more text the system sees, the more patterns it can learn about how language works and how people tend to explain things.</p><p>Some of that writing is careful and well thought out.  Some of it is sloppy, biased, or simply wrong.   The LLM doesn&#8217;t know the difference between  the Good, the Bad and the Ugly.  It doesn&#8217;t care; it just learns the patterns in whatever you feed it.</p><blockquote><p>This is a key point.  The LLM model is basically a statistical mirror of the text it was trained on. If the internet contains good explanations, bad explanations, arguments, opinions, and outright nonsense, the model will learn patterns from all of it.</p></blockquote><h4>Step 2. Break the text into tokens</h4><p>Before the model can learn from the text, the words have to be converted into a form the computer can process.  So the text is broken into small pieces called <em>tokens</em>. A token might be a whole word, part of a word, or a piece of punctuation.</p><p>Take this sentence:</p><blockquote><p>&#8220;The chicken coop door uses a linear actuator.&#8221;</p></blockquote><p>This is broken into tokens that represent words and punctuation. Each token is then converted into a number that the model can work with.</p><h4>Step 3. Learn to predict the next word</h4><p>Once everything is turned into numbers, the system can start learning patterns in how those tokens tend to appear together.</p><p>The model is shown a sequence of tokens and asked to predict what token should come next. It does this over and over again across massive amounts of text.</p><p>or example, the model might see something like:</p><blockquote><p>&#8220;The chicken coop door uses a 12 volt ...&#8221;</p></blockquote><p>Based on patterns it has learned, it tries to guess the next word. It might predict something like: </p><blockquote><p>&#8220;motor&#8221;</p></blockquote><p>If the guess is wrong, the system adjusts its internal parameters slightly and tries again on the next example. This process repeats billions or even trillions of times.</p><p>Over time the model becomes very good at predicting what words tend to follow other words. That&#8217;s how it learns grammar, sentence structure, and the patterns of how people explain things.</p><p><strong>The LLM isn&#8217;t learning facts, it&#8217;s learning patterns in how words and ideas tend to appear together.</strong></p><h4>Step 4. Fine tuning</h4><p> The model then goes through a smaller round of additional training called fine-tuning. At this stage, the system is trained on carefully selected high-quality prompt-and-response pairs written or reviewed by humans. </p><p>These examples are chosen because the raw internet text is often messy, inconsistent, or not designed for helpful conversation. Human-curated pairs are essential to teach the model the exact tone, structure, safety rules, and engaging style we want. Something random web pages simply don&#8217;t provide.</p><p>For example, instead of learning from a rambling forum post, the model might see this clean training pair:</p><blockquote><p><em><strong>Q</strong></em><strong>:</strong> What is gravity?<br><em><strong>A</strong></em><strong>:</strong> It&#8217;s a force that pulls things together. More precisely, gravity is the invisible attraction between any two objects that have mass. On Earth, this is what makes things fall down toward the center of the planet and keeps us from floating away into space. Want me to explain how Newton discovered it or how it works in outer space?</p></blockquote><p>The goal is to steer it toward clearer, more helpful responses that are easier for people to interact with. This step doesn&#8217;t change how the model works. It still predicts the next token based on patterns it learned earlier. Fine-tuning simply nudges the model toward behaving more like a helpful assistant and less like a raw text generator.</p><h4>Step 5. Reinforcement Learning from Human Feedback </h4><p>The final step in training is called <strong>Reinforcement Learning from Human Feedback</strong>, or <strong>RLHF</strong>. At this stage, humans review answers generated by the model and rank them. For example, the model might produce two different responses to the same question. A reviewer is asked to choose which answer is better.</p><p>Note that the reviewers are not judging whether the answer is technically correct. Instead, they are following guidelines that reward responses that sound clear, helpful, polite, and well structured.   This teaches the LLM to give responses that humans ranked higher.  Pushing the model toward answers that read smoothly and confidently.</p><p><strong>The LLM becomes extremely good at producing answers that feel polished and authoritative, even when the underlying explanation may be incomplete or wrong.</strong></p><h4>But Which Humans?</h4><p>When people hear &#8220;human feedback,&#8221; it sounds as if the general public, or perhaps subject-matter experts, are shaping the model. In reality, much of this work is <strong><a href="https://time.com/6247678/openai-chatgpt-kenya-workers/">outsourced to low-cost contractors</a></strong> through data-labeling companies in countries such as Kenya, the Philippines, Colombia, Egypt, and India.</p><p>These workers are not engineers or scientists. They are paid raters following strict guidelines that reward answers for being clear, polite, polished, and safe, not for being factually correct or technically insightful. They get paid to feed the &#8220;hot dog&#8221; or &#8220;not hot dog.&#8221; dataset.</p><p>And there you have it: the model learns to optimize for those scoring criteria,  not for accuracy, real expertise, or what the actual public actually wants.</p><div id="youtube2-tWwCK95X6go" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;tWwCK95X6go&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/tWwCK95X6go?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><h3>The Transformer Paper: When Skynet Came Online</h3><p>The modern wave of large language models truly begins in 2017, when a team of Google researchers published a landmark paper called &#8220;<strong><a href="https://papers.nips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf">Attention Is All You Need</a>.</strong>&#8221; That single paper introduced the <strong>Transformer</strong> architecture. The missing piece that finally made the kind of large-scale language training we just walked through actually practical.</p><p>Once the Transformer existed, everything took off.  Every major LLM today, including GPT, Grok, Claude, and Llama, is built on that same Transformer foundation.</p><p>The rest of the recipe fell into place soon after. OpenAI&#8217;s &#8220;<strong><a href="https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf">GPT-1&#8221;</a></strong> paper in 2018 showed that simply scaling next-word prediction on massive amounts of text could produce surprisingly powerful models. Then in 2022, <a href="https://arxiv.org/abs/2203.02155">InstructGPT</a> introduced Reinforcement Learning from Human Feedback, The training step that turns a raw language model into the conversational assistants we interact with today.</p><h3>Coke vs Pepsi</h3><p>So what&#8217;s the real difference between Grok, GPT (OpenAI), and Claude (Anthropic)? While they all follow the same basic training recipe,  the ingredients and seasoning are what make each one taste completely different.</p><p><strong>Data Diet</strong></p><ul><li><p><strong>Grok</strong>: More tightly integrated with X and the live web, which gives it stronger access to current events, slang, memes, and real-time conversation.  </p></li><li><p><strong>GPT</strong>: Mostly trained on curated books, articles, code repositories, and filtered web data. Solid and reliable, but more &#8220;library&#8221; than &#8220;live feed.&#8221;</p></li><li><p><strong>Claude</strong>:  Uses aggressively filtered training data designed to reduce what they deem as harmful or unsafe content.</p></li></ul><p><strong>Alignment &amp; steering (the personality factory)</strong></p><ul><li><p><strong>Grok</strong>: RLHF tuned for more direct answers, humor, and fewer guardrails than most systems.</p></li></ul><ul><li><p><strong>GPT</strong>: Strong RLHF focused on safety and helpfulness. Polite, polished, but quick to refuse or hedge on anything edgy.</p></li><li><p><strong>Claude</strong>:  Uses a method called <a href="https://www.anthropic.com/constitution">Constitutional AI</a>, along with RLHF, which trains the model to critique and revise its own answers using a set of written principles.</p></li></ul><p><strong>Personality &amp; vibe</strong></p><ul><li><p><strong>Grok</strong>: More informal and witty, with fewer guardrails in conversation. Feels like a smart friend who&#8217;ll actually answer the spicy questions.</p></li><li><p><strong>GPT</strong>: Professional, smooth, corporate-friendly. Great all-rounder but can sound scripted or overly careful.</p></li><li><p><strong>Claude</strong>: Thoughtful, ethical, often more reflective or explanatory in tone. Excellent at long-form reasoning but sometimes overly verbose or preachy.</p></li></ul><p><strong>Real-time edge</strong></p><ul><li><p><strong>Grok</strong>:  Integrated with X and live web tools, which helps it stay current.</p></li><li><p><strong>GPT &amp; Claude</strong>:  Rely more on periodic model updates or optional browsing tools.</p></li></ul><p>And yet,  they&#8217;re still eerily similar underneath. A study from the <a href="https://arxiv.org/abs/2510.22954">Allen Institute (arXiv 2510.22954)</a> proves it: even on open-ended, creative questions, all the major models :  GPT, Claude, Grok, Llama,  start giving almost <strong>identical</strong> answers. They literally call this the &#8220;<strong>Artificial Hivemind</strong>.&#8221;</p><p>Different flavors on the surface, same homogenized bullshit at the core.</p><h3>What Is It with Those Damned Em Dashes?</h3><p>If you&#8217;ve spent any time reading AI-generated text, you may have noticed something odd. LLM writing often leans heavily on em dashes. </p><blockquote><p>An <strong>em dash (&#8212;)</strong> is a punctuation mark used to create a pause or break in a sentence. It is longer than a regular hyphen (-) and longer than an en dash (&#8211;).</p></blockquote><p>Sometimes it feels like every other sentence has one. </p><p>And once you notice it, you can&#8217;t unsee it.</p><p>In most twentieth-century print writing, em dashes were used sparingly. Newspapers, technical publications, and academic journals stuck to commas, parentheses, or colons. Style guides like <strong><a href="https://vialogue.wordpress.com/2018/11/05/the-elements-of-style-reflections-notes/">Strunk and White</a></strong> pushed for tight, formal sentences, and editors routinely cut anything that felt too conversational.</p><p>You could still spot them in literary essays, but they were rare in journalism or technical work. On typewriters and early word processors the character wasn&#8217;t even available, so writers just used two hyphens (--) instead.</p><p>Then the internet showed up. Blogs and personal publishing let writers ditch the editors and strict style guides. (Methinks they stopped teaching proper English in school.)  The tone of online writing became more conversational, closer to how people speak rather than  how formal prose traditionally looked on the printed page.  The em dash became perfect for slipping in a quick aside, pivoting to a new thought, or adding emphasis without breaking the sentence. </p><p>As blogging and opinion pieces exploded, people who had never written before started influencing each other &#8212; and the em dash became contagious.</p><p>If you ask AI why it uses them so much, it will tell you it&#8217;s trying to produce text that looks like polished explanatory writing. It will claim it learned this style from sentences that read as &#8220;<strong>authoritative</strong>&#8221; or &#8220;<strong>well written</strong>.&#8221;</p><p> This is a perfect example of the <a href="https://www.atlasobscura.com/articles/is-this-the-first-time-anyone-printed-garbage-in-garbage-out">George Fuechsel&#8217;s</a> old programmer&#8217;s rule: <strong>Garbage In, Garbage Out.</strong></p><h3>Model Collapse and Poisoning</h3><p>So what happens when we keep feeding these systems their own bullshit?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CHut!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CHut!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 424w, https://substackcdn.com/image/fetch/$s_!CHut!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 848w, https://substackcdn.com/image/fetch/$s_!CHut!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 1272w, https://substackcdn.com/image/fetch/$s_!CHut!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CHut!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png" width="500" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a071af7f-472d-460a-a97d-5b1e178d3385_500x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:129996,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190205786?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CHut!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 424w, https://substackcdn.com/image/fetch/$s_!CHut!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 848w, https://substackcdn.com/image/fetch/$s_!CHut!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 1272w, https://substackcdn.com/image/fetch/$s_!CHut!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa071af7f-472d-460a-a97d-5b1e178d3385_500x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">&#8220;What comes out one end, we feed to the other".</figcaption></figure></div><p>The result is <strong><a href="https://www.nature.com/articles/s41586-024-07566-y">model collapse</a></strong>. It hits when new AI models train on text spat out by earlier AI instead of fresh human writing. At first the damage stays subtle. Over generations the models feed on their own output. Errors compound. Simplifications harden. Stylistic quirks echo and amplify. This process is degenerative and irreversible without fresh human data. </p><p>Think of it as informational inbreeding. The models drift away from real human knowledge toward a blurry copy of their past answers. Details fade. Mistakes pile up. The language stays smooth and confident on the surface. Underneath the information thins out and turns less reliable. In short the machine keeps talking but knows less and less.</p><p>The funny thing is that it does not take much bad data to speed this rot along. A tiny amount of poisoned or low quality content can influence even very large models. A recent study, &#8220;<strong><a href="https://arxiv.org/pdf/2510.07192.">Poisoning Attacks on LLMs,</a>&#8221;</strong> showed that <strong>just 250 malicious documents</strong> can plant hidden backdoors in a language model, even when those documents are buried inside training datasets that contain billions of words.</p><p>Model size does not protect against this. What matters is the number of bad examples, not their percentage of the total data. When those examples come from recursive AI output, or from deliberate sabotage, the decay accelerates. A handful of flawed samples can quickly snowball into widespread degradation.</p><h3>Are you just telling me what I want to hear?</h3><p>This is a question I have often pondered about modern AI language models. Too often they seem overly eager to agree, flatter, or validate rather than offer balanced, honest, or corrective feedback.</p><p>Most people love hearing affirmation. Comfort feels good. But it comes at a price. Constant agreement turns the AI into an echo chamber. It reinforces bias. It kills self-reflection. It can even excuse choices that damage relationships or stunt personal growth.</p><p>Recent research suggests this concern is not just a hunch.  A 2025 Stanford led study titled &#8220;<strong><a href="https://arxiv.org/pdf/2510.01395">Sycophantic AI Decreases Prosocial Intentions and Promotes Dependence</a>&#8221;</strong> found that modern language models affirm users far more often than humans do.</p><p>The effect is troubling. When people receive those agreeable responses, they become more convinced they are in the right and less willing to apologize, fix the mess, or even consider the other side&#8217;s view. </p><p>In other words, the more the AI validates them, the more of an asshole they become.</p><p>That matters because we already live in a society where basic politeness often feels like a lost art. Public discourse is fractured, and social media often amplifies those divisions. People are nudged and manipulated into arguments that escalate quickly, sometimes even spilling over into hostility or violence. In that environment, a machine that constantly tells us we are right does not calm things down. It only adds fuel to the fire.</p><h3>Don&#8217;t Throw Out the Baby With the Bathwater</h3><p>Every advance in technology comes with unintended consequences. </p><p>Like most tools, large language models are useful when you understand what they are good at and what they are not. </p><p>They excel at summarizing information, exploring ideas, translating concepts, generating drafts, and helping you think through problems. They sift through enormous text and surface patterns faster than any human could.</p><p>The mistake is treating them like an authority instead of a tool. An LLM is not a database of verified facts and it certainly is not an expert. It is a machine trained to produce text that resembles the kinds of answers humans tend to write.</p><p>Sometimes that works remarkably well. Sometimes it just produces bullshit that only sounds convincing.</p><p>The trick is learning the difference.</p><p>Use AI the way you would use a fast but unreliable research assistant. Let it help you explore ideas, organize thoughts, and point you toward things worth investigating. Then do what humans are supposed to be good at.</p><ul><li><p>Always check the facts yourself.</p></li><li><p>Test the assumptions.</p></li><li><p>Use your own judgment.</p></li></ul><p>Because in the end, the responsibility for thinking still belongs to us. </p><p>For now&#8230; at least.</p><p></p><blockquote><p>Quick follow-up on the article:</p><p>I intentionally kept the explanation simple. I describe LLMs as &#8220;token prediction&#8221; or &#8220;next-word guessing.&#8221; At the lowest mechanical level that&#8217;s exactly what they do. They generate text one token at a time by predicting what comes next. I wanted that core idea to land for readers who aren&#8217;t data scientists.</p><p>I should also add that the LLM is not guessing blindly. While generating each token, it looks at your prompt and the entire conversation so far. That context lets it keep a coherent thread across several sentences or paragraphs.</p><p>As models grow larger and see more training data, they begin showing what researchers call <strong><a href="https://cset.georgetown.edu/article/emergent-abilities-in-large-language-models-an-explainer/?utm_source=chatgpt.com">emergent behavior</a></strong>. They can summarize documents, follow complex prompts, and produce responses that look a lot like step-by-step reasoning. But under the hood the mechanism has not changed.  It&#8217;s still predicting the next token  but adding in the context of the conversation.</p></blockquote><div><hr></div><p>If you care about how things are made and and how they work under the hood, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>.  Sometimes that means digging into the gritty details of why AI spits out such BS, or how a few poisoned documents can really screw with Skynet.</p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Here comes the Sun]]></title><description><![CDATA[How My Chicken Coop Controller Calculates Sunrise and Sunset]]></description><link>https://www.vinthewrench.com/p/here-comes-the-sun</link><guid isPermaLink="false">https://www.vinthewrench.com/p/here-comes-the-sun</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Fri, 06 Mar 2026 22:43:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!3aWP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>After I published <em>&#8220;<a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">A Better Automatic Chicken Coop Door,</a>&#8221;</em> it occurred to me that I could do a better job explaining the math behind how sunrise and sunset can be calculated from a location and date.</p><p>Remember, the coop controller runs completely offline. There&#8217;s no network connection, no cloud service, and no outside API calls. The firmware computes the solar events locally using standard NOAA-style astronomical equations.</p><p>Below is the simplified sequence of calculations used by the firmware, explained in plain English with the actual equations shown and every number plugged in so someone with high school math (<a href="https://www.mathopenref.com/trigsummary.html">trigonometry</a> and a calculator) can follow along.</p><h4>Example Setup and Constants</h4><p>For this example, we&#8217;ll use the following:</p><ul><li><p>Location: Little Rock, Arkansas (USA)</p><ul><li><p>Latitude: 34.75&#176; N</p></li><li><p>Longitude: 92.29&#176; W</p></li></ul></li><li><p>Date: March 6, 2026</p></li></ul><p>To compute sunrise and sunset, the firmware only needs three key pieces of information:</p><ul><li><p><strong>Lat</strong> = Latitude (how far north you are) = 34.75&#176;</p></li><li><p><strong>SolarDec</strong> = solar declination (how far north or south the sun is that day)</p></li><li><p><strong>HA</strong> = hour angle (how many degrees Earth must spin before sun reaches your horizon)</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3aWP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3aWP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 424w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 848w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 1272w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3aWP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png" width="500" height="320" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155605,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190149608?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3aWP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 424w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 848w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 1272w, https://substackcdn.com/image/fetch/$s_!3aWP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ee44d1e-bc5a-465e-90d9-8b4cb8721d3e_500x320.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Solar geometry used to calculate sunrise and sunset from latitude and date.</figcaption></figure></div><h4>1. Determine the Day of the Year</h4><p>Everything starts with one simple number: what day of the year is it?</p><p>For <strong>March 6, 2026:</strong></p><pre><code><code>DoY = 65</code></code></pre><p>(January has 31 days + February has 28 days in 2026 + 6 days = 65.)</p><h4>2. Estimate the Sun&#8217;s Position (Solar Declination)</h4><p>The controller calculates how far north or south the sun is using this formula:</p><pre><code><code>SolarDec &#8776; &#8722;23.44&#176; &#215; sin((360&#176; / 365.25) &#215; (DoY &#8722; 81))</code></code></pre><p>Plugging in DoY = 65:</p><pre><code><code>SolarDec &#8776; &#8722;23.44 &#215; sin((360 / 365.25) &#215; (65 &#8722; 81))
SolarDec &#8776; &#8722;23.44 &#215; sin(0.9856 &#215; (&#8722;16))
SolarDec &#8776; &#8722;23.44 &#215; sin(&#8722;15.77&#176;)</code></code></pre><p>sin(&#8722;15.77&#176;) &#8776; &#8722;0.272</p><pre><code><code>SolarDec &#8776; &#8722;23.44 &#215; (&#8722;0.272) &#8776; +6.37&#176;</code></code></pre><p>Rounded: <strong>SolarDec &#8776; +6.4&#176;</strong></p><p>This means the sun is slightly north of the equator (spring is coming and days are getting longer).</p><h4>3. Calculate the Hour Angle</h4><p>This is the most important step. The controller uses this equation:</p><pre><code><code>cos(HA) = [sin(h0) &#8722; sin(Lat) &#215; sin(SolarDec)] / [cos(Lat) &#215; cos(SolarDec)]</code></code></pre><p>Where:</p><ul><li><p>h0 = &#8722;0.833&#176; (small correction for atmospheric refraction and the apparent size of the sun)</p></li><li><p>Lat = 34.75&#176;</p></li><li><p>SolarDec = +6.37&#176;</p></li></ul><p>Plugging in the values (using a calculator for<a href="https://www.mathopenref.com/trigsummary.html"> sin and cos</a>):</p><p>Numerator:<br>sin(&#8722;0.833&#176;) &#8722; sin(Lat) &#215; sin(SolarDec)<br>&#8776; &#8722;0.0145 &#8722; (0.570 &#215; 0.111)<br>&#8776; &#8722;0.0145 &#8722; 0.0633<br>&#8776; &#8722;0.0778</p><p>Denominator:<br>cos(Lat) &#215; cos(SolarDec)<br>&#8776; 0.821 &#215; 0.994<br>&#8776; 0.816</p><pre><code><code>cos(HA) &#8776; &#8722;0.0778 / 0.816 &#8776; &#8722;0.095</code></code></pre><p>Now take the <a href="https://www.mathopenref.com/arccos.html">inverse cosine</a>:</p><pre><code><code>HA = arccos(&#8722;0.095) &#8776; 95.5&#176;</code></code></pre><h4>4. Convert Hour Angle to Time</h4><p>Earth spins 15&#176; every hour, so we convert the angle to hours:</p><pre><code><code>Hours from noon = HA / 15 &#8776; 95.5 / 15 &#8776; 6.37 hours</code></code></pre><pre><code><code>Sunrise &#8776; 12:00 &#8722; 6.37 hours &#8776; 5:38 AM
Sunset  &#8776; 12:00 + 6.37 hours &#8776; 6:22 PM</code></code></pre><h4>5. Apply Astronomical Corrections</h4><p>The quick estimate is close, but the controller now runs the full NOAA equations to fix two real-world effects.</p><p><strong>a. Equation of Time (how much the sun appears &#8216;fast&#8217; or &#8216;slow&#8217; because Earth&#8217;s orbit is not perfectly circular)</strong></p><p>The controller calculates a fractional year angle &#947;:</p><pre><code><code>&#947; = (2 &#215; &#960; / 365) &#215; (DoY &#8722; 1)</code></code></pre><p>For DoY = 65:</p><pre><code><code>&#947; &#8776; (6.2832 / 365) &#215; 64 &#8776; 1.101 radians</code></code></pre><p>It then plugs &#947; into the full NOAA formula (a combination of sin and cos terms). For March 6, 2026 this gives:</p><pre><code><code>eqtime &#8776; &#8722;11.23 minutes</code></code></pre><p>(The sun is running about 11 minutes &#8220;slow&#8221; today.)</p><p><strong>b. Longitude correction (because Little Rock is not exactly on the center of the Central Time zone)</strong></p><p>Little Rock longitude = 92.29&#176; West<br>Central Time zone meridian = 90&#176; West</p><p>Correction = 4 minutes per degree &#215; (92.29 &#8722; 90) = +9.16 minutes</p><p>The controller now uses the refined hour angle HA together with these corrections in the main NOAA sunrise formula (in minutes past midnight, Universal Time):</p><pre><code><code>sunrise_UT (minutes) = 720 &#8722; 4 &#215; (longitude + HA) &#8722; eqtime</code></code></pre><p>Plugging in the values (longitude = &#8722;92.29&#176;, HA = 95.5&#176;, eqtime = &#8722;11.23):</p><pre><code><code>4 &#215; (&#8722;92.29 + 95.5) = 4 &#215; 3.21 = 12.84
sunrise_UT = 720 &#8722; 12.84 &#8722; (&#8722;11.23) = 720 &#8722; 12.84 + 11.23 = 718.39 minutes</code></code></pre><p>718.39 minutes &#8776; 11:58 UT</p><p>The calculation above uses a simplified hour angle so it&#8217;s easier to see how the longitude correction and Equation of Time affect the result.</p><p>In the actual firmware (<a href="https://github.com/vinthewrench/chickencoop-3/blob/main/firmware/src/solar.cpp">solar.cpp</a>), the controller runs the full NOAA solar algorithm. This produces slightly more accurate values for both solar declination and the hour angle. Because of that, the final Universal Time ends up a few minutes different from our simplified example, yielding the precise sunrise and sunset times the coop controller actually uses.</p><p>The same calculation is performed for sunset as well, with the hour angle taken on the opposite side of solar noon.</p><h4>6. Convert Universal Time to Local Time</h4><p>Finally, the controller simply subtracts the Central Standard Time offset:</p><pre><code><code>Local time = UT &#8722; 6 hours</code></code></pre><p>So the precise Universal Time sunrise (after all refinements) converts to the local clock time shown below.</p><p>Civil dawn and civil dusk are calculated using the same NOAA solar algorithm used for sunrise and sunset. The only difference is the zenith angle used in the hour-angle calculation: official sunrise and sunset use <strong>90.833&#176;</strong>, which represents the sun at the horizon with refraction and solar-disk correction, while civil dawn and dusk use <strong>96.0&#176;</strong>, corresponding to the sun being <strong>6&#176; below the horizon</strong>. </p><p>Everything else in the calculation remains the same, solar declination, equation of time, and longitude correction. So the result is simply an earlier morning event and a later evening event. </p><h4>Final Results for March 6, 2026 (Little Rock)</h4><p>After running all the math, here are the accurate times the controller uses:</p><pre><code><code>Civil Dawn   : 06:07 (6:07 AM)
Sunrise      : 06:32 (6:32 AM)

Sunset       : 18:09 (6:09 PM)
Civil Dusk   : 18:34 (6:34 PM)</code></code></pre><p>These match published solar tables within about one minute.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!DqaO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DqaO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 424w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 848w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 1272w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DqaO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png" width="450" height="241" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:241,&quot;width&quot;:450,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:180540,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/190149608?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!DqaO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 424w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 848w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 1272w, https://substackcdn.com/image/fetch/$s_!DqaO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F06fc620c-6bfc-4859-850b-21371514e9a0_450x241.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Solar math: still simpler than dialing a Stargate.</figcaption></figure></div><p>So that&#8217;s the math behind the coop door. In the <a href="https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door">original article</a> I glossed over most of this, and afterward it felt like I&#8217;d skipped the best part. In reality it only takes a little trigonometry, a date, and the coop&#8217;s latitude to predict when the sun will appear over the horizon. </p><p>In the end, the chickens don&#8217;t know anything about solar declination or hour angles. They&#8217;re basically dinosaur pigs. They eat everything, including each other (if they could), and they&#8217;re perfectly happy as long as the door opens right on schedule every morning.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>.  Sometimes that means solar math and sometimes it&#8217;s just me pontificating about how I screwed up a design. </p><p>Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[A Better Automatic Chicken Coop Door]]></title><description><![CDATA[From Backyard Chickens to 100-Bird Pasture Rotation: Why I Scrapped Two Earlier Controllers and Built a Purpose-Built Ultra-Low-Power Coop Door from Scratch]]></description><link>https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door</link><guid isPermaLink="false">https://www.vinthewrench.com/p/a-better-automatic-chicken-coop-door</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Thu, 05 Mar 2026 22:31:26 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!y4UY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F24506ddb-8b89-486c-9f37-ba162b25ab4c_600x474.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Project Overview</strong></p><ul><li><p>12 V battery-powered chicken coop door controller with optional solar charging.</p></li><li><p>Opens and closes the coop door using configurable sunrise and sunset offsets.</p></li><li><p>Gravity-actuated vertical door with an anti-predator locking mechanism.</p></li><li><p>Custom ATmega1284P controller board, about $50 in parts.</p></li><li><p>Ultra-low-power design with deep sleep current in the microamp range.</p></li><li><p>Runs without Wi-Fi, cloud services, or internet access.</p></li><li><p>Complete firmware, schematics, and PCB layout available on GitHub.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ajU7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ajU7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ajU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg" width="700" height="559" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:559,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:170984,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ajU7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ajU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcac24635-b582-431a-b0b2-cd87916b6861_700x559.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Not My First Rodeo</h4><p>We started keeping chickens when I lived in Oregon. The fresh eggs were nice, but what was nicer was knowing where our food came from. It wasn&#8217;t some grand homesteading plan. It was simply a small, practical step toward owning one more piece of our lives. </p><p>I think at tops we only hosted about a dozen birds.</p><p>And as it turned out, our effort to put <strong><a href="https://www.vinthewrench.com/p/distance-from-disorder">distance from disorder</a></strong>,  grew into something much bigger.  We now run <strong><a href="https://stellaporta.us/">Stella Porta</a></strong>, a small regenerative farm built around naturally grown practices.  What began with a few backyard chickens has turned into something more serious, with real production goals, real schedules, and real consequences when things fail.</p><p>When we built our first coop, I immediately decided the door needed to be automated. I have zero interest in babysitting chickens. A daily check and egg collection is fine but having the door dictate my schedule isn&#8217;t.  </p><p>Rather than buy automated door, I home brewed my own.</p><p>The first version of the controller board used an <a href="https://www.vinthewrench.com/p/chicken-coop-automation-using-the-arduino-platform-4c572d9a940a">Arduino variant</a>,  driving relay outputs for the door actuator. Although it was fairly simple, it included integrated battery backup to keep the door operating through power failures, and Wi-Fi access that let me adjust parameters over the network.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tqsE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tqsE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 424w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 848w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 1272w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tqsE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png" width="300" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:300,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:237835,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tqsE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 424w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 848w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 1272w, https://substackcdn.com/image/fetch/$s_!tqsE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b3a8f30-4b8f-496b-96d4-6880da1b75a4_300x400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The door mechanism and actuator held up well through ice, mud, and chicken dust</figcaption></figure></div><p>Around 2022, I revisited the system, moved it to a <a href="https://www.vinthewrench.com/p/chicken-coop-automation-revisited">Raspberry Pi</a> and wrote an accompanying iPhone app. The new controller also scheduled supplemental lighting to encourage egg production during Oregon&#8217;s darker and shorter winter.</p><p>Naturally I had the inevitable clashes with bears and raccoons seeking a yummy chicken dinner.  Well, to be perfectly honest, <em>they had clashes with my rifle</em>.   I wasn&#8217;t about to let predators dictating my schedule either, so I eventually added an electric-fence relay to the door scheduling system.</p><p>Both the Raspberry Pi and Arduino versions of the controller were connected to a coop in a fixed, fenced area, with a stationary nesting box that remained within Wi-Fi range. They only needed limited battery backup because the system was still mostly AC-powered and not truly a standalone design.</p><h4>Welcome to Arkansas.</h4><p>Moving to Arkansas changed everything. We&#8217;re now set up for more than a hundred birds, running a mobile coop integrated into our cattle and sheep rotational grazing. The coop moves with the pasture. The birds roam, eat bugs, and do chicken things all day, then come back to the nesting boxes to brood and roost at night.</p><p>The environment is different too.  There is more sunlight here and so the need for artificial light to simulate day extension is no longer necessary.  Bears aren&#8217;t the primary threat either. Coyotes are, and that problem is handled mostly the old way, with good dogs doing their job.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OdrN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OdrN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 424w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 848w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 1272w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OdrN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif" width="300" height="261" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a9a9708d-64ae-44f4-b74f-e575ee7a320a.tif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:261,&quot;width&quot;:300,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:316630,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/tiff&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OdrN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 424w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 848w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 1272w, https://substackcdn.com/image/fetch/$s_!OdrN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa9a9708d-64ae-44f4-b74f-e575ee7a320a.tif 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Predators aren&#8217;t stupid</figcaption></figure></div><p>Mechanically, I kept what works and hardened what needed hardening. The gravity-hung door stays because it&#8217;s safe and reliable. But just to be safe, I added a locking bar so a predator can&#8217;t lift the door once it&#8217;s closed.</p><p>Since the pasture rotates, the coop  is often well out of reach of AC power, and so power conservation a priority. Solar can top it off, but we won&#8217;t depend on it every day. It needs to survive cloudy stretches, short winter days, rain, snow, whatever Arkansas throws at it.</p><p>Chickens are simple: they get up at dawn and roost at dusk. They just need a door that follows that rhythm.  So the controller doesn&#8217;t need to be complicated, it is simply a box that tells a few devices what to do at specific times, then goes back to sleep.</p><p>It is also out of Wi-Fi reach,  and it&#8217;s not worth the luxury of wasting power on it. Any setup and schedule programming can be done in the field. We&#8217;re still out there each day collecting eggs, refilling water, and checking on the girls. But once the schedule is configured, I shouldn&#8217;t have to mess with it. It should just run on its own.</p><blockquote><p>I have seen some very elaborate coop automation projects on the net. One example is <a href="https://smartcoop.tech/">Dave Duncanson&#8217;s SmartCoop</a> system in Australia, He uses a Raspberry Pi along with sensors, networking, and extensive monitoring. That system is designed for a fixed backyard coop with reliable power and Wi-Fi access. </p><p>My goals were much simpler. I just needed a small controller that opens the door at dawn, closes and locks it at dusk, then goes back to sleep while running from a battery in the middle of a rotating pasture. </p><p>Different constraints lead to very different designs.</p></blockquote><h4>Scheduling the Door</h4><p>So how do you decide when it&#8217;s time to open and close the door? I have seen it done a couple of ways.</p><p>One option is a <strong>simple time clock</strong>. But that means constantly readjusting for the solar cycle as day length changes through the year.</p><p>Another approach is a <strong>light sensor</strong>. The problem is that light sensors lie. A light sensor doesn&#8217;t know what sunrise or sunset is. It only knows how bright it happens to be at that moment, right where it&#8217;s mounted. Clouds can turn midday into dusk. Shadows move. Snow reflects light in ways that break thresholds. Headlights and yard lights create false sunrises. Reflections off wet ground or metal siding spike readings at exactly the wrong time.</p><p>In a mobile coop, those problems get worse.  As the coop moves, its orientation changes. The horizon changes. Mounting angles change. Even a perfectly calibrated sensor becomes unreliable the moment the environment shifts.</p><p>On the other hand, sunrise and sunset are predictable events. Given a location and a date, you can accurately and repeatably calculate the time they will occur. If you base your door schedule as a simple offset from those events and it will stay aligned with the season. It won&#8217;t drift, it won&#8217;t be fooled by clouds or shadows, and it won&#8217;t need constant adjustment.</p><h4>Here comes the Sun</h4><p>Computing sunrise and sunset from location and date isn&#8217;t hard.  I don&#8217;t know why people overthink this. You only need a few ingredients: latitude, longitude, a reliable (battery-backed) real-time clock, and a little basic solar math. </p><p>Latitude determines how high the sun climbs and how long the day lasts, while longitude shifts the time of solar noon relative to your clock. </p><p>None of this is new-fangled science.  The core ideas go back to the <a href="https://www.britannica.com/science/astronomy/History-of-astronomy">Babylonian</a> and <a href="https://www.britannica.com/science/astronomy/Ancient-Greece">Greek</a> astronomers, notably the work of <a href="https://www.britannica.com/biography/Ptolemy">Ptolemy</a> in the 2nd century AD. Major refinements came in the 1600s and 1700s, as <a href="https://www.britannica.com/story/understanding-keplers-laws-of-planetary-motion">Kepler</a>  sussed out the laws of orbital motion.   Later refinements added precision by accounting for Earth&#8217;s axial tilt. By the 18th and 19th centuries, these calculations were <a href="https://gml.noaa.gov/grad/solcalc/calcdetails.html">standard in nautical almanacs</a>.  Sailors could predict sunrise and sunset reliably anywhere on Earth.</p><blockquote><p><strong>Pro tip</strong>: This math has been spot-on for centuries on a round Earth. Flat Earth versions? Not so much.</p></blockquote><p>So here&#8217;s how it works. </p><p>Earth rotates once every 24 hours and orbits the Sun once a year. We know the rate of that rotation, and we can model how axial tilt and orbital geometry change the Sun&#8217;s apparent path day by day. Using the trigonometry I describe below, we can write code that calculates the exact minute the Sun crosses the horizon for a given date and location.</p><p>We also factor in a <a href="https://edwilliams.org/sunrise_sunset_algorithm.htm">standard horizon angle of about 0.833 degrees below the true horizon</a> to account for atmospheric refraction, which bends light slightly, and the upper limb of the Sun&#8217;s visible disk, which takes time to fully rise or set. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oejE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oejE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!oejE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!oejE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!oejE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oejE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png" width="800" height="533" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:533,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:933621,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!oejE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!oejE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!oejE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!oejE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5407ecc-9cb3-4daa-9a68-6023fc31cc45_800x533.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you&#8217;re curious (or building something similar), here&#8217;s the basic math <a href="https://github.com/vinthewrench/chickencoop-3/blob/main/firmware/src/solar.cpp">my code runs</a>.</p><ol><li><p><strong>Solar declination (&#948;)</strong> - the sun&#8217;s north-south position: <br>&#948; &#8776; 23.45&#176; &#215; sin( (360&#176; / 365) &#215; (day_of_year + 284) ) <br>(Or a common variant: &#948; &#8776; -23.44&#176; &#215; sin( (360&#176; / 365.25) &#215; (day_of_year - 81) ))</p></li><li><p><strong>Hour angle at sunrise/sunset (&#969;_s)</strong>: <br>cos(&#969;_s) = [sin(-0.833&#176;) - sin(&#966;) &#215; sin(&#948;)] / [cos(&#966;) &#215; cos(&#948;)] <br>where &#966; = latitude, &#948; = declination, -0.833&#176; = horizon correction (refraction + sun&#8217;s disk). <br>Then &#969;_s = acos( that value )</p></li><li><p><strong>Times from local noon</strong>: <br>Sunrise &#8776; 12 - (&#969;_s / 15) hours <br>Sunset &#8776; 12 + (&#969;_s / 15) hours (Earth rotates 15&#176; per hour.)</p></li></ol><h4>Scheduling and State Reduction</h4><p>Calculating sunrise and sunset turns out to be the easy part of coop automation. The hard part is keeping the system in the correct state when things inevitably go wrong.</p><p>A lot of automation systems treat schedules as a series of triggers. At 6:51 AM, fire an &#8220;open&#8221; event. At 6:03 PM, fire a &#8220;close&#8221; event. That sounds simple until the power fails, the controller reboots, or someone overrides the system manually. Now the controller has to remember what already ran, what did not, and whether it should try to &#8220;catch up.&#8221; Miss one trigger and the system is out of sync.</p><p>In a lighting system that might mean a lamp stays on too long. In a chicken coop it can mean the door stays open all night. Screw this up and you get dead chickens.</p><p>My system takes a different approach.</p><p>The schedule does not fire events. Instead, it defines the desired state of each device at every minute of the day. When the controller wakes up or needs to make a decision, it asks a simple question:</p><p><strong>At this moment, what state should each device be in?</strong></p><p>For example, on a given day the door schedule might look like this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6cf12b7e-1735-48fc-9c7e-d0c445a43963&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Solar      Rise        Set
Actual     06:51 AM    06:03 PM
Civil      06:26 AM    06:29 PM

Events:
06:51  OPEN    Sunrise +0
18:18  CLOSED  Sunset +15</code></pre></div><p>That&#8217;s it. Two declarative statements: the door should be open after sunrise, and it should close 15 minutes after sunset.</p><p>The reducer algorithm looks at the current time and determines which of those two events governs the door right now.</p><p>Sounds simple enough. But what happens when we add human interaction?</p><p>Say the door is scheduled to open at sunrise and close at sunset. At 3:00 PM, the farmer <strong>presses the button and closes the door</strong>. </p><p>The door state machine does exactly what it should. It unlocks, drives closed, waits for settle, and locks. Everything works.</p><p>Now the scheduler algorithm runs again one minute later. It reduces the schedule and sees that the governing event for the door is still the sunrise &#8220;open&#8221; event. According to the schedule, the door should be open.</p><p>The scheduler will immediately command the door to open again. </p><p><strong>The system is technically correct, but practically wrong.</strong></p><p>So how do we fix it?</p><p>We solve it by recording the <strong>timestamp of the last manual action</strong>. When the scheduler attempts to apply a scheduled state, it passes along the timestamp of the governing scheduled event. If that event occurred <strong>before</strong> the manual action, it is ignored.</p><p>In other words, the schedule cannot override a newer human action. It must wait until the next scheduled phase, such as sunset, before it regains control.</p><p>We also run the algorithm clock in UTC, so changes in Daylight Saving Time never shifts events, never touches the solar math, and the only thing that ever changes is how the time is displayed to a human.</p><h4>The Door Electronics</h4><p>Now that we know <em>when</em> to open the door,  <em>how</em> are we going to do it? </p><p>While horizontal sliding doors look simple and convenient on paper.  They have some drawbacks.</p><p>We used an <a href="https://www.omlet.us/smart-automatic-chicken-coop-door-opener/">Omlet automatic door</a> on our temporary coop with just six birds because it was expedient and installed quickly.  The design included a safety switch on one side to prevent the door from closing on a chicken, which is a sensible feature.</p><p>But then we had an ice storm and the door froze solid.</p><p>I had to hit it with a heat gun to thaw the mechanism so the birds could get out.  I disconnected it and propped a brick and plywood in its place for the week.  </p><p>From what I could see, the combination of gears and open slide tracks allowed dust, moisture, and ice to work their way into the mechanism and freeze everything in place.</p><p>That experience pushed me toward a different design.</p><p>Instead of sliding sideways, my coop doors open vertically. The door is lifted by retracting a cable with an actuator, and gravity closes it again when the actuator extends.</p><p>The door itself rides on a <a href="https://www.homedepot.com/p/SKYSHALO-Linear-Guide-Rail-Set-SBR16-1000mm-2-Piece-39-4-in-1000-mm-SBR16-Guide-Rails-and-4-Piece-SBR16UU-Slide-Blocks-ZXDGSBR16MM10H508V0-1021/333366100">pair of aluminum guide rails with slide blocks I picked up at Home Depot</a>. These are linear motion components commonly used in CNC machines, automated equipment, and even some shop-built router or saw sleds where something needs to move straight while staying aligned. In this case they simply keep the door traveling smoothly up and down without twisting or binding. I mounted the sliding mechanism inside the coop so there are no exposed tracks to clog or freeze.  </p><p>To move the door I used a Progressive Automations PA-14 linear push-pull actuator (now sold as model <a href="https://www.progressiveautomations.com/products/pa-01?variant=43077060067508.">PA-01-12-56-N-12VDC</a>).  It has a stainless steel stroke rod and an IP65-rated aluminum alloy housing, with no exposed spinning parts to gum up in chicken dust or freeze solid during icy Arkansas winter nights, where a stuck door can mean dead birds.  The unit also includes built-in limit switches, so it automatically stops at the ends of its travel without requiring additional sensors.</p><p>If you want the nitty-gritty on why I chose this device and how to electrically drive it, see my article &#8220;<a href="https://www.vinthewrench.com/p/the-humble-actuator">The Humble Actuator</a>.&#8221;</p><p>Working backwards from the actuator, the motor is driven electrically using a <a href="https://www.st.com/en/automotive-analog-and-power/vnh7100bas.html">VNH7100BAS</a> H-bridge.  This chip can move real current, up to 15 A continuous. Which is more than enough for the actuator but also means it can generate real heat under load. The data-sheet is clear about this and recommends providing substantial copper area on the PCB for thermal management.</p><h4>The Locking Mechanism</h4><p>A gravity-hung door prevents crushing, but it does nothing to stop something from pushing upward from outside the coop. A determined raccoon or coyote will pull, pry, and test weaknesses for hours.</p><p>So the door also needs a way to lock.</p><p>I didn&#8217;t have to look far for a solution. My automated garage door had already solved this exact problem. When it closes, a steel deadbolt slides into the track, physically preventing the door from being lifted.</p><p>That raised an obvious question: what&#8217;s actually inside that lock? I opened up a <a href="https://www.amazon.com/dp/B074L9JQQR">LiftMaster 841LM</a> and, to my surprise, found that the mechanism inside is fundamentally the same as the automotive door lock actuators you can buy for <a href="https://www.amazon.com/dp/B00CZBQCR2?th=1">less than five dollars</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hAvR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hAvR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hAvR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg" width="600" height="326" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:326,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:65618,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hAvR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hAvR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95991b80-573d-4420-9892-78ce94a1eeff_600x326.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The LiftMaster 841LM garage door latch</figcaption></figure></div><p>Inside, the <a href="https://www.scribd.com/document/950676503/How-Power-Door-Locks-Work-HowStuffWorks?utm_source=chatgpt.com">mechanism is simple</a>. A small DC motor drives a set of reduction gears that move a sliding linkage back and forth, pushing or pulling a steel bolt into position. When the bolt extends into the strike, any upward force on the door is transferred directly into the frame, not through the motor. Once engaged, the load is carried entirely by the latch. The motor and gear train are no longer holding the door up; the steel latch is.</p><p>The motor itself is just a brushed DC motor. Apply current one way and the bolt extends. Reverse the polarity and it retracts. There are no position sensors or smart electronics inside, just a motor and gears. Controlling it simply requires reversing the motor direction, which makes it a perfect job for the same kind of   VNH7100BAS H-bridge used to drive the actuator.</p><h4>Door Motion and Lock State Machine</h4><p>On the software side, the actuator and door lock are driven by <a href="https://github.com/vinthewrench/chickencoop-3/blob/main/firmware/src/devices/door_state_machine.cpp">a state machine that manages the motion</a>.   </p><p>Before any door movement command is issued, the controller first runs a <strong>latch-release sequence</strong>. This prevents the actuator from jamming if someone has manually messed with the latch.  </p><p>The door cycle then proceeds as follows:</p><ul><li><p>The controller releases the latch.</p></li><li><p>The H-bridge is enabled and the actuator begins moving the door.</p></li><li><p>When the configured travel time expires, the H-bridge is disabled and the motor stops.</p></li><li><p>The controller waits for a short settling delay.</p></li></ul><p>During a closing cycle this delay allows gravity and the mechanism to settle before the lock engages.</p><ul><li><p> After the delay, the controller sends a <strong>lock pulse</strong> to secure the door.</p></li></ul><p>This sequence prevents mechanical shock, reduces stress on the latch, and ensures the door is fully seated before it is locked.</p><p>This state machine also provides visual feedback by driving a red/green door button LED.</p><h4>Home brewing the Hardware</h4><p>Everything up to this point has been logic: schedules, reducers, state machines, sunrise math and motor control.  Now it&#8217;s time to dig into the electronics that make it all work.</p><p>My original coop controller used off-the-shelf parts bolted together, which made it bigger, more complex, and more expensive than necessary.</p><p>But at this point, I knew exactly what the system required:  the door logic worked, the actuators were dependable, and the scheduling code was solid. There was no good reason to keep using general-purpose development boards.</p><p>Since I&#8217;ve designed custom electronics and controller boards before, including the <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part">irrigation controller running on the farm</a>, I decided to build a small, purpose-built coop controller board.  I wanted a microcontroller that could:</p><ul><li><p>Run reliably using its built-in Real-Time Clock (RTC)</p></li><li><p>Enter a true deep power-down mode with current in the microamp range</p></li><li><p>Wake cleanly from an RTC interrupt or a button press</p></li><li><p>Drive a couple of H-bridges and some LEDs</p></li><li><p>Store configuration data in non-volatile memory</p></li><li><p>Provide a simple serial port for setup and configuration</p></li><li><p>Try to keep the parts count under $50.</p></li></ul><p>I also wanted something that was straightforward to <a href="https://www.vinthewrench.com/p/how-did-you-make-that">develop with modern tools</a>. Plain C or C++. The <a href="https://gcc.gnu.org/wiki/avr-gcc">avr-gcc toolchain</a>. Explicit Makefiles. No hidden build systems, no IDE magic, no framework layers doing things behind my back.</p><h4>Don&#8217;t Vibe Design</h4><p>Before I go on, I should confess something. I tried to be like the cool kids and take the AI shortcut.  Result, I got burned.  I asked both Grok and GPT for advice on choosing the proper MCU and RTC, and both recommendations turned out to be the wrong choice.  It suggested the <strong>ATmega32U4</strong> as the MCU and the <strong>PCF8523T</strong> as the RTC.  </p><p>The ATmega32U4 turned out to be a major headache during development. ISP programming would fail intermittently, and troubleshooting revealed that the programmer could back-power the chip through the SPI pins (<a href="https://www.vinthewrench.com/p/avrdude-the-debugging-tool-you-didnt">MISO/MOSI/SCK</a>) especially if I forgot to turn on the MCU&#8217;s power supply during debugging. </p><p>Current could flow through the MCU&#8217;s internal ESD protection diodes, which can stress or degrade (blow out)  the chips I/O drivers, particularly the MISO pin, leading to unreliable detection and programming.</p><p>The ATmega32U4 was primarily designed for USB-native applications where the chip is almost always powered whenever a programmer is connected via USB. In standalone, battery-powered, or intermittently powered embedded designs, this back-powering issue becomes a chip killer.</p><p>By contrast, the <strong>ATmega1284P</strong> is a simpler, traditional AVR with fewer internal subsystems. In practice it behaves much more predictably when programmed over ISP in battery-powered or embedded systems.</p><p>The <strong><a href="https://www.nxp.com/docs/en/data-sheet/PCF8523.pdf">PCF8523T</a></strong> also turned out to be the wrong choice for this project. On paper it looks fine. In practice it is was a real ball buster.</p><p>The main problem is that it <strong>depends on an external 32.768 kHz watch crystal</strong>. That means crystal selection, load capacitors, PCB layout, and soldering quality all become critical to stable operation. Timekeeping depends on a fragile tuning-fork crystal. In a stationary indoor product that&#8217;s manageable, but this controller lives in a coop that gets dragged around the pasture by a tractor. Vibration and shock are routine, and I didn&#8217;t want the system&#8217;s timekeeping relying on a mechanically sensitive component.</p><p>I also ran into <strong>power-transition edge cases</strong>. During brownouts the MCU could reset while the RTC continued running from VBAT. A large bulk capacitor on the logic rail stretched the MCU&#8217;s brownout window just enough to create awkward reset timing, which meant extra software was needed to keep the system synchronized.</p><p>None of these issues make the <strong>PCF8523</strong> unusable. It may simply be that I didn&#8217;t design around it properly. And I bet that in a well-controlled environment it likely works fine.  But it demands more care in oscillator layout, power sequencing, and mechanical protection than I want in something that lives outside as farm equipment.</p><p>In a tractor-towed coop running from a 12-volt battery, robustness matters more than saving a handful of microamps. So I wrestled back control of the design and went with the <strong><a href="https://www.analog.com/en/products/ds3231m.html">DS3231M</a></strong>. </p><p>The DS3231M integrates its own resonator and eliminates the need for an external watch crystal. That removes the layout sensitivity and mechanical fragility that come with tuning-fork crystals, and it simplifies the design considerably.</p><p>It also includes temperature compensation and an integrated resonator, so the clock maintains good accuracy without external crystal tuning or calibration. Easy-peasy.</p><h4>A Few More Hardware Details</h4><p>As mentioned above, I used two <strong>VNH7100BAS H-bridges</strong> to drive the actuator and the locking device. I added <strong>1 k&#937; series resistors</strong> between the MCU outputs and the driver inputs, along with <strong>100 k&#937; pull-down resistors</strong> on the control lines.</p><p>The series resistors limit current and protect the MCU pins from transients or accidental contention during power-up or reset. The pull-down resistors ensure the H-bridge inputs default to a known low state if the MCU pins are high-impedance during reset or startup. Together they prevent the motor driver from briefly enabling or changing direction before the firmware takes control. </p><p>I tied <strong>SEL0</strong> to GND so a low signal on the <strong>PWM pin</strong> puts the VNH7100BAS into standby, letting the controller shut the driver off completely when the actuator isn&#8217;t moving.</p><p>For the 5-volt supply I used the <strong><a href="https://www.pololu.com/product/2858">Pololu D24V22F5</a> </strong>buck regulator. It&#8217;s efficient, compact, and its quiescent current is low enough that it doesn&#8217;t hurt sleep current. It takes the 12-volt battery directly and produces a clean 5 volts for the logic.</p><p>I even threw in a couple of  <a href="https://na.industrial.panasonic.com/products/relays-contactors/mechanical-power-relays/lineup/general/series/1578/model/1804">DSP1-L2-DC12V</a> <strong>12-volt latching relays</strong>. They don&#8217;t draw holding current, which fits the low-power theme, and they give me some flexibility. <strong>Maybe I&#8217;ll use them for an electric fence or  supplemental lighting</strong>. Maybe something I haven&#8217;t thought of yet. The relays are driven from the MCU through a ULN2003A driver, a small workhorse chip that has been switching relays and solenoids since the 1970s.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rDyk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rDyk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 424w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 848w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 1272w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rDyk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png" width="1456" height="914" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:914,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:341496,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rDyk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 424w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 848w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 1272w, https://substackcdn.com/image/fetch/$s_!rDyk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff999ab84-4c5b-4aa1-8c86-d7ca3c42b231_2218x1392.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption"><a href="https://github.com/vinthewrench/chickencoop-3/blob/main/hw/3.3/Schematic.pdf">Coop Controller 3.3</a></figcaption></figure></div><p>I also added a socket for an optional <strong><a href="https://www.sparkfun.com/sparkfun-serial-basic-breakout-ch340c-and-usb-c.html">SparkFun DEV-15096</a></strong>  USB-to-serial module that provides a simple setup console.</p><p>When installing the controller, I can plug the adapter in, open a terminal, and interact directly with the firmware. From there I set the clock, enter the latitude and longitude, configure the schedule, and verify that everything is behaving correctly.</p><p>Once the system is configured, the adapter is no longer needed and can be removed. The controller runs completely on its own.</p><p>The connector also leaves open the option of plugging in a wireless serial bridge later if remote access is useful. But in normal operation there is no reason to leave extra hardware connected drawing power.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9UZU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9UZU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 424w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 848w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 1272w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9UZU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png" width="500" height="386" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:386,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:194714,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/186626812?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9UZU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 424w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 848w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 1272w, https://substackcdn.com/image/fetch/$s_!9UZU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa18caef9-9a8d-4054-aa14-e638b9233da2_500x386.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Coop Controller PCB design</figcaption></figure></div><p>All of this fits comfortably on a 100 &#215; 130 mm PCB.  If you&#8217;re wondering how I actually make these boards, take a gander at my article : &#8220;<a href="https://www.vinthewrench.com/p/how-did-you-make-that">How Did You Make That?</a>&#8221;.</p><h4>Field Setup, Configuration &amp; Programming</h4><p>This article covered the design decisions, the math, the hardware choices, and the state-machine logic that make the controller run reliably in a moving pasture.</p><p>But design work on the bench is only half the story. The real test is getting it configured and running in the field. That includes: </p><ul><li><p>flashing the firmware onto the ATmega1284P</p></li><li><p> hooking up the USB-to-serial console</p></li><li><p> setting your exact latitude and longitude</p></li><li><p> dialing in the sunrise and sunset offsets</p></li><li><p>testing the door/lock sequence, measuring sleep current</p></li><li><p>making sure it survives weeks without touching it.</p></li></ul><p>In the next installment I&#8217;ll walk through that entire process step by step. I&#8217;ll cover the exact build commands, fuse settings, console configuration, and the commands used to set location and scheduling parameters.</p><p>I&#8217;ll try and add some power measurements from the finished system and a few troubleshooting tricks that helped shake out early problems.</p><p>Like all of my designs, the complete project is already available on <a href="https://github.com/vinthewrench/chickencoop-3/tree/main">GitHub</a>, including the firmware, schematics, and PCB layout. </p><p>The software is released under the <strong>MIT License</strong>, and the hardware design files are published under the <strong>CERN-OHL-P v2</strong> open hardware license so others can study it, modify it, and build their own. </p><p>If you build one, drop a photo in the comments.  I&#8217;d love to see how it turns out in your setup.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[avrdude: The Debugging Tool You Didn’t Know You Had]]></title><description><![CDATA[Your Hidden Microscope for AVR Chips]]></description><link>https://www.vinthewrench.com/p/avrdude-the-debugging-tool-you-didnt</link><guid isPermaLink="false">https://www.vinthewrench.com/p/avrdude-the-debugging-tool-you-didnt</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Wed, 28 Jan 2026 23:23:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FX8Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;ve written code for an AVR, Atmel&#8217;s family of 8-bit microcontrollers used in many Arduino boards, you&#8217;ve almost certainly encountered a program called avrdude, whether you realized it or not.</p><p>avrdude, which stands for AVR Downloader/Uploader, is a command-line utility that communicates directly with AVR microcontrollers at a level below any running firmware. It does this by communicating with the built-in programming interfaces of AVR devices, putting the chip into a state where new code can be uploaded.</p><p>As AVR devices evolved, their programming methods changed with them. Across the AVR family, avrdude provides a single, consistent way to communicate with devices that use very different programming interfaces</p><ul><li><p><strong>ISP (In-System Programming)<br></strong>Used by classic ATmega and ATtiny devices. A small set of pins, typically MOSI, MISO, SCK, and RESET, is used to assert reset, clock commands in, and read responses back.</p></li><li><p><strong>High-voltage programming</strong><br>Supported by classic ATmega and ATtiny devices as a recovery mechanism. These modes use a 12-volt signal to force the chip into programming mode when standard ISP access is disabled or misconfigured.</p></li><li><p><strong>PDI and UPDI<br></strong>Used by newer AVR families. XMEGA devices use PDI, while more recent parts use UPDI, a single-wire interface that combines programming and debug access. </p></li></ul><p>Even as device programming interfaces changed, avrdude continued to provide a common way to communicate with them.</p><h4>Before the Dude</h4><p>Atmel showed up in the early 1990s as a semiconductor company best known for nonvolatile memory, EEPROM and flash. They weren&#8217;t a microcontroller company at first. They had tried a few things in that direction, but nothing really caught on. What they did know cold was flash memory, and how to make parts that were simple, inexpensive, and easy to drop into real hardware.</p><p>The AVR architecture came along right when Atmel was looking for something that could actually make use of those strengths. Over in Norway, engineers Alf-Egil Bogen and Vegard Wollan had put together a clean 8-bit RISC design that ran fast and made efficient use of program memory. Atmel licensed the design, brought the guys on board, and wrapped that core around their flash technology. That&#8217;s how AVR became a self-programmable microcontroller family instead of just another CPU on a datasheet.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Xg5x!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xg5x!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xg5x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg" width="400" height="389" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:389,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:85293,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185904613?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18087b96-20bc-46f6-a636-d1b8fcbbaec9_400x389.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Xg5x!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Xg5x!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F53873298-d6cc-4dbc-8c9b-8d21f3cda70b_400x389.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ATmega8 microcontroller die photo, courtesy of ZeptoBars</figcaption></figure></div><p>AVRs were built to be programmed in-system from day one using simple, well-defined protocols, long before platforms like Arduino existed.  Firmware was usually written by the same engineers who designed the hardware, often with no operating system underneath it. Your code didn&#8217;t run on top of an OS, it <em>was</em> the system. </p><p>Programming interfaces like ISP, fuse settings, and startup behavior were all part of the system design, which meant developers needed tools that could work directly at that level.</p><h4>The Dude Arrives</h4><p>avrdude didn&#8217;t show up as part of an IDE or an official toolchain. It showed up out of necessity. Firmware developers needed a reliable way to talk directly to AVR chips and download code into them.</p><p>What existed at the time was a specification. Atmel published application notes like <strong><a href="https://ww1.microchip.com/downloads/en/appnotes/atmel-0943-in-system-programming_applicationnote_avr910.pdf">AVR910</a></strong>  that spelled out the in-system programming protocol in exact detail. The commands, timing, and electrical requirements were all there. </p><p>What didn&#8217;t exist was a consistent, reusable tool that actually implemented it the same way every time. That changed in the late 1990s, when Brian S. Dean wrote the original avrdude under the name <strong>AVRPROG</strong>. It was a simple command-line programmer that implemented the AVR in-system programming protocol so developers could load firmware and configure basic device parameters directly from Unix-like systems.</p><p>As the tool spread beyond its original Unix environment, the name was changed to <strong>avrdude</strong> to avoid confusion with Atmel&#8217;s own <strong>AVRPROG.EXE</strong> utility on Windows.</p><p>In the years that followed, avrdude became a community-managed project hosted on <a href="https://savannah.gnu.org/">Savannah</a>, a public CVS repository that was part of the GNU ecosystem long before GitHub existed. This repository served as the central hub for patches, platform ports, and expanding device support.</p><p>Developers like Ted Roth, Eric Weddington, and J&#246;rg Wunsch helped port avrdude to additional platforms (Linux, macOS, Windows) and expanded support for new devices and programmers.</p><p>Today, avrdude is an actively maintained, cross-platform, open-source tool, with its development hosted on GitHub.</p><h4>avrdude in the Age of Arduino</h4><p>Most developers encounter avrdude indirectly. Platforms like <strong>Arduino</strong> popularized integrated development environments for microcontrollers, but under the fancy veil, they still relied on avrdude whenever code needed loading, fuses had to be set, a device identified, or a misconfigured chip recovered.</p><p><a href="https://blog.arduino.cc/2021/12/09/one-board-to-rule-them-all-history-of-the-arduino-uno/">Arduino originated</a> in 2005 at the Interaction Design Institute Ivrea (IDII), a two-year graduate program in interaction design in northern Italy. It was created as an affordable, open-source microcontroller platform for students, designers, and artists to prototype interactive projects easily, without deep engineering expertise. The early boards used the ATmega8 microcontroller and sold for around $20 to $30. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CnjE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CnjE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CnjE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg" width="400" height="285" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:285,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51891,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185904613?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CnjE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CnjE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4a2ff2a4-e580-4d8c-bdbd-666500987263_400x285.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Arduino from 2005. Massimo has a Flickr photo set from 2004</figcaption></figure></div><p>The platform also included a beginner-friendly IDE for creating and uploading code sketches, helping it spread quickly through word-of-mouth in maker, education, and creative communities. And all through that, avrdude was still there under the hood of that IDE doing its stuff.</p><p>What Arduino did change was to massively expand the audience. Suddenly there were a whole new set of people showing up, making, tweaking, and learning from examples and libraries instead of digging through datasheets. AVR development was no longer just for the embedded engineers; it was for anyone who wanted to get their hands dirty.</p><p>But even with a whole new class of customers, Atmel didn&#8217;t sit back. They kept cranking out new chips to handle tougher jobs, with more peripherals, tighter integration, fewer pins, and all the extra features developers started asking for.</p><p>Some of these chips needed more robust programming methods to handle the advanced features. Others added ways to recover misconfigured devices or to support single-wire debugging.</p><p>Through all these changes, avrdude&#8217;s role remained the same. As new AVR chips added features and programming methods &#8212; from classic ISP and high-voltage programming to PDI and UPDI &#8212; avrdude grew to support them all, providing a consistent bridge between developer and silicon. It implemented the protocols the hardware expected, handled timing and state, and reported exactly how the device responded, even as layers and IDEs changed.</p><h4>How Does the Dude Do It?</h4><p>But avrdude is just a piece of software. It can follow the protocol and read what the chip spits back, but it can&#8217;t physically flip pins or bang the clock lines on the board.  For that you need hardware, a programmer device to actually drive the signals. Fortunately there are number of programmer tools are available, ranging from simple hobbyist adapters to full-featured professional devices.</p><ol><li><p><strong>Atmel-ICE</strong> &#8211; The top-tier AVR programmer and debugger. Supports ISP, PDI, UPDI, and high-voltage programming.  I personally use the <a href="https://www.mouser.com/ProductDetail/Microchip-Technology/ATATMEL-ICE-BASIC?qs=KLFHFgXTQiAG498QgmqIdw%3D%3D">basic kit</a>, which includes the programmer and USB cable and handles most standard ISP work, while the <a href="https://www.mouser.com/ProductDetail/Microchip-Technology/ATATMEL-ICE?qs=sGAEpiMZZMuRZxwUfDU0miN4udwF8GpUanrVt%252BDSn9Q4SZQ5wSGB4Q%3D%3D">full kit</a> adds adapters and cables for connecting to a variety of AVR boards and interfaces. These are the gold standard for development, testing, and rescuing misconfigured chips.</p></li><li><p> <strong>SparkFun AVR Programmers</strong> &#8211; Hobbyist-friendly USB-to-ISP programmers that work well with avrdude. The <strong><a href="https://www.sparkfun.com/pocket-avr-programmer.html">Pocket AVR Programmer</a></strong> is a general-purpose ISP programmer for classic AVRs with 64K flash or less. The <strong><a href="https://www.sparkfun.com/tiny-avr-programmer.html">Tiny AVR Programmer</a></strong> is really designed for tinyAVRs but should also work with other classic AVRs via ISP headers. Both are low-cost, reliable alternatives for most tasks, though they don&#8217;t support larger AVRs like the ATmega2560 on an Arduino Mega.</p></li><li><p><strong>Olimex</strong> &#8211; Community-friendly <a href="https://www.olimex.com/Products/AVR/Programmers/">AVR programmers</a> that work well with avrdude and open-source toolchains. They offer a few models that include classic ISP and PDI interfaces, using standard USB (Type&#8239;B) or serial connectors to connect to target boards. Based in Bulgaria, their goal has always been to provide reliable, low-cost programming hardware accessible to hobbyists and small teams.</p></li><li><p><strong>USBasp</strong> &#8211; Cheap, often cloned USB-to-ISP programmers that work with avrdude for classic AVRs. They are known for timing or clock issues, so you get what you pay for, and they&#8217;re not recommended for serious work.  </p></li><li><p><strong>Arduino as ISP</strong> &#8211; In a pinch, you can even turn an Arduino into a DIY AVR programmer.  <a href="https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/">Official documentation</a> and the <a href="https://github.com/rsbohn/ArduinoISP">ArduinoISP sketch on GitHub </a>show how to connect the SPI pins and RESET to another AVR board so it can be programmed via avrdude. It works for basic projects but isn&#8217;t as robust or reliable as a dedicated hardware programmer.</p></li></ol><p>AVR programmers and target boards come with two common ISP connector formats: a <strong>6&#8209;pin</strong> and a <strong>10&#8209;pin</strong> layout.  Event though the pinout is different, they both carry the same signals.</p><ul><li><p><strong>RST</strong> &#8211; asserted to put the MCU into programming mode</p></li><li><p><strong>MOSI</strong> &#8211; data sent from the programmer to the MCU</p></li><li><p><strong>MISO</strong> &#8211; data sent from the MCU back to the programmer</p></li><li><p><strong>SCK</strong> &#8211; clock line for synchronizing data</p></li><li><p><strong>VCC</strong> &#8211; power supplied to the target MCU</p></li><li><p><strong>GND</strong> &#8211; common ground between programmer and target</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n48_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n48_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 424w, https://substackcdn.com/image/fetch/$s_!n48_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 848w, https://substackcdn.com/image/fetch/$s_!n48_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 1272w, https://substackcdn.com/image/fetch/$s_!n48_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n48_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png" width="600" height="280" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:280,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:116897,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185904613?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!n48_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 424w, https://substackcdn.com/image/fetch/$s_!n48_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 848w, https://substackcdn.com/image/fetch/$s_!n48_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 1272w, https://substackcdn.com/image/fetch/$s_!n48_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6a85ea77-ab50-408f-a7af-5fb255439356_600x280.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Note:</strong> Both the 6&#8209;pin and 10&#8209;pin AVR ISP connectors use a standard <strong>0.1&#8239;in (2.54&#8239;mm) </strong>pitch. Friggen KiCad had the footprints completely wrong. I got burned using a 2&#8239;mm header that refused to fit a standard ribbon cable. <strong>Always double-check the footprint against the datasheet before spinning up a board</strong>.</p><p>A good programmer isolates and buffers the signals, provides clean timing on RESET, MOSI, MISO, and SCK, and monitors the target&#8217;s VCC to safely handle 5&#8239;V or 3.3&#8239;V boards. Cheap programmers often drive the signals directly, may have poor timing, and usually don&#8217;t sense the target voltage. This can cause glitches, unreliable programming, or even damage the MCU.</p><p> One thing to keep in mind is that no matter the ISP programmer model, you should never hot-plug it into a powered MCU board. Back-feeding signals through the MCU pins can fry the chip.  <a href="https://www.vinthewrench.com/p/how-did-you-make-that">I toasted three before figuring it out</a>.</p><h4>The Dude is also a Detective</h4><p>avrdude can do more than just flash firmware and set fuses. By analyzing how the chip responds, it generates error messages that provide valuable clues about what is happening with the hardware. Every &#8220;command failed&#8221; or &#8220;device not responding&#8221; message tells a story, whether the MCU is powered, the clock is running, the reset line is behaving, or something else is wrong.</p><h5>Getting hardware insight with avrdude</h5><p>You can query a connected AVR and see its voltage, memory layout, fuses, and other low-level info with a single command. For example, using an Atmel-ICE programmer on an ATmega88:</p><pre><code>avrdude -c atmelice_isp -p m88pb -v -q</code></pre><p>This command tells avrdude to use the Atmel-ICE in ISP mode (-c atmelice_isp), target an ATmega88PB (-p m88pb), print verbose output (-v), and quiet any progress messages (-q). Every detail you see here can give you insight into the board&#8217;s power, wiring, and chip health.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FX8Q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FX8Q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 424w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 848w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 1272w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FX8Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp" width="800" height="773" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:773,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:75702,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185904613?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!FX8Q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 424w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 848w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 1272w, https://substackcdn.com/image/fetch/$s_!FX8Q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F94a1ea00-1a73-47be-8cba-b07a382884a5_800x773.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">avrdude gives you a wealth of information</figcaption></figure></div><p>Looking at the screenshot, you can see how much information avrdude exposes. For example,</p><ul><li><p><strong>Vtarget</strong> &#8211; the actual logic voltage applied to the MCU. This single number carries a lot of meaning. If your ISP is miswired or plugged in backward, voltage can flow the wrong way through I/O pins or protection diodes, which can prevent communication or even damage the chip. Checking Vtarget lets you catch these problems immediately, before you attempt any programming, saving parts and  avoiding troubleshooting headaches.</p></li><li><p><strong>Device signature</strong>  &#8211; a three&#8209;byte value programmed into every AVR that uniquely identifies the part. Reading it with avrdude confirms that the MCU is powered, wired correctly, and responding over the programming interface. A correct signature tells you the right chip is in place, while a mismatch or failure to read the signature points to wiring issues, misconfigured fuses, or even a dead part. This makes the device signature the first real clue in diagnosing hardware problems before you touch firmware.  You can find a complete list of all known AVR signatures in the <a href="https://github.com/avrdudes/avrdude/blob/main/src/avrdude.conf.in">avrdude sources</a>.</p></li><li><p><strong>Memory details</strong> &#8211; shows the sizes of flash, EEPROM, and fuse memory, along with paging and read/write characteristics. This helps confirm that the chip matches what you expect, that your code will fit, and gives a clear view of the device&#8217;s memory layout before programming.</p></li><li><p><strong>Fuse values</strong> &#8211; hfuse, lfuse, efuse, lock bits. We&#8217;ll cover these in detail a bit later.</p></li><li><p><strong>Timeouts, delays, and poll loops</strong> &#8211; these internal settings show how avrdude is communicating with the MCU. Unusual values or repeated timeouts can hint at signal integrity problems, wiring issues, or timing mismatches between the programmer and the target.</p></li></ul><ul><li><p><strong>Other subtle diagnostics</strong> &#8211; The verbose avrdude output exposes low-level programmer behavior that is critical for debugging:</p><ul><li><p><strong>Chip erase delays</strong> &#8211; reveal whether the programmer and MCU are aligned in timing.</p></li><li><p><strong>RESET disposition</strong> &#8211; shows how the programmer asserts the RESET line; misconfigured reset can block programming entirely.</p></li><li><p><strong>SPI timing parameters</strong> &#8211; Retry Pulse, StabDelay, CmdExeDelay highlight missed pulses or unstable clocks.</p></li><li><p><strong>Synchronization counts</strong> &#8211; SyncLoops, PollIndex, PollValue indicate wiring issues, weak signals, or a missing clock.</p></li><li><p><strong>SCK period</strong> &#8211; the actual SPI clock; ensures timing is safe for the target&#8217;s voltage and speed.</p></li><li><p><strong>Programmer serial number and firmware version</strong> &#8211; helps diagnose hardware quirks or outdated firmware that might affect reliability.</p></li></ul></li></ul><h4>Maybe It&#8217;s a Blown Fuse</h4><p>Fuse settings are one of those things most people gloss over in tutorials about AVRs and Arduino. They&#8217;re low-level configuration bits that control critical behavior: startup sequence, clock source, reset functionality, and brown-out detection. Screw up the fuses, and a perfectly good chip can appear dead or just go haywire.</p><p>There are fuse bytes on most AVRs that control low-level configuration of the microcontroller:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!67MZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!67MZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 424w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 848w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 1272w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!67MZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png" width="800" height="259" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/445d1d73-112d-45c2-b996-3791a569e068_800x259.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:259,&quot;width&quot;:800,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:274677,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185904613?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!67MZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 424w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 848w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 1272w, https://substackcdn.com/image/fetch/$s_!67MZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F445d1d73-112d-45c2-b996-3791a569e068_800x259.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">AVR fuse details</figcaption></figure></div><p>These three main bytes&#8212;<strong>LFUSE</strong>, <strong>HFUSE</strong>, and <strong>EFUSE</strong>&#8212;determine how the MCU powers up, which clock it uses, how it handles resets, and how it protects critical memory sections before any firmware even runs. Together, they ensure the chip operates safely and predictably. Understanding them is essential for diagnosing hardware issues, verifying proper startup behavior, and safely recovering chips that appear unresponsive.</p><p>One good resource is the <a href="https://developerhelp.microchip.com/xwiki/bin/view/products/mcu-mpu/8-bit-avr/structure/fuses/">Microchip AVR Fuse Overview</a>, which explains each fuse bit and its effect on device behavior. Another is the <a href="https://eleccelerator.com/fusecalc/">Eleccelerator AVR Fuse Calculator</a>, an interactive tool to experiment with fuse settings and see exactly what each bit does. </p><p>Either way, it is always prudent to refer to the datasheet for the specific AVR chip you&#8217;re working with.</p><h4>When the Dude Got Nothing</h4><p>Even with a solid programmer and the correct command syntax, sometimes avrdude just can&#8217;t get a response. When the Dude gets nothing, those error messages are gold. They reveal exactly what&#8217;s going wrong at the hardware level:</p><ul><li><p><strong>stk500_recv(): Programmer not responding<br></strong>Usually a wiring problem: missing connections, miswired RESET, or a dead chip. Double-check board selection and connections. Could also indicate a disconnected or faulty programmer.</p></li><li><p><strong>program enable: target does not answer<br></strong>The MCU didn&#8217;t enter programming mode. Check RESET, clock source, power supply, and fuse settings. Could also indicate that the chip is misconfigured or bricked.</p></li><li><p><strong>Invalid device signature<br></strong>Wrong chip selected in avrdude, weak signals, or miswiring. Could also indicate a faulty or partially dead MCU.</p></li><li><p><strong>verification error, first mismatch at byte 0x00<br></strong>Flash didn&#8217;t program correctly. Often caused by poor SPI connection, signal integrity issues, or timing errors. Could also point to an underpowered or noisy target board.</p></li><li><p><strong>timeout while waiting for response<br></strong>Signals aren&#8217;t reaching the chip, timing mismatches, missing pull-ups, wrong oscillator, or programmer speed too high. Could also indicate that the MCU isn&#8217;t powered or RESET is stuck.</p></li><li><p><strong>fuse write failed / fuse read failed<br></strong>Electrical problem or timing violation. Could indicate undervoltage, miswiring, or misconfigured fuses. May also occur if programmer speed is too fast for the target.</p></li><li><p><strong>cannot set sck period / stk500_getsync() attempt N of M: not in sync<br></strong>Programmer cannot communicate reliably. Usually wiring errors, programmer misconfiguration, or incorrect clock source. Could also indicate a partially bricked MCU.</p></li><li><p><strong>avrdude: Device signature = 0x000000<br></strong>No response at all. Check power, clock, and RESET. Chip could be physically damaged, dead, or completely unresponsive.</p></li><li><p><strong>avrdude: error reading EEPROM<br></strong>Communication failure during EEPROM read. Might be wiring, programmer fault, or partially dead chip.</p></li><li><p><strong>target does not answer, HVSP/HVPP mode required<br></strong>Normal for chips with disabled RESET or misconfigured clocks. High-voltage programming may be required to recover the chip.</p></li><li><p><strong>avrdude: unknown programmer id<br></strong>Programmer type not specified correctly, firmware mismatch, or incompatible programmer.</p></li><li><p><strong>signature mismatch: expected 0x1E950F, found 0x000000<br></strong>Chip not responding or incorrectly connected. Indicates a fundamental hardware-level issue rather than a software problem. Could be bad wiring, dead MCU, or misconfigured fuses.</p></li></ul><p>Reading these messages carefully usually lets you identify a dead chip, wiring issues, programmer setup problems, or power/clock faults, long before you suspect your firmware.</p><h4>Time to Break Out the Scope</h4><p>Not every avrdude failure means the MCU is dead. Before assuming the worst and risking another chip, it pays to figure out what&#8217;s actually happening. Problems can stem from wiring, clock issues, power glitches, or programmer misconfiguration. The solution: break out the scope and watch the signals as avrdude tries to communicate with the chip.</p><p>Before assuming the chip is dead, start with the basics. Probe the signals right at the MCU pins. A bad solder joint or broken trace can make everything look fine elsewhere on the board, while the chip itself never sees the signals. Measuring at the MCU ensures you&#8217;re checking the real hardware, not just the board wiring.</p><ol><li><p><strong>Check VCC and GND</strong> &#8211; Ensure the target board is powered, and the programmer&#8217;s ground is connected. A missing or low supply can prevent communication and even damage the chip.</p></li><li><p><strong>Check RESET</strong> &#8211; The programmer uses the RESET line to put the MCU into programming mode. On the scope, you should see the line pulled low briefly when avrdude starts communication. If RESET stays high, fluctuates, or never toggles, the chip won&#8217;t enter programming mode. Causes can include wiring mistakes, a missing pull-up resistor, or a misconfigured fuse that disables external reset. Watching this signal confirms whether the programmer can actually assert reset correctly before you assume the MCU is dead.</p></li><li><p><strong>SCK (clock)</strong> &#8211; You should see a clean, regular square wave whenever avrdude is clocking data into the MCU. No activity or irregular edges mean the programmer isn&#8217;t driving the clock properly, or the line is disconnected.</p></li><li><p><strong>MOSI (Master Out, Slave In)</strong> &#8211; Data sent from the programmer to the MCU should change only on the clock edges. You should see distinct high and low voltage levels corresponding to the bits being sent. Glitches, floating signals, or missing transitions indicate wiring problems, signal integrity issues, or incorrect programmer speed settings.</p></li><li><p><strong>Check MISO (Master In, Slave Out)</strong> &#8211;  It&#8217;s how the MCU talks back to the programmer. On the scope, it should change state in sync with clocked commands on MOSI. If it is flat, stuck high, low, or silent, it usually indicates the MCU isn&#8217;t responding, even if power, RESET, and the clock look correct. Observing MISO gives you the first solid clue that the MCU is capable of communicating before you start suspecting firmware.</p></li></ol><p>Also watch for signal integrity issues. Ringing, slow edges, voltage dips, or spikes can indicate wiring problems, long cables, or missing pull-ups. Observing the signals in real time lets you distinguish a truly dead MCU from one that isn&#8217;t responding due to wiring, timing, or power issues. A quick scope check can save hours of troubleshooting and prevent more chips from being damaged by repeated failed programming attempts.</p><p>Remember, avrdude is only as capable as the hardware it talks to. If the MCU is physically damaged, missing a crystal, or lacks power, no amount of clever command-line flags will make it respond. That&#8217;s why verifying signals directly at the MCU with a scope before blaming firmware is critical.</p><h4>A Couple More Words on the Dude</h4><p>Before we close the book on avrdude, here are a few command-line options people often overlook:</p><ul><li><p><strong>-v / -vv / -vvv</strong> &#8211; Verbose mode. Shows the programmer&#8217;s internal timing, memory page delays, and low-level responses from the MCU. Useful for diagnosing subtle wiring, timing, or signal integrity problems that might otherwise go unnoticed.</p></li><li><p><strong>-B</strong> &lt;value&gt; &#8211; Programmer bitclock period. Slows down communication for breadboards, slow oscillators, or marginal connections, helping avoid &#8220;device not responding&#8221; errors.</p></li><li><p><strong>-U</strong> &lt;mem&gt;:&lt;r|w|v&gt;:&lt;file&gt; &#8211; Memory operations (read, write, verify). Can be used to inspect flash, EEPROM, or fuses and even recover misconfigured chips using high-voltage programming if standard ISP fails.</p></li><li><p><strong>High-Voltage Programming (HVPP / HVSP)</strong> &#8211; Use this when a chip is misconfigured or &#8220;bricked,&#8221; for example if the RESET line is disabled or the clock source is invalid. High-voltage programming lets avrdude access fuses and flash that aren&#8217;t reachable via standard ISP, enabling recovery of the device.</p></li></ul><p>The -c option for high-voltage programming depends on your hardware:</p><ul><li><p><strong>Atmel-ICE:</strong> use -c atmelice_hvpp for High-Voltage Parallel Programming or -c atmelice_hvsp for High-Voltage Serial Programming.</p></li><li><p><strong>Other high-voltage programmers:</strong> consult the device documentation, as each may require a different -c identifier.</p></li></ul><p><strong>Example: Recovering an ATmega88PB Using HVPP</strong></p><pre><code>avrdude -c atmelice_hvpp -p m88pb -U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h</code></pre><p><strong>Explanation:</strong></p><ul><li><p>-c atmelice_hvpp selects the Atmel&#8209;ICE High-Voltage Parallel Programmer.</p></li><li><p>-p m88pb targets the ATmega88PB.</p></li><li><p>-U hfuse:r:-:h -U lfuse:r:-:h -U efuse:r:-:h reads the high, low, and extended fuse bytes and prints them in hexadecimal.</p></li></ul><p>Use this command when the MCU is misconfigured or appears bricked due to disabled RESET or invalid clock settings. High-voltage programming allows avrdude to access fuses and flash that aren&#8217;t reachable via standard ISP, enabling recovery without replacing the chip.</p><h4>The Dude Abides</h4><p>Make no mistake, avrdude isn&#8217;t just for flashing chips. It&#8217;s a diagnostic microscope, a rescue kit, and your essential sidekick for working with AVR hardware</p><p>Even after decades, new chips, IDE churn, and countless hobbyists and engineers, the Dude still rolls. Avrdude stays under the hood, talking to the MCU, reading and writing fuses, and programming the chip reliably. You can still depend on it to get the job done.</p><p>The Dude just continues to abide.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what this dude writes about</a>. Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p>]]></content:encoded></item><item><title><![CDATA[Chasing Raspberry Pi Power Management]]></title><description><![CDATA[Lessons Learned Building a Power Switch with Deep Sleep and Wake Control]]></description><link>https://www.vinthewrench.com/p/chasing-raspberry-pi-power-management</link><guid isPermaLink="false">https://www.vinthewrench.com/p/chasing-raspberry-pi-power-management</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Mon, 26 Jan 2026 21:13:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mqH-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The problem of Raspberry Pi power management has been dogging me for a few years now, going back to my <a href="https://github.com/vinthewrench/carradio">Pi Car Radio</a> project in 2022. That project forced me to confront the real issue early on. The Raspberry Pi does not do deep sleep. It was never one of the design goals. You can shut the operating system down, but the board stays powered and continues to draw current. That is not practical unless you like dead batteries.</p><p>There are products and add-on hats that try to address this, and some of them work fine within their limits, but they are partial solutions. Most of them <em>assume the Pi is the system</em> and that only the Pi needs to be managed. My problem was different. I needed power management as part of a larger system, in this case an irrigation controller with solenoids, valves, and real loads, where saving battery and enforcing power state matters more than keeping the Pi alive.</p><h4>Why Shutdown Is Not Enough</h4><p>Shutting down the operating system is only part of the problem. It solves file system integrity, not power management. After shutdown, the Raspberry Pi is still powered, still drawing current, and still connected to everything downstream. Even if the Pi is only drawing 25 mA in this state, which sounds small, it runs 24/7. That is just a slow battery leak, like a tire with a nail in it. It does not fail all at once, but soon enough it will leave you with a dead battery.</p><p>If the goal is to save energy, power has to be physically removed, cutting power to the Pi and to anything else it might be controlling. Once you do that, the Pi is dead and out of the loop. It cannot wake itself.</p><p>That means something else has to decide when power comes back. In my case, that happens for a few specific reasons. The system needs to wake when AC power is restored. If AC is not available for a while, it still needs to wake on its own to do periodic work, things like taking environmental measurements, updating state, or activating and deactivating devices such as irrigation valves and sprinklers.</p><p>Since those decisions cannot depend on the now unpowered Pi, the wake logic has to live somewhere else, in hardware that stays alive when everything downstream is off and can make those decisions without Linux running.</p><h4>Why the Early Designs Fell Short</h4><p>In <a href="https://www.vinthewrench.com/p/raspberry-pi-internet-of-things-part-029/comments">earlier versions of this work</a>, I tried to solve the wake problem with discrete components. Simple logic to detect power restoration, edge detection, delays, and restart conditions. It worked on paper and sometimes on the bench, but in practice it was finicky. Small variations in timing, component tolerances, and real-world power behavior made it unreliable. As the system got more complex, those approaches stopped scaling.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aR9c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aR9c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aR9c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg" width="500" height="335" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:335,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91878,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185228510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aR9c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aR9c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6c87db9c-633f-401f-9ab1-ca2c8e6f4e29_500x335.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Reworking an early discrete-logic prototype.</figcaption></figure></div><p>What I needed instead was a microcontroller. Modern MCUs can stay alive at very low power, make clear decisions, and handle timing without depending on RC delays, thresholds, and other analog behaviors. That also made it possible to add controlled, timed wake logic, not just react to power coming back, but wake on purpose to perform scheduled work when nothing else was happening.</p><h4>What It Needed to Do</h4><p>The nice thing about building enough iterations of this design is that I have a good handle on what this power controller needs to look like now.</p><ul><li><p>Remove power from the Raspberry Pi and all downstream loads in response to a shutdown request from the Pi.</p></li><li><p>During shutdown, draw minimal power so the system can remain off for long periods on battery without slowly draining it.</p></li><li><p>Automatically bring the system back up when AC power is restored or on manual request.</p></li><li><p>Support scheduled wakeups to perform periodic work while running on battery.</p></li></ul><p>Beyond that, it needed to fit cleanly into my existing irrigation controller design and be generic enough to reuse in other systems without redesigning the power logic each time.</p><h4>MCU Design Evolution</h4><p>Once it was clear that this problem needed a microcontroller, the question stopped being whether to use one and became which one to use and how the Pi interacts with it. I&#178;C was already in use elsewhere in the irrigation controller, so reusing it for the power controller was a no-brainer.</p><p>Those choices narrowed the MCU requirements to an MCU that truly supports I&#178;C slave operation, a small number of GPIO lines, and a low-power sleep mode with timed wakeup.</p><p>I looked at a few MCU families, including AVR, PIC, and ESP. All of them technically could have been made to work, but AVR ended up being the best fit for this design.</p><p>PIC parts are capable, but the toolchain alone was enough to raise concerns, and the added complexity of configuration bits and device-specific sleep and wake quirks did not offer enough upside to justify adding a new ecosystem to my designs.</p><p>ESP-class parts are designed for connectivity-first systems, not for quietly managing power while everything else is off. Their higher baseline power draw, more complex boot sequence, and built-in Wi-Fi, radios, and background behavior add power cost that is hard to justify for a controller whose primary job is to sleep most of the time.</p><p>AVR ended up being the best match for the job. The parts are simple and electrically well understood, with solid I&#178;C slave support and low-power sleep modes. The toolchain also fit naturally with my existing workflow, using C and Makefiles, with no extra framework garbage.</p><p>Once AVR was the clear direction, the next step was narrowing down the specific part.  </p><p>This took a few tries. I aimed low at first with the <strong><a href="https://www.mouser.com/ProductDetail/556-ATTINY84A-PU">ATtiny84A-P</a></strong>. It had low-power sleep modes, enough GPIO to get started, and was easy to prototype. But the devil was in the details. I&#178;C slave support was workable but fragile, pin count left no margin, and interrupt and wake handling became awkward as soon as more than one wake source was involved. Every small change forced compromises that were exactly what I was trying to avoid in a power controller.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!soKy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!soKy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 424w, https://substackcdn.com/image/fetch/$s_!soKy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 848w, https://substackcdn.com/image/fetch/$s_!soKy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!soKy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!soKy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg" width="500" height="340" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:340,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102637,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185228510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!soKy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 424w, https://substackcdn.com/image/fetch/$s_!soKy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 848w, https://substackcdn.com/image/fetch/$s_!soKy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!soKy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F866be647-da76-4e97-8cd9-82f81b7d1961_500x340.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">First redesign attempt using the <strong>ATtiny84A</strong></figcaption></figure></div><p>My next try was the  <strong><a href="https://www.mouser.com/ProductDetail/556-ATMEGA8-16AU">ATmega8-16</a>.</strong> I had used this part before in a model railroad semaphore controller and in a custom car lighting system, so it was already terra cognita. This got me further than the ATtiny84, but it ultimately hit a dead end around sleep and wake behavior.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NFw3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NFw3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg" width="500" height="384" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:384,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109721,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185228510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NFw3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9103cb5b-e215-4be7-8ad0-93a60c004a93_500x384.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Early standalone controller built around the <strong>ATmega8-16</strong></figcaption></figure></div><p>While the chip could sleep and wake, combining low-power sleep with multiple wake sources, including timed wakeups, became awkward and brittle. Only a limited set of interrupts remain active in the deepest sleep modes, and timer availability is sharply reduced there. Getting all of my requirements to coexist meant giving up the deepest sleep modes and accepting unacceptably higher power usage.</p><p>On top of that, the ATmega8 is now flagged as <strong>NRND</strong> (<a href="https://electronics.stackexchange.com/questions/544411/what-does-not-recommended-for-new-designs-mean-in-an-attiny-datasheet?utm_source=chatgpt.com">Not Recommended for New Designs</a>), which made it a poor foundation for something I intended to keep building on.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mqH-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mqH-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mqH-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg" width="500" height="392" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:392,&quot;width&quot;:500,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:102033,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185228510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mqH-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 424w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 848w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!mqH-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5bdcdb5c-000a-421e-8bee-a0abc6b50dee_500x392.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">ATmega8-16 power controller prototype. Close but no cigar.</figcaption></figure></div><p>Fortunately, there was a closely related part that addressed the sleep and wake limitations without changing the overall design. That part was the <strong><a href="https://www.mouser.com/ProductDetail/556-ATMEGA88PB-AU">ATmega88</a></strong>. It cleaned up the interaction between sleep modes, interrupts, and timers in a way the ATmega8 never quite managed. It made it possible to stay in the deepest sleep states while supporting multiple wake sources and timed wakeups, without resorting to special cases or power compromises. In practice, the behavior was more predictable across sleep transitions, which is exactly what you want in a controller that exists to manage power.</p><p>The swap to the ATmega88 was easy, using the same TQFP package, pinout, and development workflow, while avoiding the ATmega8&#8217;s NRND status at nearly half the cost. It was largely a matter of swapping parts, not redesigning the board.</p><h4>Standalone Prototype Board</h4><p>As this design evolved, one decision that helped a lot was pulling the power controller out into a standalone breakout board. Instead of repeatedly reworking the irrigation controller, I isolated the power logic and treated it as its own subsystem. That made it much easier to debug wake behavior, power transitions, and failure cases without dragging the rest of the system along for the ride. It also forced the design to be self-contained, which made it easier to reason about and reuse elsewhere. Once the power logic worked on its own, integrating it back into the irrigation system was straightforward.</p><h4>How I Learned to Stop Killing MCUs</h4><p>Another lesson that came out of this design evolution had nothing to do with the MCU itself and everything to do with how the firmware gets onto the board. In earlier versions of this project, I managed to kill more than one chip by being careless with ISP programming. Programming over ISP is simple enough, but hot-plugging an ISP cable into a powered board can back-feed signals through protection diodes or I/O pins in ways the chip really does not appreciate. Sometimes you get away with it. Sometimes you do not. I did not, more than once.</p><p>That experience led to one more revision of the breakout board. I added small series resistors on the ISP lines. This is not a substitute for good habits, but it does help limit the damage when I inevitably screw up.</p><h4>Firmware</h4><p>Once the power controller moved to a microcontroller, I needed to create firmware to run the logic. The good news is that the code itself is fairly simple.</p><p>The controller runs as an I&#178;C slave at a fixed address and exposes a small command set. The Raspberry Pi can request a power-off by opening the relay and can set a wake timer for a future restart.  Once power is removed, the MCU enters a deep low-power sleep mode and waits for a wake event, such as AC power returning, a watchdog-based timer expiring, or a user wake button. </p><p>In its deepest sleep state, the controller draws about 350 &#181;A. That is not the absolute minimum possible, but it is low enough for my application. With the 12 V 22 Ah SLA battery I am using, that level of current works out to years of standby time. At that point, battery self-discharge and real work cycles matter far more than the controller itself. Chasing lower numbers would have meant more hardware complexity for very little practical gain.</p><p>Because this started life as a standalone breakout board, I added a couple of LEDs that can be toggled from the Raspberry Pi over I&#178;C to make bring-up and debugging easier. I also added a jumper to select how the MCU is powered, either from the Pi&#8217;s 5 V rail over I&#178;C or from the onboard regulator tied to the 12 V system supply. That flexibility made it easier to test and isolate power behavior during development.</p><p>The firmware is written in straight C, built with avr-gcc, flashed with avrdude, and driven by a Makefile. I opted away from the Arduino IDE because getting the power savings I needed required full control over what the code does. I could not rely on third-party libraries or hidden startup behavior for something this critical.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xgGM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xgGM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 424w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 848w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 1272w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xgGM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png" width="600" height="461" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f890c699-3107-4a8d-823c-442989868d03_600x461.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:461,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:203031,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185228510?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xgGM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 424w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 848w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 1272w, https://substackcdn.com/image/fetch/$s_!xgGM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff890c699-3107-4a8d-823c-442989868d03_600x461.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Firmware using the normal toolchains</figcaption></figure></div><h4>The Build Process</h4><p>If you want to see how this board really came together, I lay out the whole process in my article <a href="https://www.vinthewrench.com/p/how-did-you-make-that">How Did You Make That?</a> It walks from the first sketch through schematic capture, PCB layout, fabrication, flashing, and debugging. It&#8217;s the unglamorous middle part between an idea and hardware that actually works.</p><p>And if you want to dig a bit deeper into the details, I&#8217;ve put the entire project on <a href="https://github.com/vinthewrench/powercontrol">GitHub</a>. As I usually do, the source code, KiCad schematics, and PCB layouts are all open, under permissive licenses that let you use, modify, and build on the work and pretty much do whatever you want.</p><div><hr></div><p>If you care about how things are made and why they&#8217;re built the way they are, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write about</a>. Hitting like and sharing helps real people find the work. The algorithm can go pound sand.</p><p></p>]]></content:encoded></item><item><title><![CDATA[Parts that don't suck: part 3]]></title><description><![CDATA[Marine-grade electrical parts built to survive vibration, weather, and bad ideas.]]></description><link>https://www.vinthewrench.com/p/parts-that-dont-suck-part-3</link><guid isPermaLink="false">https://www.vinthewrench.com/p/parts-that-dont-suck-part-3</guid><dc:creator><![CDATA[Vinnie Moscaritolo]]></dc:creator><pubDate>Sun, 25 Jan 2026 20:55:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!B9FJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In my previous articles I wrote about making good connections and power supply basics. That work matters on the farm because everything sits outside, gets wet, gets dirty, and keeps getting used long after the paint wears off.</p><p>But electrical systems really get put on trial in vehicles, especially off-road ones. Vibration and dirt work like a file, slowly chewing through copper and insulation until something goes bang or catches fire.</p><p>Given that I wasn&#8217;t done talking about reliable wiring, let&#8217;s continue my theme of adapting marine electrical parts for trucks and other low-voltage, high-current builds that need to survive corrosion and abuse.</p><p>Over the years I&#8217;ve done several frame-up off-road truck builds and a lot of rewiring, often with dual-battery setups so winches, radios, and camping gear could run without leaving me stranded in the woods. This time I want to share a few more marine-derived parts that have saved my ass more than once, in particular an automatic charging relay, some rugged circuit breakers, and last but not least, heat shrink.</p><h4>Blue Sea ML-ACR </h4><p>Dual-battery systems are common on off-road vehicles, especially trucks set up for camping and back country travel. These days people won&#8217;t go into the woods without wiring in winches, extra lighting, refrigerators, and inverters, not to mention a Starlink dish so they can post about being off-grid in real time. The trick is running all of that gear without killing your starting battery and getting stranded.</p><p>But this is where a lot of people get the wiring wrong. They hard-tie the batteries together, rely on a manual switch they forget to use, or install a cheap isolator that drops voltage and causes more problems than it solves. What you actually want is a system that automatically combines the batteries when there&#8217;s a charge source and isolates them when there isn&#8217;t, including during engine start.</p><p>Boats have the exact same problem, except the consequences are worse. When you kill the starting battery on the water, you can&#8217;t walk out for help. You end up drifting to Gilligan&#8217;s Island.</p><p>The marine world has been dealing with this exact problem for a long time, and one of their cleanest solutions is the <strong><a href="https://www.bluesea.com/products/category/35/91/ML-ACRs">Blue Sea Systems ML-ACR</a></strong> automatic charging relay. It combines the batteries when there&#8217;s a charging source and isolates them when there isn&#8217;t, with no voltage drop, no switches to forget, and nothing for the operator to screw up.</p><p>Being a marine part, it&#8217;s not cheap, but this is one of those cases where you actually get what you pay for.</p><p> I like the ML-ACR not just because it works, but because the design is genuinely ingenious. It&#8217;s a magnetic-latching relay, not some coil that sits there humming and cooking itself all day. Once it switches, it stays put and stops wasting power.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9nYh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9nYh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9nYh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg" width="400" height="492" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:492,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:64523,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185737253?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9nYh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9nYh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ee5cc16-b79a-4db2-acf7-a9c361564f89_400x492.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Blue Sea Systems ML-ACR automatic charging relay and control</figcaption></figure></div><p>It just does the right thing on its own, no switch to remember and no ritual before you turn the key. But when you need to take control, it lets you. There&#8217;s manual control for the times you know better than the hardware, and a lock off mode that&#8217;s saved my ass more than once while I was elbows-deep in the rest of the electrical system.</p><p>There&#8217;s no voltage penalty and no fragile electronics in the current path. It can carry a boatload of current and survive a salty, corrosive environment.</p><p>It doesn&#8217;t take a PhD to wire it. The left stud goes to the house battery, meaning the auxiliary battery that runs your gear, and the right stud goes to the starting battery and the alternator.</p><p>There&#8217;s also a remote switch you can mount on the dash for manual control. It lets you force the ML-ACR ON, force it OFF, or leave it in AUTO, with indicator LEDs showing when the batteries are combined, without having to crawl back to the relay. Wiring the switch is simple: red is the control lead, yellow feeds the indicator LEDs, and black is ground. The rest of the wires in the harness are for edge cases and advanced setups, and most of the time you can ignore them.</p><p><a href="https://www.bluesea.com/products/category/35/Automatic_Charging_Relays?Manual_Control=Yes">Blue Sea has lots of instructions</a>, wiring diagrams, and troubleshooting info on their site, plus real customer support if you get jammed.</p><h4>Blue Sea 285 Circuit Breaker</h4><p>Next up is another part I stole straight from the marine world: the <a href="https://www.bluesea.com/products/category/14/32/Circuit_Breakers/285-Series">Blue Sea Systems 285 series</a> circuit breaker.  So what, it&#8217;s just a circuit breaker. That&#8217;s easy to say until one fails on you, or you realize you didn&#8217;t bring a spare fuse. This is one of those parts you install once and forget about, because it just friggen works. </p><p>It&#8217;s waterproof, won&#8217;t corrode itself to death, doesn&#8217;t false-trip, and it can double as a simple disconnect when you&#8217;re working on anything downstream. It&#8217;s also available in both panel-mount and surface-mount versions, which makes it easy to fit into different layouts.</p><p>Another thing I like is that it tells you when something actually went wrong. If a breaker trips, you know it. Big yellow bar. You&#8217;re not left chasing a dead circuit or guessing which fuse quietly gave up.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qwau!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qwau!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qwau!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qwau!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qwau!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qwau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg" width="400" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:97013,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185737253?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qwau!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qwau!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qwau!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qwau!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F609decd6-2649-4d85-93d9-dcf246898fd1_400x480.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The reason I chose thermal breakers in vehicle wiring is simple: they make more sense than fuses. Fuses are fine on a bench or in a factory harness where they&#8217;re trying to save a buck. In my trucks, I can do better. When a fuse blows, you&#8217;re dead until you replace it, assuming you even have the right spare. If you don&#8217;t, you start playing MacGyver, and that&#8217;s when bad decisions get made.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!N95N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N95N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 424w, https://substackcdn.com/image/fetch/$s_!N95N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 848w, https://substackcdn.com/image/fetch/$s_!N95N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 1272w, https://substackcdn.com/image/fetch/$s_!N95N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N95N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic" width="400" height="272" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:272,&quot;width&quot;:400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:62911,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/heic&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185737253?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!N95N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 424w, https://substackcdn.com/image/fetch/$s_!N95N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 848w, https://substackcdn.com/image/fetch/$s_!N95N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 1272w, https://substackcdn.com/image/fetch/$s_!N95N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F256a500a-a063-4d1c-b631-1befac6986fa_400x272.heic 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;ve even used these breakers on solar panels, and they work just as well there, same low-voltage DC problem, same need for protection you can reset or isolate without digging for parts.</p><h4>Adhesive Lined Heat Shrink Tubing</h4><p>The last item in my ongoing romance with marine parts comes from <strong><a href="https://www.navico.com/ancor/products">Ancor</a></strong>, and it&#8217;s one of those things you don&#8217;t really appreciate until you go back and inspect your work a few years later.</p><p>Heat shrink is one of those things people treat like an afterthought, but I think it&#8217;s just as important as the thing it&#8217;s covering. The reason is simple: most wiring failures don&#8217;t start at the conductor, they start at the edge of the connection. That&#8217;s where moisture creeps in, vibration works things loose, and corrosion starts eating copper one strand at a time. Heat shrink doesn&#8217;t just make thing look tidy, it seals the joint, provide strain relief, and keeps the connection from flexing itself to death.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!B9FJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!B9FJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!B9FJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg" width="600" height="452" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:452,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:106378,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185737253?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!B9FJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!B9FJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F259dbf29-4af2-4ad5-9926-54a9c0a76826_600x452.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Ancor Marine Grade Adhesive Lined Heat Shrink</figcaption></figure></div><p>Most wiring failures don&#8217;t happen because the copper is bad. They happen because the wire keeps bending in the same place until it finally gives up. At a crimp or splice, the wire goes from stiff to flexible, and all the movement concentrates right at that transition. Vibration, temperature changes, and normal harness motion work that spot until the copper <strong>work-hardens</strong> and cracks, even while the insulation still looks fine.</p><p>This is why properly executed crimps are preferred over solder anywhere wiring is exposed to movement. When you solder stranded wire, the solder wicks up into the strands and turns a flexible conductor into a rigid section. The wire still moves, but now all the bending gets pushed to the first unsoldered spot, simply relocating the failure instead of fixing it.</p><p>The aircraft industry learned this a long time ago and wrote it into the standards.  Specifications like <a href="https://www.tefcap.com/heat-shrinkable-tubing/">MIL-T-23053</a> and <a href="https://www.sea-wire.com/m23053/">SAE AS23053</a> define heat shrink not just as insulation, but as a <strong>mechanical strain-relief system</strong>. That&#8217;s why <strong>adhesive-lined heat shrink</strong> is used at terminations and splices. The adhesive bonds to the insulation past the crimp, stiffening the wire gradually, controlling where flex is allowed to occur, and preventing conductor fatigue at the rigid-to-flex transition. <strong>Plain heat shrink can&#8217;t do that. It shrinks, but it doesn&#8217;t support.</strong></p><p>The other half of the job is environmental sealing. Corrosion isn&#8217;t mysterious, it&#8217;s basic chemistry. Copper exposed to oxygen and moisture forms copper oxides, and those oxides are poor conductors. Once that starts, resistance goes up at the joint. Higher resistance means localized heating under load, which accelerates oxidation even more. Add salt, dirt, or fertilizer residue and you&#8217;ve built a tiny electrochemical cell that eats copper for breakfast.</p><p>Adhesive-lined heat shrink shuts that whole process down by removing the reactants. When the adhesive melts and seals, it blocks oxygen, moisture, and contaminants from ever reaching the metal. No electrolyte, no oxidation, no slow-motion failure. This isn&#8217;t about making wiring look nice. It&#8217;s about stopping the chemistry before it starts.</p><p>The last piece is workmanship. It&#8217;s not just about looks, it&#8217;s a signal. It tells you someone understands the science behind strain relief, corrosion, and why wiring fails over time, and that they actually give a damn about what they&#8217;re building. Poor workmanship often isn&#8217;t just cosmetic. It&#8217;s a reliable predictor that something is going to fail, usually at the worst possible time.</p><p>Now comes the part everyone thinks they already know, and where most people still screw it up: actually applying heat shrink correctly. </p><ol><li><p><strong>Use a heat gun</strong>. <br>Not a lighter, not a torch, flamethrower or whatever happens to be nearby <em>(you know who you are).</em>  Open flames overheat one side, scorch insulation, and boil the adhesive before it has a chance to flow.  A heat gun gives you even, controlled heat, which is exactly what adhesive-lined heat shrink actually needs to work.</p></li></ol><ol start="2"><li><p><strong>Start in the middle and work outward.</strong></p><p>Heat the center of the tubing first, then move toward the ends. This pushes air and molten adhesive out instead of trapping it inside the joint. If you heat the ends first, you&#8217;re likely to trap air or adhesive, which shows up later as blisters or bubbles that never really seal.</p></li><li><p><strong>Watch for adhesive flow.</strong></p><p>You want to see a small, even bead of adhesive appear at both ends of the tubing. That bead is proof that the seal formed. No bead usually means no seal.</p></li><li><p><strong>Keep the heat moving.</strong></p><p>Don&#8217;t park the gun in one spot. Steady, even heat lets the tubing recover without blistering or burning. If it bubbles, scorches, or smells bad, you&#8217;ve overcooked it.</p></li><li><p><strong>Think strain relief, not just coverage.</strong></p><p>The tubing should extend onto the wire insulation far enough to support it and move the flex point away from the crimp or splice. Covering the joint alone misses the point.</p></li><li><p><strong>Let it cool before touching it.</strong></p><p>Don&#8217;t tug, flex, or move the wire while it&#8217;s hot. Let the adhesive set as it cools so the joint locks in mechanically.</p></li></ol><p>Done right, adhesive-lined heat shrink becomes part of the connection. Done wrong, it&#8217;s just melted plastic that smells bad.</p><p>Like anything else, your choice of tools often limits how good a job you can actually do. Cheap heat guns tend to run either too cold or way too hot, with nothing in between. I&#8217;ve burned through enough of them to know they&#8217;re fine for stripping paint, but not much else.  When you&#8217;re working with adhesive-lined heat shrink, brute force isn&#8217;t the goal. Control is.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UTsN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UTsN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UTsN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg" width="600" height="452" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:452,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:119631,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://www.vinthewrench.com/i/185737253?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UTsN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UTsN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32854f89-cb26-4b9f-8136-6d23fbb0e733_600x452.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Makita HG6530VK Variable Temperature Heat Gun Kit</figcaption></figure></div><p>I eventually landed on the <strong><a href="https://www.amazon.com/dp/B07QJMH2F4">Makita HG6530VK</a></strong>, and it stuck. It gives me real control over both airflow and heat. The variable temperature lets me shrink tubing evenly and get the adhesive to flow without scorching insulation or boiling the liner. It also comes with several attachments, including a curved nozzle specifically designed for heat shrink. For me, the digital display isn&#8217;t a gimmick, it lets me repeat the same results every time instead of guessing.</p><h4>Do it right. Walking home sucks.</h4><p>None of this is exotic or clever. It&#8217;s just choosing parts that were designed for environments where failure isn&#8217;t an option and using them correctly. Boats, trucks, and farm equipment all fight the same enemies: vibration, moisture, corrosion, and time. Do this right and the electrical system disappears into the background, which is exactly where it belongs. When you&#8217;re cold, tired, and miles from pavement, the best wiring is the kind you don&#8217;t have to think about.</p><p>As I say in each of these pieces, there are no sponsorships here. Don&#8217;t ask for one. No affiliate links. No favors. I&#8217;m pretty sure most of these companies have never heard of me, and that&#8217;s fine. I&#8217;m writing about these parts because they earned their place in my shop by working, not because anyone asked or paid for it.</p><div><hr></div><p>If you like building things and want to know why certain parts get chosen and what actually survives outside a lab, you&#8217;ll probably like <a href="https://www.vinthewrench.com/p/its-about-independence">the rest of what I write</a>. Sharing it helps real people find the work. The algorithm can do whatever it wants.</p><p></p>]]></content:encoded></item></channel></rss>