<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pratha Maniar</title>
    <description>The latest articles on DEV Community by Pratha Maniar (@pratha_maniar).</description>
    <link>https://dev.to/pratha_maniar</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3609090%2F508ec245-ca80-4a63-b584-00e881802f32.jpg</url>
      <title>DEV Community: Pratha Maniar</title>
      <link>https://dev.to/pratha_maniar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pratha_maniar"/>
    <language>en</language>
    <item>
      <title>The Chip That Has No ADC but Still Knows When Its Battery Is Low</title>
      <dc:creator>Pratha Maniar</dc:creator>
      <pubDate>Mon, 20 Jul 2026 13:11:05 +0000</pubDate>
      <link>https://dev.to/pratha_maniar/the-chip-that-has-no-adc-but-still-knows-when-its-battery-is-low-2p13</link>
      <guid>https://dev.to/pratha_maniar/the-chip-that-has-no-adc-but-still-knows-when-its-battery-is-low-2p13</guid>
      <description>&lt;p&gt;Somewhere out in the field, a tiny battery-powered sensor is quietly dying. No warning light, no alert, nothing. One day it just stops responding, and nobody knows why until someone finally goes and checks it by hand.&lt;/p&gt;

&lt;p&gt;How do you stop that from happening? The obvious answer is measure the battery voltage. But what if the chip you are using was never given an ADC(Analog to Digital Converter) to measure anything with?&lt;/p&gt;

&lt;p&gt;No ADC means no voltage reading, right? Not quite. Nordic's nRF5x family, including the nRF51 and nRF52 series, has a sneaky little piece of analog hardware built right into the silicon that does not care about your missing ADC at all. It is called &lt;strong&gt;POFCON&lt;/strong&gt;, the Power Failure Comparator, and it solves the whole problem with almost no power budget.&lt;/p&gt;

&lt;p&gt;Here is the story of how it works, and why it beats a traditional voltage divider for this job.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Familiar Way: ADC + Voltage Divider
&lt;/h3&gt;

&lt;p&gt;This is the setup everyone learns first.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two resistors split the battery voltage down to something the ADC can read&lt;/li&gt;
&lt;li&gt;Firmware wakes up, powers on the ADC, takes a sample, powers it back down&lt;/li&gt;
&lt;li&gt;The reading gets compared against a lookup table to decide battery health&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You get a real number - a full discharge curve, a percentage remaining, whatever you want.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The catch:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The divider leaks current constantly, unless you add a switch to gate it (more parts, more GPIOs, more headaches)&lt;/li&gt;
&lt;li&gt;Every ADC read costs power to spin up the analog block, settle, sample, and shut back down&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fine for a device on mains power. Brutal for a coin cell that is supposed to sleep for months.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Sneaky Way: POFCON
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;POFCON&lt;/strong&gt;, short for Power Failure Comparator, is a small analog comparator circuit built directly into the chip's silicon during manufacturing, sitting inside the power management block. It is real hardware, not a software feature - it is there whether you use it or not.&lt;/p&gt;

&lt;p&gt;You configure a voltage threshold, and the comparator watches the supply rail against an internal reference. It flags the result the moment the rail crosses the line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No sampling, no conversion, no ADC involved.&lt;/strong&gt; It just answers one question: are we above the threshold or below it?&lt;/p&gt;

&lt;p&gt;A minimal polling setup at the API level (nRF5 SDK) looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Configure the comparator threshold and enable it&lt;/span&gt;
&lt;span class="n"&gt;nrf_power_pofcon_set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NRF_POWER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;NRF_POWER_POFTHR_V23&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// threshold ~2.3V&lt;/span&gt;

