<?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: Khader Qaabar</title>
    <description>The latest articles on DEV Community by Khader Qaabar (@khader_qaabar_4bba14e148c).</description>
    <link>https://dev.to/khader_qaabar_4bba14e148c</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%2F4028998%2F9f8e50d6-9a60-4abc-8f02-b14f2c7b3115.png</url>
      <title>DEV Community: Khader Qaabar</title>
      <link>https://dev.to/khader_qaabar_4bba14e148c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khader_qaabar_4bba14e148c"/>
    <language>en</language>
    <item>
      <title>The Servo Motors Were Killing My ESP32 (And I Didn't Realize It)</title>
      <dc:creator>Khader Qaabar</dc:creator>
      <pubDate>Mon, 31 Aug 2026 05:51:07 +0000</pubDate>
      <link>https://dev.to/khader_qaabar_4bba14e148c/the-servo-motors-were-killing-my-esp32-and-i-didnt-realize-it-1gg6</link>
      <guid>https://dev.to/khader_qaabar_4bba14e148c/the-servo-motors-were-killing-my-esp32-and-i-didnt-realize-it-1gg6</guid>
      <description>&lt;p&gt;When I started building an IoT smart parking system on an ESP32, &lt;br&gt;
I expected the hardest part to be the software — MQTT messaging, &lt;br&gt;
the real-time dashboard, the sensor logic. I did not expect my &lt;br&gt;
biggest engineering problem to be &lt;em&gt;electricity itself&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Symptom
&lt;/h2&gt;

&lt;p&gt;My setup had a 7-sensor infrared array feeding into the ESP32, &lt;br&gt;
which controlled multiple servo motors to open and close parking &lt;br&gt;
gates. The moment I wired the servos directly to the same power &lt;br&gt;
rail as the ESP32, things got weird:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The display would randomly turn off&lt;/li&gt;
&lt;li&gt;The servos themselves wouldn't move reliably&lt;/li&gt;
&lt;li&gt;Programming the open/close angle logic became a nightmare — 
behavior that should have been simple felt inconsistent and 
unpredictable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At first, I assumed it was a code problem. It wasn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  Isolating the Problem
&lt;/h2&gt;

&lt;p&gt;Instead of guessing, I disconnected the servo motors from the &lt;br&gt;
circuit first — and the ESP32 and display immediately behaved &lt;br&gt;
normally again. That confirmed the servos were the source of the &lt;br&gt;
issue, not my code.&lt;/p&gt;

&lt;p&gt;I brought the problem to a teammate and did some research to &lt;br&gt;
understand the &lt;em&gt;why&lt;/em&gt;, not just patch the symptom.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Actual Cause: Inrush Current
&lt;/h2&gt;

&lt;p&gt;Servo motors, especially under load, draw a large spike of current &lt;br&gt;
the moment they activate — far more than their steady-state &lt;br&gt;
operating current. This is called &lt;strong&gt;inrush current&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When multiple servos pulled that current spike from the same power &lt;br&gt;
rail as the ESP32, it caused a &lt;strong&gt;voltage drop (brownout)&lt;/strong&gt; on the &lt;br&gt;
line. The ESP32 is sensitive to voltage stability — even a brief &lt;br&gt;
dip is enough to reset it or disrupt connected peripherals like &lt;br&gt;
the display. That's exactly why the screen kept turning off: it &lt;br&gt;
wasn't a display bug, it was a power problem wearing a display bug's &lt;br&gt;
disguise.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: Power Domain Separation
&lt;/h2&gt;

&lt;p&gt;The fix wasn't a smarter piece of code — it was an isolated servo &lt;br&gt;
shield to physically separate the servo power domain from the &lt;br&gt;
ESP32's logic power domain. The servos now draw their current spikes &lt;br&gt;
from their own supply, instead of dragging down the rail the ESP32 &lt;br&gt;
depends on.&lt;/p&gt;

&lt;p&gt;Once that separation was in place:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The brownout resets disappeared completely&lt;/li&gt;
&lt;li&gt;The display stopped randomly turning off&lt;/li&gt;
&lt;li&gt;The servo angle control — which had felt buggy and inconsistent 
before — suddenly worked exactly as programmed, because the logic 
was never actually broken. It was just running on unstable power.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Lesson
&lt;/h2&gt;

&lt;p&gt;The most valuable part of this bug wasn't the fix itself — it was &lt;br&gt;
realizing the bug wasn't in my code at all. When symptoms show up &lt;br&gt;
in seemingly unrelated places (a display glitching, motor logic &lt;br&gt;
acting "buggy"), it's worth stepping back and asking whether the &lt;br&gt;
real problem is one layer lower than where the symptoms appear.&lt;/p&gt;

&lt;p&gt;In embedded systems, software and hardware failures can look &lt;br&gt;
identical from the outside. Isolating variables — literally &lt;br&gt;
disconnecting components one at a time — is still the fastest way &lt;br&gt;
to tell them apart.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
