<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Emelie Fogelström</title>
    <description>The latest articles on DEV Community by Emelie Fogelström (@emeliefogelstrom).</description>
    <link>https://dev.to/emeliefogelstrom</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3955192%2Fe72cc02b-fcb3-4861-82b9-1bc12557e1c5.png</url>
      <title>DEV Community: Emelie Fogelström</title>
      <link>https://dev.to/emeliefogelstrom</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emeliefogelstrom"/>
    <language>en</language>
    <item>
      <title>FenceGuard, part 2: the sensor arrived — and it works</title>
      <dc:creator>Emelie Fogelström</dc:creator>
      <pubDate>Fri, 05 Jun 2026 21:15:57 +0000</pubDate>
      <link>https://dev.to/emeliefogelstrom/fenceguard-part-2-the-sensor-arrived-and-it-works-49mp</link>
      <guid>https://dev.to/emeliefogelstrom/fenceguard-part-2-the-sensor-arrived-and-it-works-49mp</guid>
      <description>&lt;p&gt;&lt;em&gt;First contact: a PIR sensor, a LoPy4, and a loop that prints 0s and 1s.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flx57ndqnpv8ass2cczrn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flx57ndqnpv8ass2cczrn.png" alt="Mail for me, the sensor has arrived!" width="800" height="570"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;The sensor arrived yesterday. A PIR motion detector — passive infrared, the same basic technology used in every security light and burglar alarm since the 1980s. Cheap, proven, low-power. A good place to start.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware: HC-SR501
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79nin6oqcgibmg0ue5qd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79nin6oqcgibmg0ue5qd.jpg" alt="HC-SR501" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The sensor is an HC-SR501 — a standard PIR module with two adjustable potentiometers and a jumper for trigger mode.&lt;/p&gt;

&lt;p&gt;For testing I've set it to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Time delay:&lt;/strong&gt; counter-clockwise to minimum (~5 sec repeat inhibit time)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sensitivity:&lt;/strong&gt; ~3m range&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trigger mode:&lt;/strong&gt; L (single trigger)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Single trigger means the output goes high once per detection event, then stays low until the inhibit timer expires. That suits this phase of testing, I want clean, discrete events, not a continuous high signal while something is moving.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft89lqzk1qlseycds8ugf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft89lqzk1qlseycds8ugf.jpg" alt="HC-SR501 connected to LoPy4" width="799" height="977"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  First connection
&lt;/h2&gt;

&lt;p&gt;I connected it to the LoPy4's expansion board and wrote the simplest possible test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;machine&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;

&lt;span class="n"&gt;pir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;machine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Pin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;P20&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;machine&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pir&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;value&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Poll the pin every two seconds, print the value. Walk in front of it: &lt;code&gt;1&lt;/code&gt;. Walk away and wait: &lt;code&gt;0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this doesn't tell me yet
&lt;/h2&gt;

&lt;p&gt;A stream of 1s and 0s is a long way from "there's a fox near the fence." Right now I have no idea:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;how long a real motion event lasts versus a false trigger&lt;/li&gt;
&lt;li&gt;how the sensor behaves in wind, or when temperature changes rapidly&lt;/li&gt;
&lt;li&gt;whether polling every 2 seconds is too slow, too fast, or about right&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's what the next step is for. Tomorrow I'm replacing the raw values with timestamps and logging &lt;em&gt;when&lt;/em&gt; something happens rather than just &lt;em&gt;that&lt;/em&gt; something happened. Once I have timestamped events I can start looking at patterns.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;FenceGuard is a project I'm building in public. I'll be documenting hardware choices, firmware, and data analysis as I go. Follow along if that's your kind of thing.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>iot</category>
      <category>hardware</category>
      <category>micropython</category>
      <category>beginners</category>
    </item>
    <item>
      <title>FenceGuard, part 1: first sensor ordered and why I'm starting small</title>
      <dc:creator>Emelie Fogelström</dc:creator>
      <pubDate>Tue, 02 Jun 2026 19:52:41 +0000</pubDate>
      <link>https://dev.to/emeliefogelstrom/fenceguard-part-1-first-sensor-ordered-and-why-im-starting-small-905</link>
      <guid>https://dev.to/emeliefogelstrom/fenceguard-part-1-first-sensor-ordered-and-why-im-starting-small-905</guid>
      <description>&lt;p&gt;I keep chickens and Muscovy ducks on a small farm in the Swedish countryside. They roam freely around the yard while we're still building proper fencing. Over the years we've had our share of losses: a fox has taken both chickens and ducks on several occasions, and four years ago a neighbour's dog got in and killed our entire flock while we were away shopping for groceries. I started FenceGuard because I wanted an early warning system, not a camera I'd have to check manually every day.&lt;/p&gt;