&lt;span class="c1"&gt;// Later, on wake or on a timer, just read the flag&lt;/span&gt;
&lt;span class="n"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;battery_low&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nrf_power_pofcon_get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NRF_POWER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Using nRF Connect SDK / Zephyr instead of the nRF5 SDK?&lt;/strong&gt; The snippet above is a legacy nRF5 SDK register-level call. In NCS, power-fail detection is configured through devicetree/regulator bindings rather than these direct API calls - check the &lt;code&gt;nrfx_power&lt;/code&gt; driver docs for the equivalent on your SDK version before copying this in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Why this is clever:&lt;/strong&gt; it uses zero external components and burns almost no power, compared to a divider that leaks current and an ADC that costs power on every read.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No external divider needed - it watches the internal rail directly&lt;/li&gt;
&lt;li&gt;No ADC powers up, ever&lt;/li&gt;
&lt;li&gt;It exists specifically for chips that skip a full ADC to save die space and cost&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not a one-chip party trick. Plenty of low-cost, low-power parts skip the ADC for the same reason: cheaper silicon and lower standby current. The name changes depending on who made the chip, but the idea stays the same - a low-power comparator watching the supply rail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A few places you'll run into it:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Across the Nordic nRF5x lineup (nRF51, nRF52 series, and some nRF24 parts), it's called POFCON, exactly as covered here&lt;/li&gt;
&lt;li&gt;On STM8 and value-line STM32 parts, the equivalent is usually a Brownout Detector (BOD) or Low Voltage Detector (LVD)&lt;/li&gt;
&lt;li&gt;On other budget Bluetooth SoCs, including parts from vendors like Nations Technologies and Telink, you'll find similar brownout or low-voltage detection hardware, just under their own naming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;A quick word of caution before you go looking for one:&lt;/strong&gt; not every chip has this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some very low-cost parts skip both the ADC and any power-fail comparator, brownout detector, or low-voltage detector entirely&lt;/li&gt;
&lt;li&gt;Do not assume it's there just because the chip is marketed as low power&lt;/li&gt;
&lt;li&gt;Always open the datasheet first, confirm the block actually exists, and check its threshold options before you design your battery monitoring approach around it&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="crayons-card c-embed"&gt;

  &lt;br&gt;
&lt;strong&gt;The Takeaway:&lt;/strong&gt; If you just need a "low battery" signal and nothing more, do not reach for an external voltage divider circuit. Check the datasheet for a power-fail comparator, brownout detector, or low voltage detector block first. In Nordic parts that block is POFCON. On other vendors it will have a different name, but it is very likely already sitting there, unused, ready to do this exact job for close to zero extra power.&lt;br&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Real Tradeoff
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;ADC + Voltage Divider&lt;/th&gt;
&lt;th&gt;POFCON&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What you get&lt;/td&gt;
&lt;td&gt;Actual voltage value&lt;/td&gt;
&lt;td&gt;Above or below threshold, nothing else&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Detail level&lt;/td&gt;
&lt;td&gt;Full discharge curve possible&lt;/td&gt;
&lt;td&gt;One fixed threshold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Power cost&lt;/td&gt;
&lt;td&gt;Divider leaks current, ADC costs power per read&lt;/td&gt;
&lt;td&gt;Barely anything&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup effort&lt;/td&gt;
&lt;td&gt;Calibration, lookup tables&lt;/td&gt;
&lt;td&gt;Set a threshold and move on&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Good for&lt;/td&gt;
&lt;td&gt;Battery percentage, health tracking over time&lt;/td&gt;
&lt;td&gt;A simple low-battery flag, cheap&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you need the full story of your battery's life, use an ADC. If you just need to know when to shout "replace me," POFCON wins on power every single time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;Low-power design is always a game of tradeoffs. The instinct is usually to reach for an ADC by default, but hardware like POFCON is a good reminder that less is sometimes more when battery life is on the line.&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>hardware</category>
      <category>iot</category>
      <category>nrf52</category>
    </item>
    <item>
      <title>Secure Firmware Updates with a Secure Element: Building Trust Into the Bootloader</title>
      <dc:creator>Pratha Maniar</dc:creator>
      <pubDate>Fri, 22 May 2026 10:33:13 +0000</pubDate>
      <link>https://dev.to/pratha_maniar/secure-firmware-updates-with-a-secure-element-building-trust-into-the-bootloader-pip</link>
      <guid>https://dev.to/pratha_maniar/secure-firmware-updates-with-a-secure-element-building-trust-into-the-bootloader-pip</guid>
      <description>&lt;p&gt;Imagine your embedded device is deployed somewhere in the field - a smart meter, an industrial sensor, a vehicle ECU. You find a critical bug. You push a fix. The device downloads the new firmware over the air and flashes it.&lt;/p&gt;

