<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Compoden Electronics on Medium]]></title>
        <description><![CDATA[Stories by Compoden Electronics on Medium]]></description>
        <link>https://medium.com/@compodenin?source=rss-27757b6edd77------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*60Iaumc4819424HvOeu7Hw.png</url>
            <title>Stories by Compoden Electronics on Medium</title>
            <link>https://medium.com/@compodenin?source=rss-27757b6edd77------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:45:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@compodenin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Idea to Build: An ESP32 Flame-Seeking Spray Turret With Three IR Senso]]></title>
            <link>https://medium.com/@compodenin/idea-to-build-an-esp32-flame-seeking-spray-turret-with-three-ir-senso-1ffcb2d521b8?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ffcb2d521b8</guid>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[electronics]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 04:54:23 GMT</pubDate>
            <atom:updated>2026-11-22T06:37:34.754Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kvzNuQC3BuJImGWQ" /></figure><p>You’ve probably seen the clip: a tiny nozzle swings round, locks onto a lighter flame and mists it out. Under the hood it’s three cheap sensors, a servo and a pump, so we typed the idea into Soldr and let it design the thing.</p><p>Fair warning: this is Soldr’s design, not a finished bench build. Soldr picked the parts, laid out every wire and wrote firmware that compiles for the ESP32-DEVKITC. It flagged the plumbing as unresolved: there’s no spray nozzle or water reservoir in the list, so those are yours to add.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><h3>What you need</h3><h3>Step 1: Wire it up</h3><p>This is Soldr’s wiring diagram from the screenshot above, written out:</p><p>A few things that save you a debugging session:</p><ul><li><strong>Sensors on 3V3.</strong> The flame modules are rated 3.3 to 5V, so from the ESP32’s 3V3 their outputs are already 3.3V logic. Soldr’s diagram only draws OUT on the third sensor; its VCC and GND go to the same 3V3 and GND as the others.</li><li><strong>Muscle stays off the ESP32.</strong> The MG995 can pull over an amp when it moves, so it runs straight from the 5V 5A supply while the ESP32 runs off USB. Never join the supply’s + to the ESP32’s 5V pin. Do share ground: supply -, ESP32 GND, L298N GND and the servo’s brown wire all meet.</li><li><strong>Pull the L298N’s 5V jumper.</strong> Its onboard regulator needs 7V or more to make its own 5V, so with a 5V motor supply Soldr feeds the logic side from the ESP32’s 5V pin instead. Remove the jumper so the two don’t fight.</li><li><strong>Expect a gentle stream.</strong> The L298N drops roughly 2V, so the pump sees about 3V and runs slower than its rated 100 ml/min. Fine for a mist. Only channel A is used; IN3, IN4 and ENB sit idle.</li><li><strong>Diode and plug.</strong> Put the 1N4007 across the pump, band to the wire that goes positive, to catch the switch-off spike. The supply ends in a 5.5 x 2.1 mm centre-positive plug, so use a DC jack to screw-terminal adapter.</li></ul><h3>How it hunts the flame</h3><ul><li>The three sensors sit fixed on the base facing left (45 degrees), centre (90) and right (135). Each has an LM393 comparator and a pot; when it sees enough infrared its output flips and the green LED lights.</li><li>Every 20 ms the ESP32 reads them and steps the servo toward the one that sees the flame, so it slews instead of snapping.</li><li>After the nozzle holds on target for half a second, the pump runs in bursts of up to 4 seconds with 3 second rests.</li><li>If the flame vanishes, it holds its aim for 1.5 seconds, then stops the pump. Move the lighter and it finds it again.</li></ul><h3>Step 2: The code</h3><p>No sketch pasted here, on purpose: we only publish code that comes straight out of a Soldr build, and this firmware lives in the build’s Firmware tab. Soldr compiled that exact sketch for the ESP32-DEVKITC. It needs the ESP32Servo library from the Library Manager, and the timings above are the constants Soldr listed from it (SETTLE_MS 500, BURST_MS 4000, REST_MS 3000, LOST_HOLD_MS 1500). Describe the same idea at <a href="https://soldr.ai/">soldr.ai</a> to get firmware for your own pins, flashable from Chrome or Edge over USB.</p><h3>Step 3: Test it dry first</h3><ol><li>Start dry: pump tube out of the water. Power up and open the Serial Monitor for the first boot.</li><li>With a lighter 30 to 50 cm away, turn each sensor’s pot until its green LED just comes on. Sunlight and halogen bulbs are full of IR, so tune away from windows.</li><li>Sweep the flame left to right. If the servo turns the wrong way, swap the OUT wires on GPIO4 and GPIO14.</li><li>Hold it still: half a second after the nozzle settles the pump should start, and it should stop about 1.5 seconds after the flame goes.</li></ol><h3>Step 4: The plumbing (your part)</h3><p>Put the pump’s inlet tube in a small sealed water container, run the outlet up to the servo horn, fit a fine mist nozzle (one from a spray bottle works) and zip-tie the tube so it moves with the horn.</p><p>Keep the water below and away from the boards and supply. Test on a tiled floor or outdoors with a small flame. This is a learning build, not a safety device, and it doesn’t replace a smoke alarm or a real extinguisher.</p><h3>How Soldr designed this from the idea</h3><p>The idea we typed: <em>“Build a mini fire extinguisher that hunts flames by itself: a small nozzle on a servo that turns toward a lighter flame detected by IR flame sensors, then a small pump sprays a fine water mist to put it out. If the flame moves, it turns and finds it again. Use an ESP32.”</em> From that, Soldr worked out each job (detection, aiming, pump, driver, power, flyback protection), matched parts from the Compoden catalog, wired them pin by pin and wrote and compiled the firmware. It also said plainly what it couldn’t match: the nozzle and the reservoir. Try your own version at <a href="https://soldr.ai/">soldr.ai</a>.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/esp32-flame-seeking-spray-turret-ir-sensors-servo-pump"><em>https://compoden.com</em></a><em> on November 21, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ffcb2d521b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[HC-SR04 + Arduino Uno: Build a Parking Sensor That Beeps Faster as You]]></title>
            <link>https://medium.com/@compodenin/hc-sr04-arduino-uno-build-a-parking-sensor-that-beeps-faster-as-you-cab2a1d1421b?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/cab2a1d1421b</guid>
            <category><![CDATA[arduino-uno]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[electronics]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 04:52:41 GMT</pubDate>
            <atom:updated>2026-11-22T06:37:13.372Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*7xdd7elbjvr0zJg_" /></figure><p>Every car with reverse sensors does the same trick: slow beeps when there’s room, faster beeps as you creep back, and a solid tone when you should really stop. It’s a great first Uno build because you can hear it working the second it’s wired.</p><p>This one is an Uno, an HC-SR04 ultrasonic sensor, an active buzzer and one LED on a mini breadboard. Wave your hand toward the sensor and the beeping speeds up and the LED comes on. We had it running on the bench, and the wiring below is exactly what Soldr laid out for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/0*mhIV_-YpGJTosc25" /></figure><h3>What you need</h3><h3>Step 1: Wire it up</h3><p>This is Soldr’s wiring table from the screenshot above, written out:</p><p>A few things that save you a debugging session:</p><ul><li><strong>Unplug first.</strong> Soldr’s assembly steps start with pulling the USB cable, and they’re right. Wire with the Uno unpowered, grounds first, one wire at a time.</li><li><strong>The HC-SR04 is a 5V part.</strong> That’s a perfect match for the Uno: VCC to 5V, and TRIG and ECHO go straight to the digital pins with no level shifting. (On a 3.3V board like an ESP32 you’d have to drop ECHO down first, but not here.)</li><li><strong>Check your buzzer’s legs.</strong> Soldr’s table shows a three-pin buzzer module (VCC, GND, I/O). The 5V active buzzer in the list above is the two-leg kind: put the + leg on pin 5 and the other leg on GND, and skip the 5V wire. It draws under 30 mA, so the pin can drive it directly.</li><li><strong>LED the right way round.</strong> Long leg (anode) to the resistor, short leg (cathode) to GND. The 220 ohm resistor keeps the current from a 5V pin at about 10 to 15 mA depending on the colour, which is plenty bright.</li></ul><h3>How it measures distance</h3><ul><li>Pin 2 sends a short 10 microsecond pulse to TRIG. The sensor fires a burst of 40 kHz sound and holds ECHO high until the echo comes back.</li><li>The Uno times that ECHO pulse. Sound goes out and back, so the distance in centimetres is roughly the pulse length in microseconds divided by 58.</li><li>That distance sets the gap between beeps: far away means long gaps, close means short ones. The LED on pin 4 comes on as the warning light.</li><li>The sensor is good from about 2 cm to 400 cm with a narrow cone of under 15 degrees, so it sees what’s straight in front of it, not off to the side.</li></ul><h3>Step 2: The code</h3><p>We haven’t pasted a sketch here on purpose. Soldr wrote the firmware for this exact wiring and compiled it for the Uno R3 CH340G before handing it over, and we only publish code that comes straight out of a Soldr build. Describe the same idea at <a href="https://soldr.ai/">soldr.ai</a> and you’ll get the sketch for your own pins. Flash it over USB from the Arduino IDE, then open the Serial Monitor at 115200 baud: Soldr’s version prints a [READY] line once the sensor, LED and buzzer have been set up.</p><h3>Step 3: Test it on the bench</h3><ol><li>Power it from the USB cable and point the sensor at an open space. You should hear slow beeps or nothing, depending on how far the nearest wall is.</li><li>Move your hand slowly toward the sensor. The beeps should get closer together, and the LED should come on.</li></ol><h3>If it misbehaves</h3><ul><li><strong>No beeps at all:</strong> check the buzzer polarity first, then that pin 5 really goes to + (or I/O).</li><li><strong>Distance jumps around:</strong> soft things like cushions and clothes soak up ultrasound, and angled surfaces bounce it away. Aim the sensor square at a flat target.</li><li><strong>Always reads nothing:</strong> TRIG and ECHO are swapped. TRIG is pin 2, ECHO is pin 3.</li><li><strong>Want green-to-red?</strong> Our prompt asked for an LED that changes colour, and Soldr’s plan uses one LED on pin 4. Ask Soldr to add a second LED (say green on another pin) and it will update the wiring and the code together.</li></ul><h3>Taking it to the garage</h3><p>Once it works on the bench, the same circuit can live on a garage wall at bumper height, facing the car, running off any 5V USB phone charger.</p><h3>How Soldr designed this from the idea</h3><p>The idea we typed was simple: a parking sensor on an Arduino Uno with an HC-SR04 that beeps faster as something gets closer. Soldr designs hardware from an idea like that. It picks the parts from the Compoden catalog, assigns every pin, gives you assembly steps, a wiring table and a schematic, then writes the firmware and compiles it for your board. Try your own version at <a href="https://soldr.ai/">soldr.ai</a>.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/hc-sr04-arduino-uno-parking-sensor-beeps-faster-closer"><em>https://compoden.com</em></a><em> on November 20, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cab2a1d1421b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Idea to Build: An ESP32 NASA Desk Display With Asteroid Flybys, Fireballs and Space Weather on a 2.8]]></title>
            <link>https://medium.com/@compodenin/idea-to-build-an-esp32-nasa-desk-display-with-asteroid-flybys-fireballs-and-space-weather-on-a-2-8-41dd518d83ce?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/41dd518d83ce</guid>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[nasa]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 04:56:44 GMT</pubDate>
            <atom:updated>2026-11-22T06:38:25.257Z</atom:updated>
            <content:encoded><![CDATA[<h3>Idea to Build: An ESP32 NASA Desk Display With Asteroid Flybys, Fireballs and Space Weather on a 2.8 Inch TFT</h3><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*b31hiO4ynbDLRrXWEFF4aQ.png" /></figure><p>NASA publishes a lot of its data through open web APIs: today’s asteroid flybys, natural events on Earth, solar storms, fresh photos of the whole planet, even fireballs burning up in the sky. I wanted all of that on my desk, on a little screen that just keeps flipping through it.</p><p>So I described the idea to Soldr: an ESP32 with a 2.8 inch ILI9341 TFT that joins Wi-Fi and shows NASA data. Soldr designed it, picked the parts, drew the wiring and wrote the firmware. A few rounds of “now add this” later it was a six-page dashboard running on my bench. Here’s how it went together.</p><h3>What you need</h3><p>Soldr’s first plan was just four parts: the ESP32, the TFT, jumper wires and a USB cable, all matched to the catalog. I added the OLED later and used a breadboard to keep it tidy.</p><h3>Step 1: Wire it up</h3><p>The diagram above is straight from Soldr’s Wiring tab. The TFT talks SPI to the ESP32:</p><p>The optional OLED goes on I2C:</p><p>A few notes so it works the first time:</p><ul><li><strong>Everything runs on 3.3V.</strong> The ILI9341 board and the SSD1306 both take 3.3V logic, so they connect straight to the ESP32 with no level shifter. Power the board from its micro-USB port.</li><li><strong>CS, DC and RESET can move.</strong> On my bench I had the TFT on CS 4, DC 16 and RESET 17. I told Soldr which pins I’d actually used and it kept them in every later version of the code. SCK, MOSI and MISO stay on the ESP32’s hardware SPI pins (18, 23, 19).</li><li><strong>Leave the touch and SD pins alone.</strong> The 2.8 inch board has touch (T_) and SD_ pins on the other header. This build doesn’t use them.</li></ul><h3>The six pages</h3><ol><li><strong>Asteroids:</strong> today’s 5 closest flybys from NASA’s NeoWs feed, with name, size in metres, miss distance in lunar distances and speed.</li><li><strong>Earth events:</strong> the 5 latest open natural events from EONET (wildfires, storms, volcanoes), title and category.</li><li><strong>Space weather:</strong> coronal mass ejections and geomagnetic storms from the last 3 days, from DONKI. The night I filmed it, everything was quiet.</li><li><strong>Earth from space:</strong> the date of the latest EPIC full-disk image, how many were taken that day, and the centre point.</li><li><strong>Fireballs:</strong> the 4 most recent fireballs from the JPL fireball API, with date, impact energy and location.</li><li><strong>Exoplanets:</strong> the confirmed count from the NASA Exoplanet Archive as one big number. It read 6,464 the day I shot it.</li></ol><h3>How it works</h3><ul><li>The pages flip every 15 seconds, and each feed is fetched at most once every 30 minutes, so the board makes only about 8 requests an hour.</li><li>If one feed fails, that page says “Feed unavailable” and the rest keep running. The failed feed is retried after 60 seconds.</li><li>NeoWs and DONKI need an api.nasa.gov key. DEMO_KEY works for a first test but is capped at 30 requests an hour, so sign up for your own key. EONET, EPIC, the fireball feed and the exoplanet count don’t use it.</li><li>The OLED was a later add-on, one more message to Soldr. It shows a short text summary of the current page.</li></ul><h3>What happened on the bench</h3><p>It didn’t all work on the first flash, and that part is worth telling:</p><ol><li>First flash: the fireball and exoplanet pages worked straight away, but the four bigger feeds (10 KB and up) showed “Feed unavailable — Bad JSON”.</li><li>I told Soldr exactly that, in plain words. It rewrote the shared fetch code to download each response completely before parsing it with a filter, kept my pins and settings, and added the 60 second retry.</li><li>Reflashed from Soldr, and all six pages came up with live data.</li></ol><h3>Step 2: Flash it</h3><ol><li>In the Arduino IDE, install the esp32 board package and choose ESP32 Dev Module. Install Adafruit GFX Library, Adafruit ILI9341, Adafruit SSD1306 and ArduinoJson (7.x) from Library Manager.</li><li>Put your Wi-Fi name, password and api.nasa.gov key into the settings lines at the top of the sketch Soldr gives you. Use a 2.4 GHz network.</li><li>Upload, then watch the screen: the first round of feeds takes a little while, then the pages start rotating.</li></ol><h3>How Soldr designs this from the idea</h3><p>Want a page for something else, say the ISS position or a picture of the day? Describe it at <a href="https://soldr.ai/">soldr.ai</a>. Soldr designs hardware from the idea: it asks which board you want, picks parts from the Compoden catalog, assigns the pins, gives you the wiring diagram and writes the firmware, then compiles it for your board. You can keep talking to it, like I did here, to add a screen or fix a problem. For this one the idea was simply a NASA data display for my desk on an ESP32 and a 2.8 inch TFT.</p><p>Not affiliated with or endorsed by NASA. Just a very nice set of open data that looks great on a desk.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/esp32-nasa-desk-display-asteroids-fireballs-space-weather-tft"><em>https://compoden.com</em></a><em> on November 19, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41dd518d83ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Idea to Build: An M5Stack CoreInk Room Monitor That Keeps Its Readings]]></title>
            <link>https://medium.com/@compodenin/idea-to-build-an-m5stack-coreink-room-monitor-that-keeps-its-readings-4ae378ee9b0f?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ae378ee9b0f</guid>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[sensors]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 04:52:52 GMT</pubDate>
            <atom:updated>2026-11-22T06:36:51.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OwizDP-S78Y5Z_ED" /></figure><p>I wanted a little box on the shelf that tells me how my room is doing: temperature, humidity, pressure and a gas reading, on a screen that doesn’t glow at night. Plus the same numbers live on my phone.</p><p>An e-ink screen is perfect for that, because it keeps the last image even with the power gone. The M5Stack CoreInk already has one built in, plus an ESP32 with Wi-Fi, so the whole build is one board and one sensor.</p><p>Soldr designed this build, the parts list, the pin plan and the code around parts that can be shipped to you in India. Soldr is Compoden’s AI, AI built on a catalog, so everything below is a part you can order here. If anything is missing, incorrect, or doesn’t work as expected, let us know so it can be fixed.</p><h3>What you need</h3><p>Plus a Grove (HY2.0–4P) to female jumper lead and a USB-C data cable.</p><h3>Step 1: Wire the BME680</h3><p>Just four wires. The sensor talks I2C on GPIO32 and GPIO33 and runs on 3.3V.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uon48f_WsUgNOb2o" /></figure><p>BME680 VCC</p><p>CoreInk 3V3 (bottom header, pin 6)</p><p>BME680 GND</p><p>CoreInk GND (Grove black wire, or bottom header pin 1)</p><p>BME680 SDA</p><p>GPIO32 (Grove yellow wire)</p><p>BME680 SCL</p><p>GPIO33 (Grove white wire)</p><p>Grove red wire (5V)</p><p>Not connected. Tape it off.</p><p>Power</p><p>CoreInk USB-C port (computer or a 5V USB charger)</p><p>A few notes so it works the first time:</p><ul><li><strong>G32 and G33 live on the Grove port.</strong> Soldr’s pin plan puts the sensor on GPIO32 and GPIO33. On the CoreInk those two pins only come out on the 4-pin Grove (HY2.0–4P) socket on the bottom: black GND, red 5V, yellow G32, white G33. Jumper wires don’t push into a Grove socket, so use a Grove to female jumper lead.</li><li><strong>Feed the BME680 3.3V, not 5V.</strong> The Grove socket’s red wire is 5V, and this BME680 module is listed as a 3.3V part. Leave the red wire unconnected and take VCC from the 3V3 pin on the CoreInk’s bottom header with a male-to-female jumper.</li><li><strong>No extra resistors.</strong> BME680 breakouts normally carry their own I2C pull-ups, and the sketch tries both addresses (0x76, then 0x77), so either SDO setting works.</li></ul><h3>Step 2: Upload the Soldr firmware</h3><p>Soldr generated this sketch for the room monitor. Paste it as room_monitor.ino, fill in your Wi-Fi details, and upload with the board set to M5CoreInk.</p><pre>// legend: [SOLDR] build · [INIT] init · [TEST] self-test · [DATA] telemetry · [WARN]/[ERROR] fault · [FIX] likely remedy // // LOOP STRUCTURE (nothing blocks): // every pass : M5.update(), server.handleClient(), button A check // millis() timed : BME680 read cycle (start a reading every 3 s, collect it when ready) // e-ink redraw (at most once per 60 s, only if values changed, or on button A) // Wi-Fi reconnect attempt every 30 s if the link dropped // event driven : HTTP requests to &quot;/&quot; and &quot;/data&quot; // // WIRING - generated from the same pin plan as the Wiring tab (follow the Wiring tab if in doubt): // 3V3 -&gt; BME680 Sensor Module VCC // GND -&gt; BME680 Sensor Module GND // GPIO32 -&gt; BME680 Sensor Module SDA // GPIO33 -&gt; BME680 Sensor Module SCL // USB port -&gt; M5Stack CoreInk ESP32 E-Ink Develo powered from its own USB port (a cable to a computer or a 5 V USB charger) // Gas note: the BME680 gives raw gas RESISTANCE (kOhm). A calibrated IAQ index needs // Bosch&#39;s BSEC library plus a burn-in period, so this sketch does NOT present an IAQ value. // Higher resistance = cleaner air; watch the trend rather than the absolute number. #include &lt;M5Unified.h&gt; #include &lt;Wire.h&gt; #include &lt;WiFi.h&gt; #include &lt;WebServer.h&gt; #include &lt;Adafruit_Sensor.h&gt; #include &lt;Adafruit_BME680.h&gt; #define SOLDR_DEBUG 1 #define WIFI_SSID &quot;YOUR_SSID&quot; #define WIFI_PASS &quot;YOUR_PASSWORD&quot; #define I2C_SDA_PIN 32 #define I2C_SCL_PIN 33 const unsigned long SENSOR_INTERVAL_MS = 3000; const unsigned long DISPLAY_INTERVAL_MS = 60000; const unsigned long WIFI_RETRY_MS = 30000; const int QUALITY_REFRESH_EVERY = 10; // full (flashing) refresh every Nth redraw Adafruit_BME680 bme(&amp;Wire); WebServer server(80); bool sensorOk = false; bool wifiOk = false; float tempC = NAN, humidityPct = NAN, pressureHpa = NAN, gasKohm = NAN; bool haveReading = false; bool readingPending = false; unsigned long readingReadyAt = 0; unsigned long lastSensorStart = 0; unsigned long lastDisplayDraw = 0; unsigned long lastWifiTry = 0; bool forceRedraw = true; int redrawCount = 0; long shownTemp10 = -99999, shownHum = -1, shownPress = -1, shownGas = -1; int initOk = 0, initFail = 0; const char INDEX_HTML[] PROGMEM = R&quot;HTML( &lt;!doctype html&gt;&lt;html lang=&quot;en&quot;&gt;&lt;head&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1&quot;&gt; &lt;title&gt;Room Monitor · Soldr&lt;/title&gt; &lt;style&gt; :root{--bg:#0a090c;--card:#141317;--line:rgba(255,255,255,.08);--ink:#f2f1ee;--mut:#8b8985;--hot:#E8421A} *{box-sizing:border-box;margin:0} body{background:var(--bg);color:var(--ink);font:14px/1.5 -apple-system,Segoe UI,Roboto,sans-serif;padding:16px;max-width:820px;margin:0 auto} header{display:flex;align-items:center;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--line);margin-bottom:16px} .mark{height:22px;width:auto} h1{font-size:15px;font-weight:600;color:var(--mut);letter-spacing:.01em} .dot{width:7px;height:7px;border-radius:50%;background:#34d399;box-shadow:0 0 7px #34d399;margin-left:auto;transition:.3s} .dot.stale{background:#6b6a67;box-shadow:none} .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px} .card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:14px} .card .k{font:11px/1 ui-monospace,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--mut)} .card .v{font:600 26px/1.1 ui-monospace,monospace;color:var(--ink);margin-top:8px;font-variant-numeric:tabular-nums} .card canvas{width:100%;height:34px;display:block;margin-top:8px} footer{margin-top:18px;font:11px/1 ui-monospace,monospace;color:var(--mut);text-align:center} .empty{color:var(--mut);grid-column:1/-1;text-align:center;padding:28px 0;font-size:13px} &lt;/style&gt;&lt;/head&gt;&lt;body&gt; &lt;header&gt; &lt;!-- SO;DR - the ; is a molten solder drop (bead + drip), iron-hot orange with a highlight --&gt; &lt;svg class=&quot;mark&quot; viewBox=&quot;0 0 132 74&quot; fill=&quot;none&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-label=&quot;SO;DR&quot;&gt; &lt;text x=&quot;0&quot; y=&quot;52&quot; font-family=&quot;ui-monospace,monospace&quot; font-size=&quot;52&quot; font-weight=&quot;700&quot; fill=&quot;#f2f1ee&quot;&gt;SO&lt;/text&gt; &lt;g transform=&quot;translate(64,0)&quot;&gt; &lt;circle cx=&quot;15&quot; cy=&quot;20&quot; r=&quot;8.5&quot; fill=&quot;#E8421A&quot;/&gt;&lt;circle cx=&quot;12&quot; cy=&quot;17&quot; r=&quot;2.6&quot; fill=&quot;#FFB499&quot; opacity=&quot;.85&quot;/&gt; &lt;path d=&quot;M15 40 C9 47 7 54 7 60 a8 8 0 0 0 16 0 c0 -6 -2 -13 -8 -20 Z&quot; fill=&quot;#E8421A&quot;/&gt;&lt;circle cx=&quot;12.5&quot; cy=&quot;57&quot; r=&quot;2.4&quot; fill=&quot;#FFB499&quot; opacity=&quot;.8&quot;/&gt; &lt;/g&gt; &lt;text x=&quot;94&quot; y=&quot;52&quot; font-family=&quot;ui-monospace,monospace&quot; font-size=&quot;52&quot; font-weight=&quot;700&quot; fill=&quot;#f2f1ee&quot;&gt;DR&lt;/text&gt; &lt;/svg&gt; &lt;h1&gt;Room Monitor&lt;/h1&gt; &lt;span id=&quot;live&quot; class=&quot;dot stale&quot; title=&quot;link status&quot;&gt;&lt;/span&gt; &lt;/header&gt; &lt;div id=&quot;grid&quot; class=&quot;grid&quot;&gt;&lt;div class=&quot;empty&quot;&gt;waiting for the board...&lt;/div&gt;&lt;/div&gt; &lt;footer&gt;Soldr · live dashboard · updates every second&lt;/footer&gt; &lt;script&gt; (function(){ var hist={}; // per-key rolling values for the sparkline var grid=document.getElementById(&#39;grid&#39;), live=document.getElementById(&#39;live&#39;); function spark(cv,vals){ var c=cv.getContext(&#39;2d&#39;),w=cv.width=cv.clientWidth*2,h=cv.height=68,n=vals.length; c.clearRect(0,0,w,h); if(n&lt;2)return; var lo=Math.min.apply(0,vals),hi=Math.max.apply(0,vals); if(hi===lo){hi++;lo--;} c.strokeStyle=&#39;#E8421A&#39;;c.lineWidth=3;c.beginPath(); vals.forEach(function(v,i){var x=i/(n-1)*w,y=h-(v-lo)/(hi-lo)*h;i?c.lineTo(x,y):c.moveTo(x,y);});c.stroke(); } function render(d){ var keys=Object.keys(d); if(!keys.length){return;} grid.querySelector(&#39;.empty&#39;)&amp;&amp;(grid.innerHTML=&#39;&#39;); keys.forEach(function(k){ (hist[k]=hist[k]||[]).push(+d[k]); if(hist[k].length&gt;60)hist[k].shift(); var id=&#39;c_&#39;+k.replace(/\W/g,&#39;&#39;), card=document.getElementById(id); if(!card){card=document.createElement(&#39;div&#39;);card.className=&#39;card&#39;;card.id=id; card.innerHTML=&#39;&lt;div class=&quot;k&quot;&gt;&lt;/div&gt;&lt;div class=&quot;v&quot;&gt;&lt;/div&gt;&lt;canvas&gt;&lt;/canvas&gt;&#39;; card.querySelector(&#39;.k&#39;).textContent=k; grid.appendChild(card);} card.querySelector(&#39;.v&#39;).textContent=d[k]; spark(card.querySelector(&#39;canvas&#39;),hist[k]); }); } function poll(){ fetch(&#39;/data&#39;).then(function(r){return r.json();}).then(function(d){live.classList.remove(&#39;stale&#39;);render(d);}) .catch(function(){live.classList.add(&#39;stale&#39;);}); } poll(); setInterval(poll,1000); })(); &lt;/script&gt; &lt;/body&gt;&lt;/html&gt; )HTML&quot;; void handleRoot() { server.send_P(200, &quot;text/html&quot;, INDEX_HTML); } void handleData() { char buf[200]; if (haveReading) { snprintf(buf, sizeof(buf), &quot;{\&quot;Temperature (C)\&quot;:%.1f,\&quot;Humidity (%%)\&quot;:%.1f,\&quot;Pressure (hPa)\&quot;:%.1f,\&quot;Gas resistance (kOhm)\&quot;:%.1f}&quot;, tempC, humidityPct, pressureHpa, gasKohm); } else { snprintf(buf, sizeof(buf), &quot;{}&quot;); } server.sendHeader(&quot;Cache-Control&quot;, &quot;no-store&quot;); server.send(200, &quot;application/json&quot;, buf); } void drawScreen() { M5.Display.setEpdMode((redrawCount % QUALITY_REFRESH_EVERY == 0) ? epd_mode_t::epd_quality : epd_mode_t::epd_fast); M5.Display.fillScreen(TFT_WHITE); M5.Display.setTextColor(TFT_BLACK, TFT_WHITE); M5.Display.setTextSize(2); M5.Display.setCursor(8, 6); M5.Display.print(&quot;Room Monitor&quot;); M5.Display.drawLine(0, 28, M5.Display.width(), 28, TFT_BLACK); if (haveReading) { M5.Display.setCursor(8, 42); M5.Display.printf(&quot;Temp %.1f C&quot;, tempC); M5.Display.setCursor(8, 74); M5.Display.printf(&quot;Hum %.0f %%&quot;, humidityPct); M5.Display.setCursor(8, 106); M5.Display.printf(&quot;Pres %.0f hPa&quot;, pressureHpa); M5.Display.setCursor(8, 138); M5.Display.printf(&quot;Gas %.0f kOhm&quot;, gasKohm); } else { M5.Display.setCursor(8, 74); M5.Display.print(sensorOk ? &quot;Reading...&quot; : &quot;Sensor FAIL&quot;); } M5.Display.setTextSize(1); M5.Display.setCursor(8, 176); if (wifiOk) { M5.Display.printf(&quot;http://%s/&quot;, WiFi.localIP().toString().c_str()); } else { M5.Display.print(&quot;Wi-Fi offline&quot;); } M5.Display.display(); redrawCount++; } void connectWifi(unsigned long timeoutMs) { WiFi.mode(WIFI_STA); WiFi.begin(WIFI_SSID, WIFI_PASS); unsigned long start = millis(); while (WiFi.status() != WL_CONNECTED &amp;&amp; millis() - start &lt; timeoutMs) { delay(250); } wifiOk = (WiFi.status() == WL_CONNECTED); } void setup() { auto cfg = M5.config(); M5.begin(cfg); Serial.begin(115200); delay(200); #if SOLDR_DEBUG Serial.println(); Serial.println(&quot;[SOLDR] Room Monitor | board:M5Stack CoreInk (ESP32-PICO-D4) | v1.0&quot;); #endif // Display if (M5.Display.width() &gt; 0) { initOk++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] E-ink display: OK&quot;); #endif M5.Display.setEpdMode(epd_mode_t::epd_quality); M5.Display.fillScreen(TFT_WHITE); M5.Display.setTextColor(TFT_BLACK, TFT_WHITE); M5.Display.setTextSize(2); M5.Display.setCursor(8, 80); M5.Display.print(&quot;Starting...&quot;); M5.Display.display(); } else { initFail++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] E-ink display: FAIL (width 0)&quot;); Serial.println(&quot;[FIX] E-ink display: power-cycle the CoreInk and re-flash with the CoreInk board selected&quot;); #endif } // BME680 on Port A I2C Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); sensorOk = bme.begin(0x76); if (!sensorOk) sensorOk = bme.begin(0x77); if (sensorOk) { initOk++; bme.setTemperatureOversampling(BME680_OS_8X); bme.setHumidityOversampling(BME680_OS_2X); bme.setPressureOversampling(BME680_OS_4X); bme.setIIRFilterSize(BME680_FILTER_SIZE_3); bme.setGasHeater(320, 150); // 320 C for 150 ms #if SOLDR_DEBUG Serial.println(&quot;[INIT] BME680: OK&quot;); #endif } else { initFail++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] BME680: FAIL (no response at 0x76 or 0x77)&quot;); Serial.println(&quot;[FIX] BME680: check SDA-&gt;GPIO32, SCL-&gt;GPIO33, 3V3 and GND; SDO pin must not float&quot;); #endif } // Wi-Fi (degraded mode if it fails: e-ink still works) #if SOLDR_DEBUG Serial.print(&quot;[INIT] WiFi: connecting to &quot;); Serial.println(WIFI_SSID); #endif connectWifi(15000); lastWifiTry = millis(); if (wifiOk) { initOk++; server.on(&quot;/&quot;, HTTP_GET, handleRoot); server.on(&quot;/data&quot;, HTTP_GET, handleData); server.begin(); #if SOLDR_DEBUG Serial.print(&quot;[INIT] WiFi: connected, IP &quot;); Serial.println(WiFi.localIP()); #endif } else { initFail++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] WiFi: FAIL (not connected)&quot;); Serial.println(&quot;[FIX] WiFi: check WIFI_SSID/WIFI_PASS and that the network is 2.4 GHz&quot;); #endif } // Server routes are registered even if Wi-Fi came up late if (!wifiOk) { server.on(&quot;/&quot;, HTTP_GET, handleRoot); server.on(&quot;/data&quot;, HTTP_GET, handleData); } #if SOLDR_DEBUG // BME680 takes its first reading in loop(), so no immediate self-test read here Serial.println(&quot;[TEST] BME680: first reading reported by loop() as [DATA]&quot;); Serial.printf(&quot;[READY] %d OK / %d FAIL\n&quot;, initOk, initFail); #endif } void loop() { M5.update(); server.handleClient(); // Button A forces a redraw if (M5.BtnA.wasPressed()) forceRedraw = true; // Sensor cycle: start a reading, collect it once it is ready if (sensorOk) { if (!readingPending &amp;&amp; millis() - lastSensorStart &gt;= SENSOR_INTERVAL_MS) { lastSensorStart = millis(); unsigned long endTime = bme.beginReading(); if (endTime == 0) { #if SOLDR_DEBUG Serial.println(&quot;[ERROR] BME680: beginReading failed&quot;); Serial.println(&quot;[FIX] BME680: check I2C wiring and power&quot;); #endif } else { readingPending = true; readingReadyAt = endTime; } } if (readingPending &amp;&amp; (long)(millis() - readingReadyAt) &gt;= 0) { readingPending = false; if (bme.endReading()) { tempC = bme.temperature; humidityPct = bme.humidity; pressureHpa = bme.pressure / 100.0f; gasKohm = bme.gas_resistance / 1000.0f; haveReading = true; #if SOLDR_DEBUG Serial.printf(&quot;[DATA] temp=%.1f hum=%.1f press=%.1f gas_kohm=%.1f\n&quot;, tempC, humidityPct, pressureHpa, gasKohm); #endif } else { #if SOLDR_DEBUG Serial.println(&quot;[WARN] BME680: endReading failed&quot;); #endif } } } // Wi-Fi reconnect attempt (non-blocking: begin() returns immediately) bool nowConnected = (WiFi.status() == WL_CONNECTED); if (nowConnected != wifiOk) { wifiOk = nowConnected; if (wifiOk) { server.begin(); forceRedraw = true; } } if (!wifiOk &amp;&amp; millis() - lastWifiTry &gt;= WIFI_RETRY_MS) { lastWifiTry = millis(); WiFi.begin(WIFI_SSID, WIFI_PASS); } // E-ink redraw: rate-limited, only on change (or forced) if (M5.Display.width() &gt; 0 &amp;&amp; (forceRedraw || millis() - lastDisplayDraw &gt;= DISPLAY_INTERVAL_MS)) { long t10 = haveReading ? lroundf(tempC * 10.0f) : -99999; long h = haveReading ? lroundf(humidityPct) : -1; long p = haveReading ? lroundf(pressureHpa) : -1; long g = haveReading ? lroundf(gasKohm) : -1; bool changed = (t10 != shownTemp10 || h != shownHum || p != shownPress || g != shownGas); if (forceRedraw || changed) { drawScreen(); shownTemp10 = t10; shownHum = h; shownPress = p; shownGas = g; forceRedraw = false; } lastDisplayDraw = millis(); } }</pre><h3>How it works</h3><ul><li>Every 3 seconds the sketch starts a BME680 reading and collects it when it’s ready, without blocking. It reads temperature, humidity, pressure, and gas resistance, with the gas heater at 320°C for 150 ms.</li><li>The gas number is raw resistance in kOhm, not an air quality index. Higher means cleaner air, so watch the trend: it drops when you open a marker or spray a deodorant nearby.</li><li>The e-ink redraws at most once a minute, and only if a value changed, because e-ink is slow and flashes on a full refresh. Most redraws use the fast mode; every 10th is a full quality refresh to clear ghosting.</li><li>The CoreInk joins your home Wi-Fi and runs a small web server. The page polls /data every second and draws a sparkline under each number from the last 60 readings.</li><li>If Wi-Fi drops, it retries every 30 seconds and the e-ink keeps working on its own.</li></ul><h3>Step 3: Try it</h3><ol><li>In the Arduino IDE, install the esp32 board package and pick M5CoreInk as the board. Then install M5Unified (it pulls in M5GFX) and Adafruit BME680 (it pulls in Adafruit Unified Sensor and BusIO).</li><li>Put your Wi-Fi name and password in WIFI_SSID and WIFI_PASS. It has to be a 2.4 GHz network.</li><li>Upload the sketch, then open the Serial Monitor at 115200. You’ll see the [SOLDR] banner, [INIT] lines for the e-ink, the BME680 and Wi-Fi with the IP address, then [READY] 3 OK / 0 FAIL.</li><li>Type the IP from the bottom of the e-ink into your phone’s browser, with the phone on the same Wi-Fi. The four cards fill in within a few seconds.</li><li>Breathe on the sensor and watch humidity climb on the phone. To update the e-ink right away instead of waiting a minute, push the side dial up (that’s button A).</li></ol><h3>If something’s off</h3><ul><li><strong>BME680: FAIL (no response at 0x76 or 0x77):</strong> SDA and SCL are probably swapped. Yellow (G32) goes to SDA and white (G33) to SCL. Also check VCC is on 3V3.</li><li><strong>WiFi: FAIL:</strong> check the name and password, and that it’s a 2.4 GHz network, since the ESP32 can’t join 5 GHz.</li></ul><h3>How Soldr designs this from the idea</h3><p>Want a buzzer when humidity goes above 70%, or a battery icon? Describe the idea at <a href="https://soldr.ai/">soldr.ai</a>. Soldr designs hardware from the idea: it asks which board you want, picks parts from the Compoden catalog, assigns the pins, gives you the wiring and writes the firmware, then compiles it for your board. For this one the idea was simply a room monitor with an M5Stack CoreInk and a BME680 showing temperature, humidity, pressure and gas on the e-ink, with a live dashboard on my phone.</p><p>Leave it on a shelf and glance at it like a clock. The phone page is for when you want to watch the numbers move.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/m5stack-coreink-room-monitor-bme680-e-ink-phone-dashboard"><em>https://compoden.com</em></a><em> on November 17, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ae378ee9b0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[QMC5883L + MPU6050 + 2.4]]></title>
            <link>https://medium.com/@compodenin/qmc5883l-mpu6050-2-4-1d2374200eeb?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d2374200eeb</guid>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[embedded-systems]]></category>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[electronics]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 04:47:20 GMT</pubDate>
            <atom:updated>2026-11-22T06:35:58.884Z</atom:updated>
            <content:encoded><![CDATA[<h3>QMC5883L + MPU6050 + 2.4 Inch TFT: Build an ESP32 Desk Car Gauge With a G-Force Needle, Tilt and a Compass</h3><p>Custom digital gauges are everywhere right now, and most start the same way: a colour screen, a motion sensor and a compass. This is that idea as a desk build. An ESP32 drives a 2.4 inch ILI9341 TFT showing a round G-force needle, pitch and roll, and a compass heading. No car, no CAN bus, just three modules on a breadboard you can tilt, turn and flick.</p><p>Soldr designed this build, the parts list, the pin plan and the code around parts that can be shipped to you in India. Soldr is Compoden’s AI, AI built on a catalog, so everything below is a part you can order here. We only added the breadboard, since three parts share power and I2C. If anything is missing, incorrect, or doesn’t work as expected, let us know so it can be fixed.</p><h3>What you need</h3><h3>Step 1: Wire the screen and the two sensors</h3><p>Seventeen connections, all at 3.3V. Put 3V3, GND, SDA and SCL on breadboard rails first.</p><p>A few notes so it works the first time:</p><ul><li><strong>Everything runs at 3.3V.</strong> The ILI9341 is 3.3V logic and not 5V tolerant, so the ESP32 is a perfect match with no level shifter. Both sensor modules are happy on 3V3.</li><li><strong>Two sensors, one I2C bus.</strong> Both sensors sit on the same SDA and SCL rows. They don’t clash: the MPU6050 is at 0x68, the QMC5883L at 0x0D.</li><li><strong>Check the headers.</strong> If a module came with its pin strip loose, solder it on first. Pins just pushed into the holes give flaky I2C.</li><li><strong>Keep the compass away from metal.</strong> Keep the QMC5883L a few centimetres from the USB cable, the ESP32 and anything steel.</li></ul><h3>Step 2: Upload the Soldr firmware</h3><p>Soldr generated and compiled this sketch for the ESP32-DevKitC; it’s shown exactly as generated. Paste it as car_gauge.ino and upload with the board set to ESP32 Dev Module.</p><pre>// legend: [SOLDR] build · [INIT] init · [TEST] self-test · [DATA] telemetry · [WARN]/[ERROR] fault · [FIX] likely remedy // // Digital car gauge: round G-force needle + pitch/roll tilt + compass heading // // WIRING (ESP32-DEVKITC, all 3.3V logic) // WIRING - generated from the same pin plan as the Wiring tab (follow the Wiring tab if in doubt): // 3V3 -&gt; 2.4 inch TFT LCD Display ILI9341 S VCC // GND -&gt; 2.4 inch TFT LCD Display ILI9341 S GND // GPIO18 -&gt; 2.4 inch TFT LCD Display ILI9341 S SCK // GPIO23 -&gt; 2.4 inch TFT LCD Display ILI9341 S MOSI // GPIO19 -&gt; 2.4 inch TFT LCD Display ILI9341 S MISO // GPIO5 -&gt; 2.4 inch TFT LCD Display ILI9341 S CS/SS // 3V3 -&gt; 2.4 inch TFT LCD Display ILI9341 S LED / BL (backlight) // GPIO4 -&gt; 2.4 inch TFT LCD Display ILI9341 S DC // GPIO13 -&gt; 2.4 inch TFT LCD Display ILI9341 S RST // 3V3 -&gt; MPU6050 3-Axis Gyro/Accel Sensor M VCC // GND -&gt; MPU6050 3-Axis Gyro/Accel Sensor M GND // GPIO21 -&gt; MPU6050 3-Axis Gyro/Accel Sensor M SDA // GPIO22 -&gt; MPU6050 3-Axis Gyro/Accel Sensor M SCL // 3V3 -&gt; QMC5883L Compass Module VCC // GND -&gt; QMC5883L Compass Module GND // GPIO21 -&gt; QMC5883L Compass Module SDA // GPIO22 -&gt; QMC5883L Compass Module SCL // USB port -&gt; ESP32-DEVKITC Development Board powered from its own USB port (a cable to a computer or a 5 V USB charger) // // Libraries (Library Manager): Adafruit GFX Library, Adafruit ILI9341, // Adafruit MPU6050, Adafruit Unified Sensor, QMC5883LCompass #include &lt;Arduino.h&gt; #include &lt;Wire.h&gt; #include &lt;SPI.h&gt; #include &lt;math.h&gt; #include &lt;Adafruit_GFX.h&gt; #include &lt;Adafruit_ILI9341.h&gt; #include &lt;Adafruit_MPU6050.h&gt; #include &lt;Adafruit_Sensor.h&gt; #include &lt;QMC5883LCompass.h&gt; #define SOLDR_DEBUG 1 #define TFT_CS_PIN 5 #define TFT_DC_PIN 4 #define TFT_RST_PIN 13 #define SPI_SCK_PIN 18 #define SPI_MISO_PIN 19 #define SPI_MOSI_PIN 23 #define I2C_SDA_PIN 21 #define I2C_SCL_PIN 22 #define QMC_ADDR 0x0D #define MAG_DECLINATION_DEG 0.0f // set your local magnetic declination #define G_FULL_SCALE 2.0f // needle full-scale in G // Colours (RGB565) #define C_BG 0x0000 #define C_FG 0xFFFF #define C_DIM 0x7BEF #define C_ACCENT 0x07FF #define C_NEEDLE 0xF800 #define C_HEAD 0x10A2 // Layout (240x320 portrait) #define GAUGE_CX 120 #define GAUGE_CY 118 #define GAUGE_R 78 #define COMP_CX 55 #define COMP_CY 278 #define COMP_R 36 Adafruit_ILI9341 tft(TFT_CS_PIN, TFT_DC_PIN, TFT_RST_PIN); Adafruit_MPU6050 mpu; QMC5883LCompass compass; bool mpuOk = false; bool qmcOk = false; int okCount = 0; int failCount = 0; // Filtered values float gFilt = 1.0f; float pitchDeg = 0, rollDeg = 0; float pitchZero = 0, rollZero = 0; float hdgSin = 0, hdgCos = 1; float headingDeg = 0; // Compass hard-iron auto-calibration int magMinX = 32767, magMaxX = -32768, magMinY = 32767, magMaxY = -32768; // Last drawn state (draw only on change) int lastNeedleDeg = -999; int lastCompDeg = -999; int lastG100 = -999, lastPitch = -999, lastRoll = -999, lastHdg = -999; unsigned long lastSample = 0; unsigned long lastLog = 0; const unsigned long SAMPLE_MS = 25; const unsigned long LOG_MS = 500; static inline float deg2rad(float d) { return d * (float)M_PI / 180.0f; } // ---------- drawing ---------- void gaugePoint(float angDeg, float radius, int &amp;x, int &amp;y) { float a = deg2rad(angDeg); x = GAUGE_CX + (int)lroundf(cosf(a) * radius); y = GAUGE_CY + (int)lroundf(sinf(a) * radius); } void drawGaugeStatic() { tft.drawCircle(GAUGE_CX, GAUGE_CY, GAUGE_R, C_FG); tft.drawCircle(GAUGE_CX, GAUGE_CY, GAUGE_R - 1, C_DIM); for (int i = 0; i &lt;= 8; i++) { float ang = 135.0f + 270.0f * i / 8.0f; int x1, y1, x2, y2; float inner = (i % 4 == 0) ? GAUGE_R - 14 : GAUGE_R - 8; gaugePoint(ang, GAUGE_R - 2, x1, y1); gaugePoint(ang, inner, x2, y2); tft.drawLine(x1, y1, x2, y2, (i % 4 == 0) ? C_ACCENT : C_FG); } tft.setTextSize(1); tft.setTextColor(C_DIM, C_BG); int lx, ly; gaugePoint(135, GAUGE_R - 26, lx, ly); tft.setCursor(lx - 2, ly - 3); tft.print(&quot;0&quot;); gaugePoint(270, GAUGE_R - 26, lx, ly); tft.setCursor(lx - 2, ly - 3); tft.print(&quot;1&quot;); gaugePoint(405, GAUGE_R - 26, lx, ly); tft.setCursor(lx - 2, ly - 3); tft.print(&quot;2&quot;); } void drawThickLine(int x0, int y0, int x1, int y1, uint16_t col) { tft.drawLine(x0, y0, x1, y1, col); tft.drawLine(x0 + 1, y0, x1 + 1, y1, col); tft.drawLine(x0, y0 + 1, x1, y1 + 1, col); } void drawGaugeNeedle(int angDeg, uint16_t col) { int tx, ty; gaugePoint((float)angDeg, GAUGE_R - 16, tx, ty); drawThickLine(GAUGE_CX, GAUGE_CY, tx, ty, col); } void updateGaugeNeedle(float g) { float f = constrain(g / G_FULL_SCALE, 0.0f, 1.0f); int ang = (int)lroundf(135.0f + 270.0f * f); if (ang == lastNeedleDeg) return; if (lastNeedleDeg != -999) drawGaugeNeedle(lastNeedleDeg, C_BG); drawGaugeStatic(); drawGaugeNeedle(ang, C_NEEDLE); tft.fillCircle(GAUGE_CX, GAUGE_CY, 5, C_FG); lastNeedleDeg = ang; } void compassPoint(float angFromUpDeg, float radius, int &amp;x, int &amp;y) { float a = deg2rad(angFromUpDeg); x = COMP_CX + (int)lroundf(sinf(a) * radius); y = COMP_CY - (int)lroundf(cosf(a) * radius); } void drawCompassNeedle(int angDeg, bool erase) { int nx, ny, sx, sy; compassPoint((float)angDeg, COMP_R - 4, nx, ny); compassPoint((float)angDeg + 180.0f, COMP_R - 14, sx, sy); tft.drawLine(COMP_CX, COMP_CY, nx, ny, erase ? C_BG : C_NEEDLE); tft.drawLine(COMP_CX + 1, COMP_CY, nx + 1, ny, erase ? C_BG : C_NEEDLE); tft.drawLine(COMP_CX, COMP_CY, sx, sy, erase ? C_BG : C_FG); } void drawCompassStatic() { tft.drawCircle(COMP_CX, COMP_CY, COMP_R, C_FG); tft.drawCircle(COMP_CX, COMP_CY, COMP_R + 1, C_DIM); tft.setTextSize(1); tft.setTextColor(C_ACCENT, C_BG); tft.setCursor(COMP_CX - 2, COMP_CY - COMP_R - 11); tft.print(&quot;N&quot;); } void updateCompassNeedle(float hdg) { int ang = (int)lroundf(-hdg); // needle points to magnetic north while (ang &lt; 0) ang += 360; ang %= 360; if (ang == lastCompDeg) return; if (lastCompDeg != -999) drawCompassNeedle(lastCompDeg, true); drawCompassStatic(); drawCompassNeedle(ang, false); tft.fillCircle(COMP_CX, COMP_CY, 3, C_FG); lastCompDeg = ang; } const char *cardinal(float hdg) { static const char *names[8] = {&quot;N&quot;, &quot;NE&quot;, &quot;E&quot;, &quot;SE&quot;, &quot;S&quot;, &quot;SW&quot;, &quot;W&quot;, &quot;NW&quot;}; int idx = (int)((hdg + 22.5f) / 45.0f) % 8; return names[idx]; } void drawStaticUI() { tft.fillScreen(C_BG); // once, at setup only tft.fillRect(0, 0, 240, 24, C_HEAD); tft.setTextSize(2); tft.setTextColor(C_FG, C_HEAD); tft.setCursor(38, 5); tft.print(&quot;CAR GAUGE&quot;); drawGaugeStatic(); drawCompassStatic(); tft.setTextSize(1); tft.setTextColor(C_DIM, C_BG); tft.setCursor(110, 236); tft.print(&quot;HEADING&quot;); tft.setCursor(110, 276); tft.print(&quot;TILT&quot;); } void updateReadouts(float g, float pitch, float roll, float hdg) { char buf[24]; int g100 = (int)lroundf(g * 100.0f); int p = (int)lroundf(pitch); int r = (int)lroundf(roll); int h = ((int)lroundf(hdg)) % 360; if (g100 != lastG100) { snprintf(buf, sizeof(buf), &quot;%4d.%02d G &quot;, g100 / 100, g100 % 100); tft.setTextSize(3); tft.setTextColor(C_FG, C_BG); tft.setCursor(36, 206); tft.print(buf); lastG100 = g100; } if (h != lastHdg) { snprintf(buf, sizeof(buf), &quot;%3d %-2s &quot;, h, cardinal(hdg)); tft.setTextSize(3); tft.setTextColor(C_ACCENT, C_BG); tft.setCursor(110, 248); tft.print(buf); lastHdg = h; } if (p != lastPitch) { snprintf(buf, sizeof(buf), &quot;P %+4d &quot;, p); tft.setTextSize(2); tft.setTextColor(C_FG, C_BG); tft.setCursor(110, 288); tft.print(buf); lastPitch = p; } if (r != lastRoll) { snprintf(buf, sizeof(buf), &quot;R %+4d &quot;, r); tft.setTextSize(2); tft.setTextColor(C_FG, C_BG); tft.setCursor(110, 304); tft.print(buf); lastRoll = r; } } // ---------- sensors ---------- bool readAccel(float &amp;ax, float &amp;ay, float &amp;az) { sensors_event_t a, g, t; mpu.getEvent(&amp;a, &amp;g, &amp;t); ax = a.acceleration.x / 9.80665f; ay = a.acceleration.y / 9.80665f; az = a.acceleration.z / 9.80665f; return true; } void accelToTilt(float ax, float ay, float az, float &amp;pitch, float &amp;roll) { pitch = atan2f(-ax, sqrtf(ay * ay + az * az)) * 180.0f / (float)M_PI; roll = atan2f(ay, az) * 180.0f / (float)M_PI; } void calibrateLevel() { // Keep the unit still and level: average tilt becomes the zero reference. // MPU6050 accel needs calibration; this removes the mounting-angle offset only. float sp = 0, sr = 0; const int N = 50; for (int i = 0; i &lt; N; i++) { float ax, ay, az, p, r; readAccel(ax, ay, az); accelToTilt(ax, ay, az, p, r); sp += p; sr += r; delay(10); } pitchZero = sp / N; rollZero = sr / N; } void updateCompassHeading() { compass.read(); int mx = compass.getX(); int my = compass.getY(); if (mx &lt; magMinX) magMinX = mx; if (mx &gt; magMaxX) magMaxX = mx; if (my &lt; magMinY) magMinY = my; if (my &gt; magMaxY) magMaxY = my; float cx = mx, cy = my; if ((magMaxX - magMinX) &gt; 200 &amp;&amp; (magMaxY - magMinY) &gt; 200) { cx = mx - (magMaxX + magMinX) / 2.0f; cy = my - (magMaxY + magMinY) / 2.0f; } float h = atan2f(cy, cx) * 180.0f / (float)M_PI + MAG_DECLINATION_DEG; // circular low-pass so 359-&gt;0 does not swing the needle backwards hdgSin += 0.2f * (sinf(deg2rad(h)) - hdgSin); hdgCos += 0.2f * (cosf(deg2rad(h)) - hdgCos); float s = atan2f(hdgSin, hdgCos) * 180.0f / (float)M_PI; if (s &lt; 0) s += 360.0f; headingDeg = s; } void setup() { Serial.begin(115200); delay(300); #if SOLDR_DEBUG Serial.println(); Serial.println(&quot;[SOLDR] Car Gauge | board:ESP32-DEVKITC | v1.0&quot;); #endif Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN); SPI.begin(SPI_SCK_PIN, SPI_MISO_PIN, SPI_MOSI_PIN, TFT_CS_PIN); tft.begin(); tft.setRotation(0); tft.fillScreen(C_BG); okCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] ILI9341 TFT: OK (begin() gives no presence check)&quot;); Serial.println(&quot;[FIX] ILI9341 TFT: if the screen stays dark check LED/BL-&gt;3V3, CS=5 DC=4 RST=13, SPI on 18/23&quot;); #endif mpuOk = mpu.begin(); // addr 0x68 if (mpuOk) { mpu.setAccelerometerRange(MPU6050_RANGE_4_G); mpu.setFilterBandwidth(MPU6050_BAND_21_HZ); okCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] MPU6050: OK&quot;); #endif } else { failCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] MPU6050: FAIL (not found at 0x68)&quot;); Serial.println(&quot;[FIX] MPU6050: check SDA=21 SCL=22, 3V3 power, AD0 low (0x68), solder joints&quot;); #endif } Wire.beginTransmission(QMC_ADDR); qmcOk = (Wire.endTransmission() == 0); if (qmcOk) { compass.init(); compass.setSmoothing(5, true); okCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] QMC5883L: OK&quot;); #endif } else { failCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] QMC5883L: FAIL (no ACK at 0x0D)&quot;); Serial.println(&quot;[FIX] QMC5883L: check SDA/SCL wiring and 3V3; some GY-271 boards carry an HMC5883L at 0x1E instead&quot;); #endif } drawStaticUI(); if (mpuOk) { tft.setTextSize(1); tft.setTextColor(C_ACCENT, C_BG); tft.setCursor(60, 30); tft.print(&quot;Hold level...&quot;); calibrateLevel(); tft.fillRect(60, 30, 130, 10, C_BG); drawGaugeStatic(); #if SOLDR_DEBUG float ax, ay, az; readAccel(ax, ay, az); Serial.printf(&quot;[TEST] MPU6050: ax=%.2f ay=%.2f az=%.2f g, zeroP=%.1f zeroR=%.1f\n&quot;, ax, ay, az, pitchZero, rollZero); #endif } else { tft.setTextSize(1); tft.setTextColor(C_NEEDLE, C_BG); tft.setCursor(50, 30); tft.print(&quot;MPU6050 NOT FOUND&quot;); } if (qmcOk) { // first sample after the module has had time to start delay(100); compass.read(); #if SOLDR_DEBUG Serial.printf(&quot;[TEST] QMC5883L: x=%d y=%d z=%d\n&quot;, compass.getX(), compass.getY(), compass.getZ()); #endif } #if SOLDR_DEBUG Serial.printf(&quot;[READY] %d OK / %d FAIL\n&quot;, okCount, failCount); #endif } void loop() { unsigned long now = millis(); if (now - lastSample &gt;= SAMPLE_MS) { lastSample = now; if (mpuOk) { float ax, ay, az, p, r; readAccel(ax, ay, az); float gMag = sqrtf(ax * ax + ay * ay + az * az); gFilt += 0.25f * (gMag - gFilt); accelToTilt(ax, ay, az, p, r); pitchDeg += 0.25f * ((p - pitchZero) - pitchDeg); rollDeg += 0.25f * ((r - rollZero) - rollDeg); } if (qmcOk) { updateCompassHeading(); } updateGaugeNeedle(gFilt); updateCompassNeedle(headingDeg); updateReadouts(gFilt, pitchDeg, rollDeg, headingDeg); } #if SOLDR_DEBUG if (now - lastLog &gt;= LOG_MS) { lastLog = now; Serial.printf(&quot;[DATA] g=%.2f pitch=%.1f roll=%.1f hdg=%.0f\n&quot;, gFilt, pitchDeg, rollDeg, headingDeg); if (!mpuOk) Serial.println(&quot;[WARN] MPU6050: not initialised, G and tilt frozen&quot;); if (!qmcOk) Serial.println(&quot;[WARN] QMC5883L: not initialised, heading frozen&quot;); } #endif }</pre><h3>How it works</h3><ul><li>Every 25 ms the sketch reads the MPU6050 (set to plus or minus 4 G) and works out total acceleration. That’s the needle: 0 to 2 G across the dial, about 1 G at rest because gravity is always there.</li><li>So it’s a G-meter, not a tilt meter. Slow tilting barely moves it; a flick swings it.</li><li>Pitch and roll come from the same accelerometer. At boot it shows Hold level… and averages 50 readings over half a second; that angle becomes zero.</li><li>The compass calibrates itself: as you turn the board it records the lowest and highest readings on X and Y, then removes the offset from nearby metal (the hard-iron error).</li><li>Heading uses a circular filter, so 359 to 0 doesn’t swing the needle the long way round. You get degrees plus N, NE, E and so on, and the small needle points to magnetic north.</li><li>It only redraws what changed, so there’s no flicker.</li></ul><h3>Step 3: Try it</h3><ol><li>In the Arduino IDE, install the ESP32 board package plus Adafruit GFX Library, Adafruit ILI9341, Adafruit MPU6050, Adafruit Unified Sensor and QMC5883LCompass, and pick ESP32 Dev Module.</li><li>Paste the sketch as car_gauge.ino, upload it, and open the Serial Monitor at 115200.</li><li>Keep it flat and still while it says Hold level… You should see [INIT] lines for all three parts, then [READY] 3 OK / 0 FAIL.</li><li>Turn it slowly through one full circle, flat on the desk, so the compass learns its offset.</li><li>Now flick it, tilt it and turn it.</li></ol><h3>If something’s off</h3><ul><li><strong>White or blank screen:</strong> check LED to 3V3, then CS on 5, DC on 4 and RST on 13. The sketch can’t detect the screen, so it says OK even when it isn’t wired.</li><li><strong>QMC5883L: FAIL (no ACK at 0x0D):</strong> check SDA and SCL. Some compass boards carry an HMC5883L at 0x1E instead, which this library doesn’t talk to.</li><li><strong>MPU6050: FAIL:</strong> check SDA on 21, SCL on 22, and that AD0 isn’t pulled high (that moves it to 0x69).</li><li><strong>Heading is way off:</strong> it&#39;s only right held flat (no tilt compensation). Redo the full-circle turn away from metal, and set MAG_DECLINATION_DEG for where you live if you want.</li></ul><h3>How Soldr designs this from the idea</h3><p>Want a peak-G marker or a lap timer? Describe the idea at <a href="https://soldr.ai/">soldr.ai</a>. Soldr designs hardware from the idea: it asks which board you want, picks parts from the Compoden catalog, assigns the pins, gives you the wiring and writes the firmware, then compiles it for your board. For this one the idea was a digital car gauge with a round G needle, tilt and a compass that move live.</p><p>Put it in a small box and it&#39;s the most satisfying thing on your desk to flick.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/esp32-car-gauge-ili9341-tft-mpu6050-qmc5883l"><em>https://compoden.com</em></a><em> on November 16, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d2374200eeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ESP32 + 0.96 Inch OLED: Build a Desk Wi-Fi Scanner That Lists Nearby N]]></title>
            <link>https://medium.com/@compodenin/esp32-0-96-inch-oled-build-a-desk-wi-fi-scanner-that-lists-nearby-n-2f291f3a2f38?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f291f3a2f38</guid>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[iot]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 04:30:42 GMT</pubDate>
            <atom:updated>2026-11-22T06:35:37.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EK9cwcipV2JAJhze" /></figure><p>Your Wi-Fi is slow in one corner of the house and fine in another, and your phone just shows three bars. This little desk gadget gives you the real picture: an ESP32 scans the air, sorts nearby networks strongest first, and shows each one with its channel and signal bars on a 0.96 inch OLED. One button scrolls, and holding it rescans.</p><p>It’s a nice first ESP32 build too: three parts, no soldering, and it runs straight off USB.</p><p>Soldr designed this build, the parts list, the wiring and the code around parts that can be shipped to you in India. Soldr is Compoden’s AI, AI built on a catalog, so everything below is a part you can order here. If anything is missing, incorrect, or doesn’t work as expected, let us know so it can be fixed.</p><h3>What you need</h3><h3>Step 1: Wire the OLED and the button</h3><p>Everything runs from the ESP32’s USB, and every GND is shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FlywToC51GoOOuJg" /></figure><p>A few notes so it works the first time:</p><ul><li><strong>Feed the OLED from 3V3.</strong> The SSD1306 module is happy on 3.3V, and that keeps its I2C lines at the ESP32’s own logic level. No level shifter needed.</li><li><strong>No resistor on the button.</strong> The code uses the internal pull-up (INPUT_PULLUP), so the button just connects GPIO4 to GND. On a 4-leg switch, use diagonally opposite legs.</li><li><strong>Short on breadboard space?</strong> The DevKitC is a wide board. If it covers most of the holes, plug male-to-female jumpers straight onto its header pins and keep the breadboard for the button.</li><li><strong>About the two colours.</strong> On the yellow/blue OLED the header shows in yellow and the list in blue (the first row can look two-tone). The <a href="https://compoden.com/products/0-96-inch-oled-display-128x64-i2c-white-ssd1306">white SSD1306 OLED</a> works the same with this wiring.</li></ul><h3>Step 2: Upload the Soldr firmware</h3><p>Soldr generated this sketch for the scanner. Paste it as wifi_scanner.ino, install the Adafruit SSD1306 and Adafruit GFX libraries, and upload with the board set to ESP32 Dev Module.</p><pre>// legend: [SOLDR] build · [INIT] init · [TEST] self-test · [DATA] telemetry · [WARN]/[ERROR] fault · [FIX] likely remedy // // LOOP STRUCTURE (nothing blocks): // - every pass: poll the button (debounced, millis()) -&gt; short press = scroll, long press = rescan // - every pass: check the async Wi-Fi scan with WiFi.scanComplete(); when done, collect + sort results // - the OLED is redrawn only when something changed (dirty flag), never on a timer // // Wiring: // WIRING - generated from the same pin plan as the Wiring tab (follow the Wiring tab if in doubt): // 3V3 -&gt; 0.96 inch OLED Display Module 128x VCC // GND -&gt; 0.96 inch OLED Display Module 128x GND // GPIO21 -&gt; 0.96 inch OLED Display Module 128x SDA // GPIO22 -&gt; 0.96 inch OLED Display Module 128x SCL // GPIO4 -&gt; Tactile Push Button Switch With Ye one leg (the code reads it with INPUT_PULLUP) // GND -&gt; Tactile Push Button Switch With Ye the other leg (diagonally opposite on a 4-leg switch) // USB port -&gt; ESP32-DEVKITC Development Board powered from its own USB port (a cable to a computer or a 5 V USB charger) // Power: ESP32 USB port // // Library Manager: Adafruit SSD1306, Adafruit GFX Library #include &lt;Wire.h&gt; #include &lt;WiFi.h&gt; #include &lt;Adafruit_GFX.h&gt; #include &lt;Adafruit_SSD1306.h&gt; #define SOLDR_DEBUG 1 #define SDA_PIN 21 #define SCL_PIN 22 #define BUTTON_PIN 4 #define OLED_ADDR 0x3C #define SCREEN_W 128 #define SCREEN_H 64 #define MAX_NETS 24 #define VISIBLE_ROWS 6 #define ROW_H 8 #define LIST_Y 12 #define DEBOUNCE_MS 30 #define LONG_PRESS_MS 800 #define SSID_CHARS 10 struct NetInfo { char ssid[33]; int rssi; int channel; }; Adafruit_SSD1306 display(SCREEN_W, SCREEN_H, &amp;Wire, -1); NetInfo netList[MAX_NETS]; int netCount = 0; int selected = 0; bool scanning = false; bool displayOk = false; bool dirty = true; int okCount = 0; int failCount = 0; // button state bool btnStable = HIGH; bool btnLastRaw = HIGH; unsigned long btnChangedAt = 0; unsigned long btnPressedAt = 0; bool longHandled = false; void startScan() { WiFi.scanDelete(); int r = WiFi.scanNetworks(true); // async if (r == WIFI_SCAN_FAILED) { #if SOLDR_DEBUG Serial.println(&quot;[ERROR] WiFi: scan failed to start&quot;); Serial.println(&quot;[FIX] WiFi: check antenna/board is ESP32 and WiFi.mode(WIFI_STA) is set&quot;); #endif scanning = false; } else { scanning = true; #if SOLDR_DEBUG Serial.println(&quot;[DATA] scan=started&quot;); #endif } dirty = true; } void collectResults(int n) { netCount = 0; for (int i = 0; i &lt; n &amp;&amp; netCount &lt; MAX_NETS; i++) { NetInfo &amp;ni = netList[netCount]; String s = WiFi.SSID(i); if (s.length() == 0) { strncpy(ni.ssid, &quot;(hidden)&quot;, sizeof(ni.ssid) - 1); ni.ssid[sizeof(ni.ssid) - 1] = 0; } else { strncpy(ni.ssid, s.c_str(), sizeof(ni.ssid) - 1); ni.ssid[sizeof(ni.ssid) - 1] = 0; for (size_t k = 0; ni.ssid[k]; k++) { if ((uint8_t)ni.ssid[k] &lt; 32 || (uint8_t)ni.ssid[k] &gt; 126) ni.ssid[k] = &#39;?&#39;; } } ni.rssi = WiFi.RSSI(i); ni.channel = WiFi.channel(i); netCount++; } WiFi.scanDelete(); // insertion sort, strongest first for (int i = 1; i &lt; netCount; i++) { NetInfo key = netList[i]; int j = i - 1; while (j &gt;= 0 &amp;&amp; netList[j].rssi &lt; key.rssi) { netList[j + 1] = netList[j]; j--; } netList[j + 1] = key; } selected = 0; #if SOLDR_DEBUG Serial.printf(&quot;[DATA] networks=%d\n&quot;, netCount); for (int i = 0; i &lt; netCount; i++) { Serial.printf(&quot;[DATA] #%d ssid=%s rssi=%d ch=%d\n&quot;, i + 1, netList[i].ssid, netList[i].rssi, netList[i].channel); } #endif } int rssiToBars(int rssi) { if (rssi &gt; -55) return 4; if (rssi &gt; -65) return 3; if (rssi &gt; -75) return 2; if (rssi &gt; -85) return 1; return 0; } void drawBars(int x, int y, int level) { for (int b = 0; b &lt; 4; b++) { int h = 2 + b * 2; // 2,4,6,8 int bx = x + b * 5; int by = y + 7 - h + 1; if (b &lt; level) { display.fillRect(bx, by, 4, h, SSD1306_WHITE); } else { display.drawFastHLine(bx, y + 7, 4, SSD1306_WHITE); } } } void render() { if (!displayOk) return; display.clearDisplay(); display.setTextSize(1); display.setTextColor(SSD1306_WHITE); // header char head[28]; if (scanning) { snprintf(head, sizeof(head), &quot;Scanning...&quot;); } else if (netCount == 0) { snprintf(head, sizeof(head), &quot;WiFi: none found&quot;); } else { snprintf(head, sizeof(head), &quot;WiFi %d/%d&quot;, selected + 1, netCount); } display.setCursor(0, 0); display.print(head); display.drawFastHLine(0, 9, SCREEN_W, SSD1306_WHITE); if (netCount == 0 &amp;&amp; !scanning) { display.setCursor(0, 28); display.print(&quot;Hold button: rescan&quot;); } else { int top = 0; if (selected &gt;= VISIBLE_ROWS) top = selected - VISIBLE_ROWS + 1; for (int row = 0; row &lt; VISIBLE_ROWS; row++) { int idx = top + row; if (idx &gt;= netCount) break; int y = LIST_Y + row * ROW_H; char name[SSID_CHARS + 1]; strncpy(name, netList[idx].ssid, SSID_CHARS); name[SSID_CHARS] = 0; if (strlen(netList[idx].ssid) &gt; SSID_CHARS) { name[SSID_CHARS - 1] = &#39;.&#39;; } display.setCursor(0, y); display.print(idx == selected ? &quot;&gt;&quot; : &quot; &quot;); display.setCursor(8, y); display.print(name); char ch[8]; snprintf(ch, sizeof(ch), &quot;c%d&quot;, netList[idx].channel); display.setCursor(72, y); display.print(ch); drawBars(104, y, rssiToBars(netList[idx].rssi)); } } display.display(); } void handleShortPress() { if (scanning || netCount == 0) return; selected = (selected + 1) % netCount; dirty = true; #if SOLDR_DEBUG Serial.printf(&quot;[DATA] scroll=%d/%d\n&quot;, selected + 1, netCount); #endif } void pollButton() { unsigned long now = millis(); bool raw = digitalRead(BUTTON_PIN); if (raw != btnLastRaw) { btnLastRaw = raw; btnChangedAt = now; } if ((now - btnChangedAt) &gt;= DEBOUNCE_MS &amp;&amp; raw != btnStable) { btnStable = raw; if (btnStable == LOW) { btnPressedAt = now; longHandled = false; } else { if (!longHandled) handleShortPress(); } } if (btnStable == LOW &amp;&amp; !longHandled &amp;&amp; (now - btnPressedAt) &gt;= LONG_PRESS_MS) { longHandled = true; if (!scanning) startScan(); } } void setup() { Serial.begin(115200); delay(300); #if SOLDR_DEBUG Serial.println(&quot;[SOLDR] Desk WiFi Scanner | board:ESP32-DEVKITC | v1.0&quot;); #endif pinMode(BUTTON_PIN, INPUT_PULLUP); okCount++; #if SOLDR_DEBUG Serial.printf(&quot;[INIT] Button: OK (GPIO%d, INPUT_PULLUP)\n&quot;, BUTTON_PIN); Serial.printf(&quot;[TEST] Button: level=%d (1=released)\n&quot;, digitalRead(BUTTON_PIN)); #endif Wire.begin(SDA_PIN, SCL_PIN); if (display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDR)) { displayOk = true; okCount++; display.clearDisplay(); display.display(); #if SOLDR_DEBUG Serial.println(&quot;[INIT] OLED SSD1306: OK&quot;); #endif } else { failCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] OLED SSD1306: FAIL (no ACK at 0x3C)&quot;); Serial.println(&quot;[FIX] OLED SSD1306: check SDA-&gt;GPIO21, SCL-&gt;GPIO22, 3V3/GND; some modules use 0x3D&quot;); #endif } WiFi.mode(WIFI_STA); WiFi.disconnect(); okCount++; #if SOLDR_DEBUG Serial.println(&quot;[INIT] WiFi STA: OK&quot;); Serial.printf(&quot;[READY] %d OK / %d FAIL\n&quot;, okCount, failCount); #endif startScan(); render(); dirty = false; } void loop() { pollButton(); if (scanning) { int n = WiFi.scanComplete(); if (n &gt;= 0) { scanning = false; collectResults(n); dirty = true; } else if (n == WIFI_SCAN_FAILED) { scanning = false; #if SOLDR_DEBUG Serial.println(&quot;[ERROR] WiFi: scan failed&quot;); Serial.println(&quot;[FIX] WiFi: hold the button to retry the scan&quot;); #endif dirty = true; } } if (dirty) { dirty = false; render(); } }</pre><h3>How it works</h3><ul><li>At start-up it checks the button and the OLED, puts the Wi-Fi radio in station mode and starts a scan in the background, so the button keeps working while it listens.</li><li>When the scan finishes, it keeps up to 24 networks, sorts them strongest first and shows six at a time: name (first 10 characters), channel as c1 to c13, and 0 to 4 signal bars.</li><li>Bars come from the signal strength (RSSI): 4 bars above -55 dBm, 3 above -65, 2 above -75, 1 above -85. Networks that don’t broadcast a name show as (hidden).</li><li>A short press moves the arrow down the list and wraps back to the top. Holding the button for 0.8 s starts a fresh scan; the header says Scanning… while it works.</li><li>Every network also goes to the Serial Monitor as a [DATA] line with its name, RSSI and channel.</li><li>It only scans. It never joins a network and doesn’t need any password.</li></ul><h3>Step 3: Try it</h3><ol><li>In the Arduino IDE, install the ESP32 board package plus the Adafruit SSD1306 and Adafruit GFX libraries, and pick ESP32 Dev Module.</li><li>Paste the sketch as wifi_scanner.ino, upload it, and open the Serial Monitor at 115200.</li><li>You’ll see [INIT] lines, then [READY], and a few seconds later the OLED fills with networks.</li><li>Tap the button to scroll, hold it to rescan. Carry it around on a power bank and watch your own network’s bars change room by room.</li><li>Look at which channels your neighbours crowd onto. If most strong networks sit on the same channel as yours, moving your router to a quieter one of 1, 6 or 11 often helps.</li></ol><h3>If something’s off</h3><ul><li><strong>OLED FAIL (no ACK at 0x3C):</strong> check SDA on GPIO21, SCL on GPIO22, plus 3V3 and GND. Some modules use 0x3D; change OLED_ADDR if yours does.</li><li><strong>WiFi: none found:</strong> hold the button to rescan. The ESP32 only sees 2.4 GHz networks, so 5 GHz-only ones won’t appear.</li><li><strong>Upload fails:</strong> use a data micro-USB cable (some cables only charge), and hold the BOOT button on the board while the upload starts if it won’t connect.</li><li><strong>Sharing a photo?</strong> Blur your neighbours’ network names first, the same way you’d hide a Wi-Fi password.</li></ul><h3>How Soldr designs this from the idea</h3><p>Want a signal graph for one network, or a beep when your own network drops? Describe the idea at <a href="https://soldr.ai/">soldr.ai</a>. Soldr designs hardware from the idea: it picks parts from the Compoden catalog, assigns the pins and writes the firmware. For this one the prompt was a single sentence: a desk Wi-Fi scanner powered from USB with an ESP32 and a 0.96 inch SSD1306 OLED at I2C address 0x3C that lists nearby networks with signal bars and channel, with one push button to scroll and rescan.</p><p>Leave it on your desk and you’ll soon spot the corner your router barely reaches, and the channel nobody else is using.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/esp32-oled-desk-wifi-scanner-signal-bars-channels"><em>https://compoden.com</em></a><em> on November 14, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f291f3a2f38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Joystick + SG90 on Arduino Uno: Smooth Servo Pointer]]></title>
            <link>https://medium.com/@compodenin/joystick-sg90-on-arduino-uno-smooth-servo-pointer-d4f2f710a53f?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4f2f710a53f</guid>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[arduino-uno]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[diy]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 04:33:24 GMT</pubDate>
            <atom:updated>2026-11-22T06:35:15.203Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*47icyfacHvRgDkLC" /></figure><p>Joystick-controls-a-servo is one of the first projects almost everyone tries. The usual version maps the stick straight to an angle, so the servo snaps around and jumps back to the middle the second you let go. It works, but it feels twitchy.</p><p>This one drives the servo like a camera head instead. Push the stick a little and the pointer creeps; push it all the way and it moves faster. Let go and it stays exactly where it is. Click the joystick (or a separate button) and it glides back to centre, and an LED lights up when you hit either end of the travel.</p><p>Soldr designed the build, the parts list, the wiring and the code around parts that can be shipped to you in India. Soldr is Compoden’s AI, AI built on a catalog, so everything below is a part you can order here. If anything is missing, incorrect, or doesn’t work as expected, let Compoden know so it can be fixed.</p><h3>What you need</h3><p>A strip of card or a paper arrow on the servo horn makes the pointer easy to see.</p><h3>Step 1: Wire the joystick, servo, LED and button</h3><p>Everything runs at 5V from the Uno’s USB, and every GND is shared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wN60LQWWdLHmWhXX" /></figure><p>A few notes so it works the first time:</p><ul><li><strong>Use the breadboard rails.</strong> Run the Uno’s 5V and GND to the breadboard’s power rails, then feed the joystick and servo from there.</li><li><strong>No pull-up resistors needed.</strong> Both buttons use the Uno’s internal pull-ups (INPUT_PULLUP), so each one just connects its pin to GND when pressed.</li><li><strong>Use the diagonal legs of the button.</strong> On a 4-leg tactile switch, the legs on the same side are often already joined. Diagonally opposite legs are always the switched pair.</li><li><strong>The 220 ohm resistor is not optional.</strong> It limits the LED current from the 5V pin. Red-red-brown is the colour code.</li><li><strong>Pins follow Soldr’s wiring plan.</strong> The prompt asked for A0, D4 and D2, but Soldr assigned VRX to A2, the LED to D3 and the joystick click to D5, and said so in the build. Wire it as shown here, which matches the sketch.</li></ul><h3>Step 2: Upload the Soldr firmware</h3><p>Soldr generated this sketch for the pointer. Paste it as joystick_servo_pointer.ino and upload with the board set to Arduino Uno.</p><pre>// UNRESOLVED: servo power supply (no part selected; SG90 runs from Uno USB 5V for now) // legend: [SOLDR] build · [INIT] init · [TEST] self-test · [DATA] telemetry · [WARN]/[ERROR] fault · [FIX] likely remedy // // Wiring (Arduino Uno R3): // WIRING - generated from the same pin plan as the Wiring tab (follow the Wiring tab if in doubt): // 5V -&gt; 5D Rocker Joystick Module VCC // GND -&gt; 5D Rocker Joystick Module GND // A2 -&gt; 5D Rocker Joystick Module VRX // A3 -&gt; 5D Rocker Joystick Module VRY // 5 -&gt; 5D Rocker Joystick Module SW // 5V -&gt; SG90 9g Micro Servo Motor VCC // GND -&gt; SG90 9g Micro Servo Motor GND // 9 -&gt; SG90 9g Micro Servo Motor SIGNAL // 3 -&gt; 5mm LED Assorted Pack ANODE (+, LONG leg) - through a 220Ω resistor in series // GND -&gt; 5mm LED Assorted Pack CATHODE (-, SHORT leg / flat side of the rim) // 2 -&gt; Tactile Push Button Switch With Ye one leg (the code reads it with INPUT_PULLUP) // GND -&gt; Tactile Push Button Switch With Ye the other leg (diagonally opposite on a 4-leg switch) // USB port -&gt; Arduino Uno R3 CH340G powered from its own USB port (a cable to a computer or a 5 V USB charger) #include &lt;Servo.h&gt; #define SOLDR_DEBUG 1 #define PIN_JOY_X A2 #define PIN_JOY_Y A3 #define PIN_JOY_SW 5 #define PIN_BUTTON 2 #define PIN_SERVO 9 #define PIN_LED 3 const int ANGLE_MIN = 0; const int ANGLE_MAX = 180; const int ANGLE_HOME = 90; const int DEADZONE = 40; // ADC counts around centre ignored const float MAX_STEP = 2.5; // degrees per update at full deflection const unsigned long UPDATE_MS = 20; const unsigned long DEBOUNCE_MS = 30; const unsigned long REPORT_MS = 500; Servo pointer; float angle = ANGLE_HOME; int joyCentre = 512; int joyCentreY = 512; unsigned long lastUpdate = 0; unsigned long lastReport = 0; // debounce state for a combined &quot;centre&quot; request (tactile button OR joystick click) bool lastRawPressed = false; bool stablePressed = false; unsigned long lastEdge = 0; bool centrePressedRaw() { return digitalRead(PIN_BUTTON) == LOW || digitalRead(PIN_JOY_SW) == LOW; } void setup() { uint8_t okCount = 0, failCount = 0; Serial.begin(115200); pinMode(PIN_JOY_X, INPUT); pinMode(PIN_JOY_Y, INPUT); pinMode(PIN_BUTTON, INPUT_PULLUP); pinMode(PIN_JOY_SW, INPUT_PULLUP); pinMode(PIN_LED, OUTPUT); digitalWrite(PIN_LED, LOW); #if SOLDR_DEBUG Serial.println(F(&quot;[SOLDR] Joystick servo pointer | board:Arduino Uno R3 | v1.1&quot;)); #endif // Joystick: sample resting centre of both axes (leave stick untouched at power-up) long sumX = 0, sumY = 0; for (uint8_t i = 0; i &lt; 16; i++) { sumX += analogRead(PIN_JOY_X); sumY += analogRead(PIN_JOY_Y); delay(5); } joyCentre = (int)(sumX / 16); joyCentreY = (int)(sumY / 16); #if SOLDR_DEBUG Serial.print(F(&quot;[TEST] Joystick X: centre=&quot;)); Serial.println(joyCentre); Serial.print(F(&quot;[TEST] Joystick Y: centre=&quot;)); Serial.println(joyCentreY); #endif if (joyCentre &lt; 300 || joyCentre &gt; 724 || joyCentreY &lt; 300 || joyCentreY &gt; 724) { failCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] Joystick: FAIL (resting value far from mid-scale)&quot;)); Serial.println(F(&quot;[FIX] Joystick: check VRX on A2, VRY on A3, 5V and GND wiring, and keep the stick released at power-up&quot;)); #endif } else { okCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] Joystick: OK&quot;)); #endif } // Buttons: a pressed-at-boot reading usually means a wiring short bool btnStuck = (digitalRead(PIN_BUTTON) == LOW); #if SOLDR_DEBUG Serial.print(F(&quot;[TEST] Button: raw=&quot;)); Serial.println(digitalRead(PIN_BUTTON)); #endif if (btnStuck) { failCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] Button: FAIL (reads pressed at boot)&quot;)); Serial.println(F(&quot;[FIX] Button: wire between D2 and GND only, no VCC&quot;)); #endif } else { okCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] Button: OK&quot;)); #endif } // LED blink self-test digitalWrite(PIN_LED, HIGH); delay(200); digitalWrite(PIN_LED, LOW); okCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] LED: OK (watch D3 blink once; if dark, check polarity and 220R resistor)&quot;)); #endif // Servo attached LAST, after everything else is up pointer.attach(PIN_SERVO); pointer.write(ANGLE_HOME); okCount++; #if SOLDR_DEBUG Serial.println(F(&quot;[INIT] Servo: OK (attached on D9, centred)&quot;)); Serial.print(F(&quot;[READY] &quot;)); Serial.print(okCount); Serial.print(F(&quot; OK / &quot;)); Serial.print(failCount); Serial.println(F(&quot; FAIL&quot;)); #endif } void loop() { unsigned long now = millis(); // Debounced centre button (tactile button or joystick click) bool raw = centrePressedRaw(); if (raw != lastRawPressed) { lastEdge = now; lastRawPressed = raw; } if ((now - lastEdge) &gt; DEBOUNCE_MS &amp;&amp; raw != stablePressed) { stablePressed = raw; if (stablePressed) { angle = ANGLE_HOME; #if SOLDR_DEBUG Serial.println(F(&quot;[DATA] centre requested&quot;)); #endif } } // Joystick X sets the speed of travel; release holds position if (now - lastUpdate &gt;= UPDATE_MS) { lastUpdate = now; int offset = analogRead(PIN_JOY_X) - joyCentre; if (abs(offset) &gt; DEADZONE) { float span = (offset &gt; 0) ? (1023 - joyCentre) : joyCentre; float norm = (float)(abs(offset) - DEADZONE) / (span - DEADZONE); if (norm &gt; 1.0) norm = 1.0; float step = norm * MAX_STEP; angle += (offset &gt; 0) ? step : -step; } if (angle &lt; ANGLE_MIN) angle = ANGLE_MIN; if (angle &gt; ANGLE_MAX) angle = ANGLE_MAX; pointer.write((int)angle); digitalWrite(PIN_LED, ((int)angle &lt;= ANGLE_MIN || (int)angle &gt;= ANGLE_MAX) ? HIGH : LOW); } #if SOLDR_DEBUG if (now - lastReport &gt;= REPORT_MS) { lastReport = now; char buf[56]; snprintf(buf, sizeof(buf), &quot;[DATA] angle=%d joyX=%d joyY=%d&quot;, (int)angle, analogRead(PIN_JOY_X), analogRead(PIN_JOY_Y)); Serial.println(buf); } #endif }</pre><h3>How it works</h3><ul><li>At power-up the sketch reads both joystick axes 16 times and averages them to find the stick’s real resting point. Cheap joysticks rarely sit at exactly 512, so this calibration step is what keeps the pointer from drifting on its own. Keep your hand off the stick for that first moment.</li><li>Every 20 ms it reads the X axis and subtracts that centre. Anything within 40 counts either side is ignored (the deadzone), so tiny wobbles don’t move the servo.</li><li>Outside the deadzone, how far you push sets the speed, up to 2.5 degrees per update at full deflection. That’s rate control: the stick sets speed, not position, which is why the pointer holds still when you let go.</li><li>The angle is clamped between 0 and 180 degrees. At either end the LED on D3 turns on, so you know you’ve hit the limit.</li><li>The tactile button and the joystick click are combined and debounced (30 ms). Either one sends the pointer back to 90 degrees.</li><li>Twice a second a [DATA] line on Serial prints the angle and both raw joystick readings, which is handy when you’re tuning.</li></ul><h3>Step 3: Try it</h3><ol><li>In the Arduino IDE, pick Arduino Uno as the board. Servo comes with the Uno board package, so there’s nothing extra to install.</li><li>Paste the sketch, upload it, and open the Serial Monitor at 115200. Don’t touch the joystick while it boots.</li><li>You’ll see the [SOLDR] banner, [TEST] lines with the joystick centre values, [INIT] lines for the joystick, button, LED and servo, then [READY]. The LED blinks once during the self-test and the servo moves to 90 degrees.</li><li>Push the stick gently left and right and watch the pointer creep, then push hard to make it travel faster. Run it to an end and the LED comes on. Click the stick to bring it home.</li></ol><h3>If something’s off</h3><ul><li><strong>Joystick FAIL at boot:</strong> the resting value is far from the middle. Check VRX on A2, VRY on A3, plus 5V and GND, and make sure nobody is holding the stick during reset.</li><li><strong>Button FAIL at boot:</strong> D2 reads pressed before you touch it. The button should go between D2 and GND only, using diagonal legs. Never connect it to 5V.</li><li><strong>The pointer moves the wrong way:</strong> it depends on which way the joystick is mounted. Turn the module around, or swap the plus and minus in the line angle += (offset &gt; 0) ? step : -step;.</li><li><strong>The Uno resets or the servo buzzes at the ends:</strong> the servo is pulling a lot of current against its own mechanical stop. Use a better USB port or charger. If it keeps happening, give the servo its own 5V supply and join its GND to the Uno’s GND.</li><li><strong>LED stays dark:</strong> the long leg goes towards D3 through the resistor, the short leg to GND.</li></ul><h3>How Soldr designs this from the idea</h3><p>Want two servos for a pan and tilt head using the Y axis too, a speed knob, or an ESP32 version you can steer from your phone? Describe the idea at <a href="https://soldr.ai/">soldr.ai</a>. Soldr designs hardware from the idea: it picks parts from the Compoden catalog, assigns the pins, and writes the firmware. For this one the prompt was a couple of sentences: an Uno, a 2-axis joystick steering an SG90 smoothly, the joystick button centring it, and an LED at either end stop, all USB powered on a breadboard.</p><p>Glue a paper arrow on the servo horn and you’ve got a little pointer that feels properly smooth. It’s also the exact control scheme you’ll want later for a camera mount or a robot arm joint.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/arduino-uno-joystick-sg90-servo-pointer-rate-control"><em>https://compoden.com</em></a><em> on November 12, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4f2f710a53f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Which Raspberry Pi to Buy: Zero 2 W vs Pi 4 vs Pi 5]]></title>
            <link>https://medium.com/@compodenin/which-raspberry-pi-to-buy-zero-2-w-vs-pi-4-vs-pi-5-bcc9a85ab48b?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcc9a85ab48b</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 06:54:15 GMT</pubDate>
            <atom:updated>2026-11-16T05:04:07.799Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aDg5bD_CWXJ7_VGy" /></figure><p><strong>Quick answer:</strong> Buy a Raspberry Pi 5 for a desktop, a home server or anything heavy; it needs a 5 V 5 A USB-C supply, a micro-HDMI cable and a cooler. Buy a Pi 4 for a steady, well-supported board that runs on a 5 V 3 A USB-C supply. Buy a Zero 2 W for small, low-power builds; it needs a 5 V 2.5 A micro USB supply, a mini HDMI cable and a header you solder on.</p><h3>Raspberry Pi boards compared</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NlimtCDkVyhGUCcH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q-A6J6ozf6hZr7fG" /></figure><p>Raspberry Pi Zero 2 W</p><p>Quad-core 1 GHz, 512 MB</p><p>5 V 2.5 A, micro USB</p><p>Mini HDMI</p><p>None needed for light use</p><p>Small, low-power, single-job builds</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fRwikK66i7-h4cR6" /></figure><p>Raspberry Pi 4 Model B</p><p>Quad-core Cortex-A72, 1 to 8 GB</p><p>5 V 3 A, USB-C</p><p>Micro-HDMI</p><p>Heatsink or fan for sustained load</p><p>Servers, media, general projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZwzeNXf7y8VpLgq_" /></figure><p>Raspberry Pi 5</p><p>Quad-core Cortex-A76 at 2.4 GHz, 2 to 16 GB</p><p>5 V 5 A, USB-C (27 W supply)</p><p>Micro-HDMI</p><p>Active cooler or a case with a fan for sustained load</p><p>Desktop use, heavy workloads, NVMe storage</p><h3>Pick this if…</h3><ul><li><strong>You want the fastest board, a desktop, or an SSD:</strong> <a href="https://compoden.com/products/raspberry-pi-5-4gb-quad-core-24ghz-sbc">Raspberry Pi 5 4GB</a>, or the <a href="https://compoden.com/products/raspberry-pi-5-model-b-8gb-high-performance-single-board-computer">8GB</a> for heavier multitasking.</li><li><strong>You want a dependable board for a home server, media player or home automation hub:</strong> <a href="https://compoden.com/products/raspberry-pi-4-model-b-4gb-ram-compoden">Raspberry Pi 4 Model B 4GB</a>.</li><li><strong>The build is small or battery-conscious</strong> (a camera, a sensor node, a handheld): <a href="https://compoden.com/products/raspberry-pi-zero-2-w-1ghz-quad-core-wi-fi-bluetooth-512mb-ram">Raspberry Pi Zero 2 W</a>.</li><li><strong>You only need to read sensors and switch outputs:</strong> a microcontroller such as an ESP32 or a Raspberry Pi Pico is simpler and starts instantly. A Raspberry Pi is a Linux computer.</li></ul><h3>Raspberry Pi 5: what to order with it</h3><p>Good to know: GPIO on the Pi 5 goes through a new on-board chip, so older Python libraries that access the pins directly (RPi.GPIO, pigpio) do not work on it. Use gpiozero.</p><p><a href="https://compoden.com/products/raspberry-pi-5-4gb-quad-core-24ghz-sbc">Raspberry Pi 5 4GB: see the current price</a></p><h3>Raspberry Pi 4: what to order with it</h3><p>The Pi 4 is slower than the Pi 5, but it draws less power, runs cooler, and has years of tutorials and add-ons behind it. For a server that sits in a corner, it is often the more sensible buy.</p><p><a href="https://compoden.com/products/raspberry-pi-4-model-b-4gb-ram-compoden">Raspberry Pi 4 Model B 4GB: see the current price</a></p><h3>Raspberry Pi Zero 2 W: what to order with it</h3><ul><li><strong>Power:</strong> a 5 V 2.5 A supply with a micro USB plug, into the port marked PWR.</li><li><strong>Display:</strong> a mini HDMI to HDMI cable or adapter. This is a different connector from the micro-HDMI on the Pi 4 and Pi 5.</li><li><strong>Header:</strong> the 40-pin header is not soldered on. Add a 40-pin male header if you want to use the GPIO pins.</li><li><strong>USB devices:</strong> a micro USB OTG adapter for a keyboard, because the data port is micro USB.</li><li><strong>Storage:</strong> a <a href="https://compoden.com/products/sandisk-32gb-microsd-card-class-10-for-raspberry-pi-arduino">32GB microSD card</a> for the operating system.</li></ul><p>With 512 MB of RAM, the Zero 2 W is happiest running without a desktop. It is a good fit for one job at a time.</p><p><a href="https://compoden.com/products/raspberry-pi-zero-2-w-1ghz-quad-core-wi-fi-bluetooth-512mb-ram">Raspberry Pi Zero 2 W: see the current price</a></p><h3>How much RAM?</h3><ul><li><strong>2 GB:</strong> headless projects, GPIO work, light servers.</li><li><strong>4 GB:</strong> the sensible default for most people.</li><li><strong>8 GB and above:</strong> desktop use with many browser tabs, containers, or larger workloads.</li></ul><p>All three boards use 3.3 V GPIO. Never connect a 5 V signal to a GPIO pin.</p><h3>Frequently asked questions</h3><p>Which Raspberry Pi should I buy?</p><p>A Raspberry Pi 5 for desktop use or heavy workloads, a Raspberry Pi 4 for a steady server or media player, and a Raspberry Pi Zero 2 W for small, low-power builds.</p><p>What power supply does each Raspberry Pi need?</p><p>The Raspberry Pi 5 needs a 5 V 5 A USB-C supply (the 27 W supply). The Raspberry Pi 4 needs a 5 V 3 A USB-C supply. The Raspberry Pi Zero 2 W needs a 5 V 2.5 A micro USB supply.</p><p>Which HDMI cable does a Raspberry Pi need?</p><p>The Raspberry Pi 4 and Pi 5 use micro-HDMI. The Raspberry Pi Zero 2 W uses mini HDMI. Neither is the full-size HDMI plug found on a TV cable.</p><p>Does the Raspberry Pi 5 need a fan?</p><p>For sustained heavy loads, use the active cooler or a case with a fan. Without cooling the board slows itself down when it gets hot.</p><p>Can I use a Raspberry Pi 4 power supply on a Raspberry Pi 5?</p><p>It will boot and run, but a 5 V 3 A supply makes the Pi 5 limit the current available to its USB ports. Use the 27 W supply if you power drives or other devices from USB.</p><p>Is 4GB of RAM enough for a Raspberry Pi?</p><p>For most projects, yes. Choose 8 GB or more for desktop use with many browser tabs, containers or larger workloads.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/which-raspberry-pi-to-buy-india"><em>https://compoden.com</em></a><em> on November 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcc9a85ab48b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Motor Driver for a Robot Car: L298N vs TB6612FNG]]></title>
            <link>https://medium.com/@compodenin/best-motor-driver-for-a-robot-car-l298n-vs-tb6612fng-e16925b79a69?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/e16925b79a69</guid>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[diy]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 06:53:57 GMT</pubDate>
            <atom:updated>2026-11-16T05:00:46.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*09t5ubFYV6ApAFKH" /></figure><p><strong>Quick answer:</strong> For a robot car with small DC gear motors, a MOSFET driver such as the TB6612FNG or DRV8833 is the better technical choice, because it wastes far less voltage than the L298N. The L298N is still the easiest to wire and handles higher voltages, so it suits 9 to 12 V motors. The A4988 is a stepper driver: use it for stepper motors, not for DC wheels.</p><h3>Motor drivers compared</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E97Q5YV6Ig9hG4YU" /></figure><p>DriverDrivesMotor voltageCurrent per channelVoltage lost in the driverWorks from 3.3 V logic</p><h3>Pick this if…</h3><ul><li><strong>Your motors are the small 3 to 6 V gear motors found in most robot car chassis:</strong> a TB6612FNG or DRV8833. More of the battery voltage reaches the wheels.</li><li><strong>Your motors are 9 to 12 V, or you want the simplest wiring with screw terminals:</strong> the <a href="https://compoden.com/products/l298n-motor-driver-module-specs-pinout-projects-compoden">L298N motor driver module</a>.</li><li><strong>You are using an Arduino Uno and want four motors with no loose wiring:</strong> the <a href="https://compoden.com/products/l293d-motor-driver-shield-for-arduino-drive-dc-stepper-motors">L293D motor driver shield</a>, for small motors only.</li><li><strong>You are driving a stepper motor</strong> (a plotter, a slider, a CNC axis): the <a href="https://compoden.com/products/a4988-stepper-motor-driver-module-with-microstepping-control">A4988</a>, or the <a href="https://compoden.com/products/drv8825-stepper-motor-driver-module">DRV8825</a> for higher voltage and finer microstepping. For bigger stepper motors that need more current than these small boards can give, the <a href="https://compoden.com/products/tb6600-stepper-motor-driver-module">TB6600 stepper driver</a>.</li></ul><h3>L298N: easy, robust, and wasteful</h3><p>The L298N module has screw terminals for the motors and supply, a wide voltage range, and an on-board 5 V regulator that can power an Arduino. It is hard to wire wrongly, which is why it is in most robot car tutorials.</p><p>Its weakness is the output stage. It loses about 2 V between the supply and the motor, and that loss turns into heat. On a 12 V motor that is acceptable. On a 6 V battery pack driving 6 V motors, the wheels only see about 4 V, so the car is slow and the batteries drain faster.</p><p>Keep the regulator jumper fitted only when the motor supply is 12 V or less.</p><p><a href="https://compoden.com/products/l298n-motor-driver-module-specs-pinout-projects-compoden">L298N motor driver module: see the current price</a></p><h3>TB6612FNG and DRV8833: better for small motors</h3><p>Both use MOSFET outputs, so they lose very little voltage and stay cool. Both are small boards with pin headers instead of screw terminals, and both take 3.3 V logic directly, which suits an ESP32.</p><ul><li><strong>TB6612FNG:</strong> motor supply up to 13.5 V, 1.2 A continuous per channel. It has separate logic and motor supply pins, and a standby pin that must be held HIGH for the motors to run.</li><li><strong>DRV8833:</strong> motor supply 2.7 to 10.8 V, about 1.5 A per channel. It runs from a single supply, so it suits one or two lithium cells. Do not use it with a 12 V supply.</li></ul><p>Their limit is current. If a motor’s stall current is higher than the driver’s rating, use a bigger driver.</p><h3>L293D shield: convenient, low current</h3><p>The shield plugs onto an Uno and drives up to four DC motors with no wiring between the board and the driver. Each channel is limited to 0.6 A, so it fits small gear motors and nothing larger.</p><p><a href="https://compoden.com/products/l293d-motor-driver-shield-for-arduino-drive-dc-stepper-motors">L293D motor driver shield: see the current price</a></p><h3>A4988: for steppers, not for wheels</h3><p>The A4988 turns step and direction pulses into coil currents for one bipolar stepper motor, with microstepping down to 1/16 step. It needs a motor supply of 8 to 35 V, and you must set its current limit with the small potentiometer before the first run. It cannot drive a plain DC motor in a useful way.</p><p>For larger steppers, the TB6600 is a cased driver with screw terminals and switches for setting the current and microstepping, so there is no small potentiometer to adjust. Check its listing for the voltage and current it supports before matching it to a motor.</p><p><a href="https://compoden.com/products/a4988-stepper-motor-driver-module-with-microstepping-control">A4988 stepper driver: see the current price</a> · <a href="https://compoden.com/products/tb6600-stepper-motor-driver-module">TB6600 stepper driver: see the current price</a> · <a href="https://compoden.com/products/nema-17-stepper-motor-18-step-045nm-bipolar">NEMA 17 stepper motor: see the current price</a></p><h3>Three rules for any motor driver</h3><ul><li>Join the driver’s ground to the microcontroller’s ground, even when the motors have their own battery.</li><li>Never power motors from the microcontroller’s 5 V or 3.3 V pin.</li><li>Size the driver for the motor’s stall current, not its running current.</li></ul><p>A rectangular 9 V battery cannot supply motor current. Use two 18650 cells or a pack of AA cells.</p><p>If you would rather describe the robot and get a matched parts list, <a href="https://app.soldr.ai/">Soldr</a> picks the driver and the supply for your motors, shows the wiring and writes the code.</p><h3>Frequently asked questions</h3><p>Which motor driver is best for a robot car?</p><p>For small 3 to 6 V gear motors, a MOSFET driver such as the TB6612FNG or DRV8833, because it wastes very little voltage. For 9 to 12 V motors or the simplest wiring, the L298N.</p><p>Why is the L298N inefficient?</p><p>Its output transistors lose about 2 V between the supply and the motor, and that loss becomes heat. The loss matters most with low-voltage motors and batteries.</p><p>Can an ESP32 control an L298N?</p><p>Yes. The L298N’s logic inputs accept the ESP32’s 3.3 V signals. Join the grounds and power the motors from a separate supply.</p><p>Can I use an A4988 to drive DC motors?</p><p>No. The A4988 is a stepper motor driver. Use an L298N, TB6612FNG or DRV8833 for DC motors.</p><p>What is the difference between the TB6612FNG and the DRV8833?</p><p>The TB6612FNG takes a motor supply up to 13.5 V and has separate logic and motor supply pins. The DRV8833 runs from a single 2.7 to 10.8 V supply, which suits one or two lithium cells.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/best-motor-driver-for-robot-car"><em>https://compoden.com</em></a><em> on November 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e16925b79a69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best ESP32 Board for Beginners in India: Which to Buy]]></title>
            <link>https://medium.com/@compodenin/best-esp32-board-for-beginners-in-india-which-to-buy-d2616840c7cf?source=rss-27757b6edd77------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2616840c7cf</guid>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[electronics]]></category>
            <category><![CDATA[esp32]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[india]]></category>
            <dc:creator><![CDATA[Compoden Electronics]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 06:53:08 GMT</pubDate>
            <atom:updated>2026-11-16T04:59:27.900Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cyq_RanOcMX7_FUd" /></figure><p><strong>Quick answer:</strong> For a first ESP32, buy a classic ESP32 development board (ESP32-WROOM-32, 30-pin or DevKitC). Almost every tutorial is written for it, it has plenty of pins, and it has both Wi-Fi and Bluetooth. Pick an ESP32-C3 Super Mini when size matters, an ESP32-S3 when you need native USB or more memory, and an ESP32-CAM only when the project is a camera.</p><h3>ESP32 boards compared</h3><h3>Pick this if…</h3><ul><li><strong>This is your first ESP32:</strong> the <a href="https://compoden.com/products/esp32-30-pin-development-board-cp2102-wifi-bluetooth">ESP32 30-pin development board (CP2102)</a> or the <a href="https://compoden.com/products/esp32-devkitc-development-board-black-wifi-bluetooth-module">ESP32-DEVKITC</a>. Tutorials, pin diagrams and example code nearly all assume this chip.</li><li><strong>You need Bluetooth Classic</strong> (a Bluetooth speaker link, a serial link to an older phone app): the classic ESP32. The S3 and C3 only have Bluetooth Low Energy.</li><li><strong>The project must be small:</strong> the <a href="https://compoden.com/products/esp32-c3-super-mini-development-board-hw-466ab-wifi-ble-risc-v-board">ESP32-C3 Super Mini</a>. It is the size of a postage stamp and still has Wi-Fi.</li><li><strong>You want the board to act as a USB keyboard, mouse or MIDI device, or you need more memory for a display:</strong> the <a href="https://compoden.com/products/esp32-s3-supermini-development-board-wifi-bluetooth-le-ultra-compact-ai-iot-microcontroller">ESP32-S3 SuperMini</a>.</li><li><strong>You are building a camera:</strong> the <a href="https://compoden.com/products/esp32-cam-board-ov2640-ov3660-wifi-bluetooth-module">ESP32-CAM</a> with the <a href="https://compoden.com/products/esp32-cam-mb-programmer-module-with-micro-usb-ch340g-plug-play">ESP32-CAM-MB programmer</a>.</li></ul><h3>Classic ESP32 dev board: the safe first choice</h3><p>The 30-pin board gives you 25 digital pins, 6 analog inputs and 2 DAC outputs. That is enough for a display, several sensors and a relay module at once. Its limits are the ones every tutorial already warns about: the pins are 3.3 V only, GPIO 6 to 11 are used by the flash chip, and GPIO 34 to 39 are inputs only.</p><p>It does not have native USB. Uploads go through a USB-to-serial chip on the board, which is why some computers need a driver installed once.</p><p><a href="https://compoden.com/products/esp32-30-pin-development-board-cp2102-wifi-bluetooth">ESP32 30-pin development board: see the current price</a></p><h3>ESP32-S3 SuperMini: more memory and native USB</h3><p>The S3 has a newer dual-core processor, 8 MB of flash and 2 MB of PSRAM on this board, and the USB port is wired straight to the chip. That lets it appear to a computer as a keyboard or other USB device. The trade-offs: no Bluetooth Classic, 18 GPIO on this small board, and fewer beginner tutorials than the classic ESP32.</p><p><a href="https://compoden.com/products/esp32-s3-supermini-development-board-wifi-bluetooth-le-ultra-compact-ai-iot-microcontroller">ESP32-S3 SuperMini: see the current price</a></p><h3>ESP32-C3 Super Mini: small and simple</h3><p>The C3 is a single-core RISC-V chip with Wi-Fi and BLE 5. It suits projects that do one thing: read a sensor and send it, switch a relay, drive a short LED strip. All pins are 3.3 V only. The board has no battery charging circuit, and two of its pins affect how it boots, so follow a C3 pin diagram, not a classic ESP32 one.</p><p><a href="https://compoden.com/products/esp32-c3-super-mini-development-board-hw-466ab-wifi-ble-risc-v-board">ESP32-C3 Super Mini: see the current price</a>. An <a href="https://compoden.com/products/expansion-board-for-esp32-c3-super-mini-breakout-module">expansion board</a> makes it easier to wire.</p><h3>ESP32-CAM: a camera board, not a starter board</h3><p>The ESP32-CAM adds a camera connector and a microSD slot. It has no USB port, so you need the ESP32-CAM-MB programmer or a USB-to-serial adapter to upload code. It also needs a steady 5 V supply when Wi-Fi is on, and most of its pins are already taken. It is the right board for a camera project and a frustrating first board for anything else.</p><p><a href="https://compoden.com/products/esp32-cam-board-ov2640-ov3660-wifi-bluetooth-module">ESP32-CAM: see the current price</a></p><h3>What to buy with your first ESP32</h3><p>If you would rather describe the project than start from a blank sketch, <a href="https://app.soldr.ai/">Soldr</a> picks the parts, shows the wiring, and writes, compiles and flashes the code from the browser, with no IDE to install.</p><h3>Frequently asked questions</h3><p>Which ESP32 board is best for beginners?</p><p>A classic ESP32 development board based on the ESP32-WROOM-32, in the 30-pin or DevKitC layout. It has the most tutorials, plenty of pins, and both Wi-Fi and Bluetooth.</p><p>What is the difference between ESP32, ESP32-S3 and ESP32-C3?</p><p>The classic ESP32 is dual-core with Wi-Fi, Bluetooth Classic and BLE. The ESP32-S3 is a newer dual-core chip with native USB and BLE 5 but no Bluetooth Classic. The ESP32-C3 is a single-core RISC-V chip with Wi-Fi and BLE 5, usually on a very small board.</p><p>Can I use 5V sensors with an ESP32?</p><p>You can power a 5 V sensor from the board’s 5V pin, but its signal must not reach an ESP32 pin at 5 V. ESP32 pins are 3.3 V only, so use a voltage divider or a level shifter on the signal line.</p><p>Is the ESP32-CAM good as a first ESP32?</p><p>No. It has no USB port, needs a separate programmer and a steady 5 V supply, and has few free pins. Buy it when the project is a camera.</p><p>Do I need to install a driver for an ESP32 board?</p><p>Sometimes. Boards that upload through a USB-to-serial chip (CP2102 or CH340) may need that chip’s driver on some computers. Boards with native USB, such as the ESP32-S3 and ESP32-C3, usually do not.</p><p><em>Originally published at </em><a href="https://compoden.com/blogs/guides/best-esp32-board-for-beginners-india"><em>https://compoden.com</em></a><em> on November 11, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2616840c7cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>