<?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"><channel><title><![CDATA[mihai]]></title><description><![CDATA[mihai]]></description><link>https://mihailazar.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 21 Oct 2026 19:07:06 GMT</lastBuildDate><atom:link href="https://mihailazar.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[ESP8266 + SIM800L: Simple Guide to Sending SMS with Arduino IDE]]></title><description><![CDATA[Send SMS with ESP8266 NodeMCU + SIM800L GSM! Step-by-step Arduino tutorial for IoT projects, network tests, and easy GSM setup.]]></description><link>https://mihailazar.hashnode.dev/esp8266-sim800l-simple-guide-to-sending-sms-with-arduino-ide</link><guid isPermaLink="true">https://mihailazar.hashnode.dev/esp8266-sim800l-simple-guide-to-sending-sms-with-arduino-ide</guid><category><![CDATA[SIM800L]]></category><category><![CDATA[ESP8266]]></category><category><![CDATA[ArduinoIDE]]></category><category><![CDATA[C++]]></category><category><![CDATA[sms]]></category><dc:creator><![CDATA[Mihai Lazar]]></dc:creator><pubDate>Tue, 23 Sep 2025 18:54:04 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-adding-gsm-connectivity-to-esp8266-projects-with-sim800l">Adding GSM Connectivity to ESP8266 Projects with SIM800L</h1>
<h2 id="heading-introduction">Introduction</h2>
<p>Cellular communication is a powerful addition to any IoT project. With a <strong>SIM800L GSM module</strong> connected to an <strong>ESP8266 NodeMCU</strong>, you can send and receive SMS messages, monitor devices remotely, or even trigger actions from anywhere with cellular coverage.</p>
<p>Instead of overloading this post with code, we focus here on the concept and physical setup. All source code, including test sketches and main scripts, is available on our <a target="_blank" href="https://github.com/yourusername/ESP8266_SIM800L">GitHub repository</a>.</p>
<hr />
<h2 id="heading-concept">Concept</h2>
<p>The main idea is to use the ESP8266 as the controller and the SIM800L as the GSM interface. The ESP8266 can:</p>
<ul>
<li><p>Send SMS alerts</p>
</li>
<li><p>Receive SMS commands</p>
</li>
<li><p>Monitor network status</p>
</li>
<li><p>Forward commands from other sensors or devices</p>
</li>
</ul>
<p>The SIM800L responds to <strong>AT commands</strong> sent from the ESP8266. By sending the right commands, the ESP8266 can control the SIM800L to send messages, check signal strength, or attach to the cellular network.</p>
<hr />
<h2 id="heading-hardware-setup">Hardware Setup</h2>
<p>Here’s what you need:</p>
<ul>
<li><p>ESP8266 NodeMCU – acts as the main controller</p>
</li>
<li><p>SIM800L GSM Module – handles cellular communication</p>
</li>
<li><p>Stable 4V power supply capable of 2A for the SIM800L (3,7 V - 4,5V)</p>
</li>
<li><p>LM2596 step-down module with display</p>
</li>
<li><p>GSM antenna</p>
</li>
<li><p>Connecting wires ( quality threads)</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758655088293/a1b89925-3fbb-4508-94c5-0a81cb4280d5.png" alt class="image--center mx-auto" /></p>
<h3 id="heading-wiring-overview">Wiring Overview</h3>
<div class="hn-table">
<table>
<thead>
<tr>
<td>SIM800L</td><td>ESP8266 NodeMCU</td></tr>
</thead>
<tbody>
<tr>
<td>5V/2A power supply</td><td>5V/2A power supply</td></tr>
<tr>
<td>VCC (4.3V)</td><td>external 5V/2A power supply</td></tr>
<tr>
<td>GND</td><td>Common ground</td></tr>
<tr>
<td>TX</td><td>D6</td></tr>
<tr>
<td>RX</td><td>D7</td></tr>
<tr>
<td>RST</td><td>Optional or leave unconnected</td></tr>
<tr>
<td>Vin ESP</td><td>5V power supply</td></tr>
</tbody>
</table>
</div><p>⚠️ <strong>Important:</strong> Never power the SIM800L directly from the ESP8266 3.3V pin. Use a dedicated supply with common ground.</p>
<hr />
<h2 id="heading-workflow">Workflow</h2>
<ol>
<li><p>Power the SIM800L</p>
</li>
<li><p>Connect ESP8266 TX/RX to SIM800L RX/TX .</p>
</li>
<li><p>Send AT commands from the ESP8266 to test network registration and SIM card status.</p>
</li>
<li><p>Send or receive SMS messages using simple command functions from the ESP8266.</p>
</li>
<li><p>Integrate additional sensors or triggers in your IoT project to send alerts or data via SMS.</p>
</li>
</ol>
<p>This approach keeps your code modular: you can start with basic network tests and SMS sending, then add more advanced IoT functions as your project grows.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758655483102/2dd725a4-ffa3-4c06-8389-e72caf8cbd60.jpeg" alt class="image--center mx-auto" /></p>
<h1 id="heading-sim800-module-led-behavior">SIM800 Module LED Behavior</h1>
<p>The LED on the <strong>SIM800</strong> module indicates the module's status and GSM network connection through different types of blinking. Here's a useful summary:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>SIM800 Module State</td><td>LED PWR (Indicator)</td><td>Notes</td></tr>
</thead>
<tbody>
<tr>
<td>Module off</td><td>Off</td><td>The module has no power or is turned off via AT command</td></tr>
<tr>
<td>Powering on / Reset</td><td>On once, then quickly 2–3 blinks</td><td>The module is initializing the GSM network</td></tr>
<tr>
<td>No network</td><td>Slow blink (~2s ON, 2s OFF)</td><td>The module is on but not connected to the GSM network</td></tr>
<tr>
<td>Network found, but signal unstable</td><td>Fast blink (~0.2s ON, 0.2s OFF)</td><td>The module is searching for the best cell tower (BTS)</td></tr>
<tr>
<td>Connected to GSM network</td><td>Normal blink (~1s ON, 1s OFF)</td><td>The module works normally and can send/receive SMS or calls</td></tr>
<tr>
<td>Sleep / Low power mode</td><td>Very slow blink or off</td><td>The module is saving power</td></tr>
</tbody>
</table>
</div><blockquote>
<p>💡 Practical note: Some SIM800 modules have the LED labeled <strong>NET</strong> instead of <strong>PWR</strong>, but the blinking logic is the same.</p>
</blockquote>
<hr />
<h2 id="heading-next-steps">Next Steps</h2>
<p>All the working Arduino sketches, including a connection test and main SMS sending code, are available in our GitHub repository:</p>
<p>👉 <a target="_blank" href="https://github.com/mihailazar87/ESP8266-SIM800L-GSM">ESP8266 + SIM800L GitHub Repository</a></p>
<p>The GitHub contains:</p>
<ul>
<li><p><code>connection_test</code> – verify SIM800L is responding and attach to the network</p>
</li>
<li><p><code>ESP8266_SIM800L</code> – main sketch to send SMS automatically</p>
</li>
<li><p>Example <code>secrets.h</code> to store your phone number securely</p>
</li>
</ul>
<hr />
<h2 id="heading-conclusion">Conclusion</h2>
<p>Adding GSM capabilities to ESP8266 projects allows you to create IoT devices that can communicate anywhere. With the SIM800L module and a few connections, you can start sending and receiving SMS in minutes.</p>
<p>For full code and setup instructions, check out the GitHub link above.</p>
]]></content:encoded></item><item><title><![CDATA[Water Level & Volume Monitoring with ESP8266]]></title><description><![CDATA[Monitor your water tank with ESP8266: 4–20 mA sensor, OLED display, and MQTT integration for Home Assistant dashboards.]]></description><link>https://mihailazar.hashnode.dev/water-level-and-volume-monitoring-with-esp8266</link><guid isPermaLink="true">https://mihailazar.hashnode.dev/water-level-and-volume-monitoring-with-esp8266</guid><category><![CDATA[WaterMonitoring]]></category><category><![CDATA[mqtt]]></category><category><![CDATA[iot]]></category><category><![CDATA[ESP8266]]></category><category><![CDATA[homeassistant]]></category><dc:creator><![CDATA[Mihai Lazar]]></dc:creator><pubDate>Mon, 22 Sep 2025 16:01:35 GMT</pubDate><content:encoded><![CDATA[<p>When I started storing water in a 2000l horizontal cylindrical tank, I quickly realized I had no easy way to check how much water was inside.<br />Commercial level sensors were either too expensive or overkill, and I also wanted the data integrated with my Home Assistant server.<br />So I built my own monitoring system using an ESP8266, a 4–20 mA hydrostatic probe, and a bit of DIY electronics</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758636056955/50dfaaef-0097-42bf-bde3-5a2b47ec8063.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-from-idea-to-plan">From Idea to Plan</h2>
<p>The goal was to use a 4–20 mA current probe to measure changes in the water level and convert those readings into the tank’s total volume in liters.</p>
<p>I also wanted the data to be available both locally on a small OLED display and remotely through Home Assistant.</p>
<hr />
<h2 id="heading-hardware-choices">Hardware Choices</h2>
<p>After some experimentation I settled on:</p>
<ul>
<li><p><strong>ESP8266 (NodeMCU)</strong> – small, Wi-Fi ready, and with a built-in ADC.</p>
</li>
<li><p><strong>Hydrostatic probe 4–20 mA 1m(measuring), 10m cable</strong> – outputs a current proportional to water pressure.</p>
</li>
<li><p><strong>10 Ω shunt resistor</strong> – to turn that current into a measurable voltage for the ESP.</p>
</li>
<li><p><strong>0.96" OLED (SSD1306)</strong> – for instant, on-site readings.</p>
</li>
<li><p><strong>DC-DC LM2596 step-down converter</strong> – takes the 24 V supply down to a safe 5 V.</p>
</li>
<li><p>**POWER SUPPLY 24V ** .</p>
</li>
<li><p>A sturdy <strong>PVC junction box</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-wiring-it-all-up">Wiring It All Up</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1759567892827/80d9ea3e-f183-4969-a3af-60a31594aef0.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758635816460/df306871-a450-4864-879f-d04a47ce1416.png" alt class="image--center mx-auto" /></p>
<p>The probe is powered from the same 24 V line that feeds the whole unit.<br />Its negative lead passes through the 10 Ω shunt resistor, and the ESP8266 reads the voltage across that resistor.<br />Ohm’s law (I = V / 10 Ω) gives the probe current, which is proportional to the water level.</p>
<p>A small prototyping PCB holds the ESP8266, the shunt, and one screw-terminal connector so I can attach or remove wires without soldering each time.</p>
<hr />
<h2 id="heading-enclosure-and-assembly">Enclosure and Assembly</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758553848744/a67efdd3-c6ec-4615-928f-1f7dfe28b063.jpeg" alt class="image--center mx-auto" /></p>
<p>Inside the PVC box:</p>
<ul>
<li><p>A power jack is glued into the side wall.</p>
</li>
<li><p>The OLED display is mounted on the front panel of the PVC enclosure, attached using a hot glue gun.</p>
</li>
<li><p>The prototyping board acts as a custom socket for the ESP. The prototype board connections, the shunt resistor, and the screw terminal connector are soldered with a soldering station..</p>
<p>  <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758554034250/d2df71f4-a602-44db-987c-1f3c2966bf0c.jpeg" alt class="image--center mx-auto" /></p>
</li>
</ul>
<p>Probe:</p>
<ul>
<li>The probe is installed 10 cm above the bottom of the tank.</li>
</ul>
<hr />
<h2 id="heading-firmware-tasks">Firmware Tasks</h2>
<p>The ESP8266 handles all the measurements and calculations:</p>
<ul>
<li><p>Sample ADC voltage to determine the probe current.</p>
</li>
<li><p>Map 4 mA to “empty” and 20 mA to “full” as calibration points. The actual probe measurements range from 3.6 mA to 19.7 mA, which is caused by the quality of the probe.</p>
</li>
<li><p>Convert the measured current into the water height and total volume in liters, compensating for the tank’s horizontal cylindrical geometry.</p>
</li>
<li><p>Update the OLED display with live readings of current (mA), height (cm), and volume (L).</p>
</li>
<li><p>Send measurements over MQTT for Home Assistant integration and provide optional JSON endpoints for other dashboards.</p>
</li>
</ul>
<hr />
<h2 id="heading-calibration-notes">Calibration Notes</h2>
<p>During testing I noticed that the probe didn’t output a perfect 4–20 mA range.<br />To compensate for this, the firmware includes a two-point calibration:</p>
<ul>
<li><p><strong>Empty calibration</strong> – sets the actual current reading when the tank is empty.</p>
</li>
<li><p><strong>Full calibration</strong> – sets the current when the tank is completely full.</p>
</li>
</ul>
<p>The web interface provides simple Calibrate Empty and Calibrate Full buttons so I can quickly adjust these values.<br />This ensures that the displayed water height and calculated volume remain accurate even if the probe drifts or the supply voltage varies.</p>
<hr />
<h2 id="heading-home-assistant-integration">Home Assistant Integration</h2>
<p>To bring all the measurements into my smart-home dashboard,<br />the ESP8266 publishes sensor data over MQTT.<br />Home Assistant subscribes to these MQTT topics and displays:</p>
<ul>
<li><p>Current probe reading (mA)</p>
</li>
<li><p>Calculated water height (cm)</p>
</li>
<li><p>Total volume (liters)</p>
</li>
<li><p>Total volume (%)</p>
</li>
</ul>
<p>This way the tank level appears alongside the rest of my home-automation sensors,<br />and I can create automations—like alerts when the water drops below a threshold—without any extra hardware.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758555975800/32f87229-6549-4764-b605-fbfa062007af.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1758556016101/b5d23e81-3a3e-4a29-8180-2926e2408922.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-results">Results</h2>
<p>The system has been running reliably, giving real-time volume data.<br />Now I can glance at the OLED or check Home Assistant on my phone to know exactly how much water is left.</p>
<hr />
<h2 id="heading-next-steps">Next Steps</h2>
<p>I’m considering:</p>
<p>Mount physical calibration buttons on the PVC enclosure so the tank can be re-calibrated (empty / full) without opening the box or using the web interface.</p>
<p>Build a 3D-printed case and mount a larger display.</p>
<p>This little project turned a need into a dependable, connected tool built from inexpensive parts and a weekend of tinkering.</p>
<h2 id="heading-source-code">Source Code</h2>
<p>The complete firmware and calibration logic are available on my GitHub repository:</p>
<p>👉 <a target="_blank" href="https://github.com/mihailazar87/esp-water-level-measurement">https://github.com/mihailazar87/esp-water-level-measurement</a></p>
<p>You’ll find the Arduino source code, configuration files and instructions for flashing the ESP8266.</p>
]]></content:encoded></item></channel></rss>