&lt;p&gt;But here's the uncomfortable question: &lt;strong&gt;how does the device know that firmware actually came from you?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Anyone sitting on the same network could send a firmware package. A compromised update server could serve a malicious binary. &lt;/p&gt;

&lt;p&gt;Without a proper trust mechanism, your device is one bad OTA away from running someone else's code.&lt;/p&gt;

&lt;p&gt;This is the problem a &lt;strong&gt;Secure Element&lt;/strong&gt; solves - and this post walks through exactly how it works, from the chip itself to the bootloader verification flow.&lt;/p&gt;

&lt;h3&gt;
  
  
  What Is a Secure Element?
&lt;/h3&gt;

&lt;p&gt;A &lt;strong&gt;Secure Element (SE)&lt;/strong&gt; is a small, tamper-resistant chip whose one job is to safely store cryptographic keys and run crypto operations - without ever exposing those keys to the outside world.&lt;/p&gt;

&lt;p&gt;Think of it as a &lt;strong&gt;locked safe soldered onto your board&lt;/strong&gt;. Even if an attacker gets full control of your main CPU, dumps your flash, or probes your bus lines, the keys inside the SE remain out of reach.&lt;/p&gt;

&lt;p&gt;It protects against:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Physical attacks (chip probing, decapping, glitch injection)&lt;/li&gt;
&lt;li&gt;Software attacks (privilege escalation, memory dumps)&lt;/li&gt;
&lt;li&gt;Side-channel attacks (power analysis, timing attacks)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common SE chips used in embedded systems: &lt;strong&gt;ATECC608A, SE050, TPM 2.0.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Can a Secure Element Do?
&lt;/h3&gt;

&lt;p&gt;A secure element is not just a key storage box - it is a self-contained cryptographic engine. Here is what it can do:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Key generation and storage&lt;/strong&gt; - private keys are created and stored inside the chip and never leave it, not even during factory programming&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Digital signatures (ECDSA - Elliptic Curve Digital Signature Algorithm / Ed25519)&lt;/strong&gt; - signs or verifies data using stored keys; the core operation behind firmware verification&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Key agreement (ECDH - Elliptic Curve Diffie-Hellman)&lt;/strong&gt; - two parties derive a shared encryption key from exchanged public keys, without the secret ever crossing the wire&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Symmetric encryption (AES - Advanced Encryption Standard)&lt;/strong&gt; - encrypts and decrypts data directly on-chip; used to protect firmware package contents in transit&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Hashing (SHA-256 - Secure Hash Algorithm)&lt;/strong&gt; - computes a fixed 32-byte fingerprint of any data; one byte changed equals a completely different hash&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. True random number generation (TRNG)&lt;/strong&gt; - hardware entropy source for generating nonces, session keys, and signature randomness&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Monotonic counter&lt;/strong&gt; - a number that only goes up, never down, even across power cycles; blocks firmware downgrade attacks&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. Certificate storage&lt;/strong&gt; - stores X.509 certificates to prove device identity during TLS(Transport Layer Security) or OTA authentication&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Firmware Updates Need Signature Verification?
&lt;/h3&gt;

&lt;p&gt;When a device receives an OTA update, it has no way of knowing by default whether that firmware is genuine or has been tampered with.&lt;/p&gt;