&lt;p&gt;The full vision is a LoRa mesh of sensor nodes, edge ML running TensorFlow Lite, SMHI weather integration to filter out false alarms from wind and rain, and two product variants — one for smaller predators like foxes and hawks, one for wolves and bears. That's still exactly where this is heading. But good engineering means validating your assumptions before building on top of them, so I'm starting where the real unknowns are: the data itself.So I'm deliberately starting lean and documenting the whole process here.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I've ordered
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The first component just shipped:&lt;/strong&gt; a PIR motion sensor. That's it. One sensor. I already have a LoPy4 development board on my desk (a leftover from an earlier weather station project), so the plan is to hook those two together and start getting data before I spend anything else.&lt;/p&gt;

&lt;p&gt;I'm not buying a new ESP32 right now, the LoPy4 is perfectly capable for early prototyping, and I'd rather validate the concept first and spend money second.&lt;/p&gt;

&lt;h2&gt;
  
  
  The actual hard problem: signal vs. noise
&lt;/h2&gt;

&lt;p&gt;Here's what I keep coming back to: a PIR sensor doesn't know the difference between a fox and a branch moving in the wind. Before any machine learning, before any LoRa mesh, before any slick mobile app, I need to understand the raw data. What does a real motion event look like in this environment? How does wind noise show up? What happens at different temperatures (PIR sensitivity is temperature-dependent)? What does a dog walking past look like versus a human versus a small animal, like a hen or duck?&lt;/p&gt;

&lt;p&gt;That's the focus of the next few weeks. No AI. No complex architecture. Just a sensor, a dev board, and logging, trying to figure out what signal I'm actually working with, before I build anything on top of it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The question I want to answer first:&lt;/strong&gt; can I reliably distinguish real motion events from environmental noise, using only a PIR sensor and a timestamp?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;What's next&lt;/strong&gt;&lt;br&gt;
Once the sensor arrives, I'll write up the hardware setup and share the first data. After that, depending on what the data looks like, I'll start working on filtering logic. Probably some combination of timing windows, threshold comparisons, and maybe cross-referencing with a simple wind/temperature sensor down the line.&lt;/p&gt;

&lt;p&gt;If you're also working on something similar like livestock monitoring, perimeter detection, or outdoor IoT in general, I'd love to hear how you've tackled the noise problem. Drop a comment below.&lt;/p&gt;

&lt;p&gt;FenceGuard is an open development project. I'll be documenting hardware choices, firmware and data analysis. Follow along if that's your kind of thing.&lt;/p&gt;

</description>
      <category>iot</category>
      <category>hardware</category>
      <category>micropython</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Building IoT systems during parental leave - my IoT and embedded systems journey</title>
      <dc:creator>Emelie Fogelström</dc:creator>
      <pubDate>Thu, 28 May 2026 09:04:54 +0000</pubDate>
      <link>https://dev.to/emeliefogelstrom/building-iot-systems-during-parental-leave-my-iot-and-embedded-systems-journey-1pk8</link>
      <guid>https://dev.to/emeliefogelstrom/building-iot-systems-during-parental-leave-my-iot-and-embedded-systems-journey-1pk8</guid>
      <description>&lt;p&gt;Hi, I’m Emelie.&lt;/p&gt;

&lt;p&gt;I’m rebuilding my technical skills during parental leave through IoT and embedded projects.&lt;/p&gt;

&lt;p&gt;One of my first experiences with IoT was a weather station built during university. It introduced me to working with sensors, data collection, and connected systems.&lt;/p&gt;

&lt;p&gt;Now it’s time to build again. My first goal is to prototype a simple wildlife and fence monitoring system using sensors, MQTT, and LoRa.&lt;/p&gt;

&lt;p&gt;This was one of my earlier IoT projects:&lt;br&gt;
&lt;a href="https://hackmd.io/@ehTrKNe5RYyySf6QXbWMWA/ByVCoGFAU" rel="noopener noreferrer"&gt;https://hackmd.io/@ehTrKNe5RYyySf6QXbWMWA/ByVCoGFAU&lt;/a&gt;&lt;/p&gt;

</description>
      <category>iot</category>
      <category>devlog</category>
      <category>learning</category>
      <category>embedded</category>
    </item>
  </channel>
</rss>