&lt;p&gt;An attacker could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Intercept the OTA transfer and swap in malicious firmware&lt;/li&gt;
&lt;li&gt;Replay an older, vulnerable firmware version&lt;/li&gt;
&lt;li&gt;Extract a key from plain flash memory, sign a fake binary, and serve it&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Signature verification closes this.&lt;/strong&gt; The firmware is cryptographically signed by the manufacturer before it ever leaves the build system. The bootloader verifies that signature on the device before touching a single flash sector. If verification fails, nothing gets flashed.&lt;/p&gt;

&lt;p&gt;The Secure Element is what makes this guarantee solid - the verification key lives inside hardware-protected storage, not in flash memory where it can be read or replaced.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Verification Flow - Step by Step
&lt;/h3&gt;

&lt;h4&gt;
  
  
  On the Manufacturer Side
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Firmware binary is compiled, and a version header is attached (version number, hardware revision, and magic bytes).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;SHA-256 hash&lt;/strong&gt; of the entire firmware is computed - a fixed 32-byte fingerprint of the binary.&lt;/li&gt;
&lt;li&gt;That hash is signed using an &lt;strong&gt;ECDSA private key&lt;/strong&gt; stored in a Hardware Security Module (HSM - Hardware Security Module) on the build server. The result is a signature.&lt;/li&gt;
&lt;li&gt;Package is uploaded to the OTA server. The final package ships as:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ firmware binary + version header + ECDSA signature }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  On the Device Side - Inside the Bootloader
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Firmware package arrives and is written to a staging area in flash.
   (Primary firmware slot is untouched at this point.)

2. Bootloader reads the firmware header:
   - Magic number   → is this a valid package format?
   - Hardware rev   → is this firmware built for this exact hardware?
   - Version number → is this newer than what is currently running?

3. Bootloader computes SHA-256 over the full firmware binary.
   → 32-byte hash of exactly what was received.

4. Bootloader hands the hash + the signature to the Secure Element:
   SE.verify(hash, signature, public_key)

5. Secure Element runs ECDSA verification internally:
   - Uses the public key it has stored inside it
   - Mathematically checks whether the signature was produced
     by the matching private key over this exact hash
   - Returns PASS or FAIL - nothing else leaves the SE

6a. PASS:
    → Erase the primary firmware slot
    → Copy firmware from staging to primary slot
    → Increment the SE monotonic counter (locks out older versions)
    → Reboot and jump to new firmware entry point

6b. FAIL:
    → Erase the staging area
    → Boot the existing firmware as a safe fallback
    → Log the failure for reporting on next server connection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The key insight:&lt;/strong&gt; the private key that signed the firmware on the build server never exists on the device. Only the public key is on the device - locked inside the SE. A public key can verify signatures but cannot create them. So even if an attacker fully dumps the device's flash, they cannot forge firmware that passes verification.&lt;/p&gt;

&lt;h3&gt;
  
  
  Anti-Rollback: Why a Valid Signature Is Not Enough
&lt;/h3&gt;

&lt;p&gt;Here is a subtle attack worth understanding. Firmware v1.2 had a vulnerability - you patched it in v1.3. But v1.2 was real firmware, signed by your real private key. Its signature is completely valid.&lt;/p&gt;

&lt;p&gt;An attacker replays the old v1.2 package. Signature check passes. Device flashes vulnerable firmware. You are back to square one.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix is the SE monotonic counter&lt;/strong&gt; - a number stored inside the SE that only ever increments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SE stores: minimum_allowed_version = 1.3

Bootloader receives firmware v1.2:
  1.2 &amp;lt; 1.3  →  REJECTED, even though signature is valid.

After successfully flashing v1.4:
  SE increments counter → minimum_allowed_version = 1.4
  This cannot be undone by software.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because the counter is inside the SE, no software attack - not even a full OS compromise - can reset it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Firmware security is not just about encryption or passwords. It is about &lt;strong&gt;establishing a chain of trust&lt;/strong&gt; - from the moment code leaves your build system to the moment a device executes it.&lt;/p&gt;

&lt;p&gt;The Secure Element is the hardware anchor of that chain. The private key stays with you. The public key stays locked in silicon on the device. The bootloader does the verification. And the monotonic counter makes sure there is no going back.&lt;/p&gt;

</description>
      <category>embedded</category>
      <category>security</category>
      <category>firmware</category>
      <category>signature</category>
    </item>
    <item>
      <title>How Does a Fingerprint Turn Into a Secure Digital Identity?</title>
      <dc:creator>Pratha Maniar</dc:creator>
      <pubDate>Fri, 19 Dec 2025 06:58:47 +0000</pubDate>
      <link>https://dev.to/pratha_maniar/how-does-a-fingerprint-turn-into-a-secure-digital-identity-3p3i</link>
      <guid>https://dev.to/pratha_maniar/how-does-a-fingerprint-turn-into-a-secure-digital-identity-3p3i</guid>
      <description>&lt;h3&gt;
  
  
  Fingerprint-Based Security: From Capture to Secure Matching
&lt;/h3&gt;

&lt;p&gt;In a world where passwords are forgotten, stolen, or guessed, biometrics provides a far more reliable form of security, an identity based on who you are. Among all biometric technologies, fingerprint recognition remains the most widely deployed due to its accuracy, speed, and ease of use.&lt;/p&gt;

&lt;p&gt;But what really happens when a finger touches a sensor?&lt;br&gt;
How does a physical pattern on human skin turn into a secure digital identity?&lt;/p&gt;

&lt;p&gt;Let’s explore the complete journey, from fingerprint formation to secure matching.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. What Is a Biometric System?
&lt;/h3&gt;

&lt;p&gt;A biometric system identifies or verifies an individual using unique biological traits. Fingerprints are especially effective because they are unique, permanent, and easy to capture.&lt;/p&gt;

&lt;p&gt;Biometric systems operate in two main phases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Enrollment&lt;/strong&gt; – registering a user’s biometric data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; – verifying identity using live input.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Ridges and Valleys: The Foundation of Fingerprints
&lt;/h3&gt;

&lt;p&gt;A fingerprint is made up of alternating raised lines (ridges) and depressions (valleys) on the surface of the skin.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ridges are the elevated portions that make contact with a surface.&lt;/li&gt;
&lt;li&gt;Valleys are the spaces between ridges.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These ridge-valley patterns form unique shapes such as loops, whorls, and arches, which are determined before birth and remain stable throughout life.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. How a Fingerprint Image Is Generated
&lt;/h3&gt;

&lt;p&gt;When a finger is placed on a fingerprint sensor, ridges touch the surface while valleys remain slightly away.&lt;/p&gt;

&lt;p&gt;Depending on the sensor type:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Capacitive sensors&lt;/strong&gt; detect electrical differences between ridges and valleys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optical sensors&lt;/strong&gt; detect reflected light from ridge contact points.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ultrasonic sensors&lt;/strong&gt; map depth variations using sound waves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This interaction creates a contrast-rich image, where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Dark areas usually represent ridges.&lt;/li&gt;
&lt;li&gt;Light areas represent valleys.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This raw image is the digital representation of the fingerprint’s physical structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Pre-Processing: Enhancing Ridges and Valleys
&lt;/h3&gt;

&lt;p&gt;The raw fingerprint image may contain noise due to finger pressure, moisture, or skin condition. To improve clarity, the system performs preprocessing, which includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Contrast normalization.&lt;/li&gt;
&lt;li&gt;Noise reduction.&lt;/li&gt;
&lt;li&gt;Ridge enhancement.&lt;/li&gt;
&lt;li&gt;Binarization (ridges vs valleys).&lt;/li&gt;
&lt;li&gt;Thinning (reducing ridges to single-pixel width).
These steps sharpen the ridge-valley structure, making feature extraction more reliable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. Feature Extraction: Identifying Unique Points
&lt;/h3&gt;

&lt;p&gt;Rather than storing the entire fingerprint image, the system extracts distinct features, mainly minutiae points.&lt;/p&gt;

&lt;p&gt;Minutiae occur where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A ridge ends.&lt;/li&gt;
&lt;li&gt;A ridge split into two (bifurcation).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each minutia is defined by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Its location.&lt;/li&gt;
&lt;li&gt;Its orientation.&lt;/li&gt;
&lt;li&gt;Its type.
A fingerprint typically contains dozens of usable minutiae, which together form a unique digital signature.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. Enrollment: Creating a Secure Fingerprint Template
&lt;/h3&gt;

&lt;p&gt;During enrollment:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minutiae are extracted from each scan.&lt;/li&gt;
&lt;li&gt;A stable reference template is generated.&lt;/li&gt;
&lt;li&gt;The template is encrypted and stored securely.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. Secure Storage: Protecting Biometric Identity
&lt;/h3&gt;

&lt;p&gt;Because biometric data cannot be changed like a password, security is critical. Modern systems use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encrypted template storage.&lt;/li&gt;
&lt;li&gt;Secure elements or trusted execution environments.&lt;/li&gt;
&lt;li&gt;Hardware-based cryptographic protection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures fingerprints cannot be reconstructed even if storage is compromised.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Authentication: Matching Ridges and Patterns
&lt;/h3&gt;

&lt;p&gt;During authentication:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A live fingerprint is captured.&lt;/li&gt;
&lt;li&gt;Its features are extracted.&lt;/li&gt;
&lt;li&gt;The live template is compared with the stored template.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Matching algorithms align ridge patterns, compare minutiae relationships, and compute a similarity score. Access is granted only if the score crosses a secure threshold.&lt;/p&gt;

&lt;h3&gt;
  
  
  9. Accuracy and Anti-Spoofing Measures
&lt;/h3&gt;

&lt;p&gt;To prevent fake fingerprints, systems use liveness detection, checking factors like skin conductivity, ridge deformation, and depth/texture variations to ensure the fingerprint comes from a real, live finger.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Fingerprint biometrics use unique ridge and valley patterns to create a secure digital identity. From image capture to minutiae extraction and encrypted matching, every step ensures accuracy, privacy, and security.&lt;/p&gt;

&lt;p&gt;What seems like a simple touch is actually a powerful combination of biology, signal processing, cryptography, and embedded engineering, making fingerprints one of the most trusted security mechanisms in modern systems.&lt;/p&gt;

</description>
      <category>security</category>
      <category>biometric</category>
      <category>dataprocessing</category>
      <category>fingerprint</category>
    </item>
    <item>
      <title>A Deep Dive Into ESP-CSI: Channel State Information on ESP32 Chips</title>
      <dc:creator>Pratha Maniar</dc:creator>
      <pubDate>Wed, 19 Nov 2025 12:21:23 +0000</pubDate>
      <link>https://dev.to/pratha_maniar/a-deep-dive-into-esp-csi-channel-state-information-on-esp32-chips-5el1</link>
      <guid>https://dev.to/pratha_maniar/a-deep-dive-into-esp-csi-channel-state-information-on-esp32-chips-5el1</guid>
      <description>&lt;p&gt;Most people know Wi-Fi only as a way to connect phones, laptops, and IoT devices to the internet. But Wi-Fi can do much more.&lt;/p&gt;

&lt;p&gt;Espressif’s ESP-CSI (Channel State Information) technology allows ESP32-series chips to “sense” what is happening in the environment using only Wi-Fi signals-no cameras, no radar, no extra sensors.&lt;/p&gt;

&lt;p&gt;Every Wi-Fi signal changes as it passes through a room.&lt;br&gt;
People, walls, furniture, movement-everything affects the signal slightly.&lt;br&gt;
ESP-CSI captures these tiny changes in the Wi-Fi channel and turns them into meaningful data.&lt;/p&gt;

&lt;p&gt;This makes it possible to detect:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Human presence&lt;/li&gt;
&lt;li&gt;Motion&lt;/li&gt;
&lt;li&gt;Gestures&lt;/li&gt;
&lt;li&gt;Indoor positioning&lt;/li&gt;
&lt;li&gt;Environmental changes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And all of this works using only an ESP chip and Wi-Fi.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Is ESP-CSI Better Than RSSI?
&lt;/h3&gt;

&lt;p&gt;Normally, Wi-Fi devices only report RSSI (Received Signal Strength Indicator), which is a single number representing signal strength.&lt;br&gt;
However, CSI provides much more detailed information, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How each frequency of the Wi-Fi signal was changed.&lt;/li&gt;
&lt;li&gt;How much it was absorbed or reflected.&lt;/li&gt;
&lt;li&gt;How much noise is in the environment.&lt;/li&gt;
&lt;li&gt;How the signal phase rotated.&lt;/li&gt;
&lt;li&gt;How the signal was delayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Aspect&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;RSSI&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;CSI&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;What it shows&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Overall signal strength (one value)&lt;/td&gt;
&lt;td&gt;Detailed channel info (amplitude + phase per subcarrier)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Detail Level&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;Very high&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Sensitivity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Detects big changes only&lt;/td&gt;
&lt;td&gt;Detects tiny movements (even breathing)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Use Cases&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Basic connection quality, coarse location&lt;/td&gt;
&lt;td&gt;Motion sensing, presence, gesture, indoor positioning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Interference&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Easily affected&lt;/td&gt;
&lt;td&gt;More stable if environment doesn’t change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Accuracy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  How Does ESP-CSI Work?
&lt;/h3&gt;

&lt;p&gt;Wi-Fi uses OFDM, which splits one Wi-Fi channel into many smaller frequencies called subcarriers. Each Wi-Fi packet carries amplitude and phase information for every subcarrier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When these subcarriers travel through the environment, they get affected by:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;People absorbing energy.&lt;/li&gt;
&lt;li&gt;Moving objects shifting the wave pattern.&lt;/li&gt;
&lt;li&gt;Walls reflecting the signal.&lt;/li&gt;
&lt;li&gt;Furniture and air slightly bending the waves.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The ESP chip measures two things for each subcarrier:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amplitude-how strong the signal became.&lt;/li&gt;
&lt;li&gt;Phase-how much the wave rotated or was delayed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Together, this forms the CSI (Channel State Information) array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When someone moves:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amplitude values fluctuate.&lt;/li&gt;
&lt;li&gt;Phase values shift in characteristic patterns.&lt;/li&gt;
&lt;li&gt;Even small movements cause detectable changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These tiny variations act as “clues” about what happened in the environment. The ESP device captures this at the PHY layer, then exposes it to the user through CSI callback events in Espressif’s API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features of ESP-CSI
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Detailed Channel Insights&lt;/strong&gt;&lt;br&gt;
CSI provides amplitude and phase information for every Wi-Fi subcarrier, giving much more detail than a single RSSI value. This allows precise sensing of environmental changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. No Extra Hardware Required&lt;/strong&gt;&lt;br&gt;
Works on standard ESP32-series chips (ESP32, S2, C3, C6, etc.) using built-in Wi-Fi no special sensors or NICs needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. High Sensitivity&lt;/strong&gt;&lt;br&gt;
Can detect both large movements and very small changes, such as breathing or slight object shifts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Real-Time Processing&lt;/strong&gt;&lt;br&gt;
ESP chips can analyze CSI data locally and instantly, enabling fast responses without needing external servers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Flexible Operating Modes&lt;/strong&gt;&lt;br&gt;
Supports multiple ways to collect CSI, including sniffer mode, router-based CSI, and device-to-device communication for advanced setups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Stable and Robust&lt;/strong&gt;&lt;br&gt;
CSI amplitude data stays reliable even with typical indoor interference like chargers or other electronic devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Easy Software Integration&lt;/strong&gt;&lt;br&gt;
Fully supported in ESP-IDF and compatible with Espressif cloud tools, with open-source utilities to process and analyze CSI data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Is ESP-CSI Used?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Human activity detection:&lt;/strong&gt; Detect presence, movement, gestures, or even subtle actions like breathing-useful for security, elder care, and smart homes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Indoor positioning:&lt;/strong&gt; Provide accurate indoor location tracking for people or devices in buildings like malls, airports, and hospitals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Environmental monitoring:&lt;/strong&gt; Sense small changes in the environment through Wi-Fi signal variations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Intrusion detection:&lt;/strong&gt; Act as a motion sensor to detect unauthorized movement without cameras.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Asset tracking:&lt;/strong&gt; Track the real-time location of important items in places like warehouses or hospitals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Smart home automation:&lt;/strong&gt; Enable location-based actions, such as auto-adjusting lights, AC, or appliances.&lt;/p&gt;

&lt;h3&gt;
  
  
  Chip Performance Ranking
&lt;/h3&gt;

&lt;p&gt;Espressif categorizes the CSI capability of its chips approximately in the following order.&lt;br&gt;
&lt;em&gt;&lt;strong&gt;ESP32-C5 ＞ ESP32-C6 ＞ ESP32-C3 ≈ ESP32-S3 ＞ ESP32.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Meaning:
&lt;/h4&gt;

&lt;p&gt;Newer chips, like C5 &amp;amp; C6, → better CSI quality.&lt;br&gt;
C3 &amp;amp; S3 → good general performance.&lt;br&gt;
Original ESP32 → lowest but still works.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Can ESP-CSI Be Implemented?
&lt;/h3&gt;

&lt;p&gt;Espressif provides three ways to obtain CSI data.&lt;/p&gt;

&lt;h4&gt;
  
  
  Method 1: Getting CSI from a Router (get_router_csi)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup:&lt;/strong&gt; One ESP device + a router.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process:&lt;/strong&gt;
ESP sends ping packets to the router.
The router replies with packets containing CSI information.
ESP receives those packets and extracts CSI (amplitude, phase, etc.).
This is the simplest method-ideal for beginners.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Method 2: Exchanging CSI Between Two ESP Devices (get_device_csi)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup:&lt;/strong&gt; Two ESP chips + router acting as a relay.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process:&lt;/strong&gt;
Both ESP devices send ping packets to the router.
The router forwards packets to the correct device.
When Device B receives a ping from Device A, it replies with CSI.
Device A then extracts CSI information.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Method 3: Getting CSI Using a Dedicated Packet Sender (get_broadcast_csi)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Setup:&lt;/strong&gt; A device that sends broadcast packets + multiple ESP receivers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Process:&lt;/strong&gt;
The transmitter sends broadcast packets on different Wi-Fi channels.
All ESP devices (in monitor mode) receive these packets.
Each ESP extracts CSI data independently.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Want to dive deeper?&lt;/strong&gt; &lt;br&gt;
Check out Espressif’s official CSI documentation here:&lt;br&gt;
&lt;a href="https://docs.espressif.com/projects/esp-techpedia/en/latest/esp-friends/solution-introduction/esp-csi/esp-csi-solution.html" rel="noopener noreferrer"&gt;https://docs.espressif.com/projects/esp-techpedia/en/latest/esp-friends/solution-introduction/esp-csi/esp-csi-solution.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>esp32</category>
      <category>beginners</category>
      <category>wifisensing</category>
      <category>iot</category>
    </item>
  </channel>
</rss>
