<?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: kaifi</title>
    <description>The latest articles on DEV Community by kaifi (@kaifi_d2b8f3a1151e923d5a2).</description>
    <link>https://dev.to/kaifi_d2b8f3a1151e923d5a2</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%2F4063809%2F944972a5-64c0-4ac8-98a7-4d6ac6f02b89.png</url>
      <title>DEV Community: kaifi</title>
      <link>https://dev.to/kaifi_d2b8f3a1151e923d5a2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kaifi_d2b8f3a1151e923d5a2"/>
    <language>en</language>
    <item>
      <title>How a Gas Pump Knows When Your Tank Is Full</title>
      <dc:creator>kaifi</dc:creator>
      <pubDate>Wed, 07 Oct 2026 08:49:26 +0000</pubDate>
      <link>https://dev.to/kaifi_d2b8f3a1151e923d5a2/how-a-gas-pump-knows-when-your-tank-is-full-2ee</link>
      <guid>https://dev.to/kaifi_d2b8f3a1151e923d5a2/how-a-gas-pump-knows-when-your-tank-is-full-2ee</guid>
      <description>&lt;p&gt;When a gas pump clicks off, it is not reading your fuel gauge.&lt;/p&gt;

&lt;p&gt;It does not know the size of your tank, how much fuel was already inside, or how many litres have been dispensed.&lt;/p&gt;

&lt;p&gt;The shutoff happens because of a small sensing system built into the nozzle.&lt;/p&gt;

&lt;h2&gt;
  
  
  The small hole near the nozzle tip
&lt;/h2&gt;

&lt;p&gt;Near the end of a fuel nozzle is a tiny opening.&lt;/p&gt;

&lt;p&gt;While fuel is flowing normally, air is drawn through that opening.&lt;/p&gt;

&lt;p&gt;As the tank fills, the fuel level eventually rises high enough to cover the sensing hole.&lt;/p&gt;

&lt;p&gt;Once that happens, airflow through the sensing passage changes.&lt;/p&gt;

&lt;p&gt;That pressure change is what tells the nozzle that fuel has reached the correct level.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pump does not rely on electronics
&lt;/h2&gt;

&lt;p&gt;The automatic shutoff is largely mechanical.&lt;/p&gt;

&lt;p&gt;Inside the nozzle, the pressure change affects a diaphragm connected to the shutoff mechanism.&lt;/p&gt;

&lt;p&gt;When the sensing hole becomes covered, the pressure difference causes the mechanism to trip.&lt;/p&gt;

&lt;p&gt;The main valve closes and fuel flow stops almost immediately.&lt;/p&gt;

&lt;p&gt;That familiar click is the result.&lt;/p&gt;

&lt;p&gt;No communication with the car is required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why the pump sometimes stops too early
&lt;/h2&gt;

&lt;p&gt;The system responds to conditions around the sensing hole, not only to the actual fuel level in the tank.&lt;/p&gt;

&lt;p&gt;That means the nozzle can shut off early if:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fuel splashes back toward the nozzle&lt;/li&gt;
&lt;li&gt;the nozzle is inserted at an unusual angle&lt;/li&gt;
&lt;li&gt;the filler neck causes turbulent fuel flow&lt;/li&gt;
&lt;li&gt;the tank is being filled too quickly&lt;/li&gt;
&lt;li&gt;vapour or liquid temporarily blocks the sensing path&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why repositioning the nozzle or reducing the flow rate sometimes fixes repeated early shutoffs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why topping off is a bad idea
&lt;/h2&gt;

&lt;p&gt;Once the nozzle clicks off, continuing to add fuel manually can cause problems.&lt;/p&gt;

&lt;p&gt;The automatic system is designed to stop when fuel reaches the intended level around the filler neck.&lt;/p&gt;

&lt;p&gt;Adding more fuel after that can lead to spills or interfere with systems designed to handle fuel vapour.&lt;/p&gt;

&lt;p&gt;The click is there for a reason.&lt;/p&gt;

&lt;h2&gt;
  
  
  A simple system solving a complex problem
&lt;/h2&gt;

&lt;p&gt;The clever part of the design is that the pump does not need to know anything about the vehicle.&lt;/p&gt;

&lt;p&gt;It works with different tank sizes, different cars, and different starting fuel levels.&lt;/p&gt;

&lt;p&gt;The nozzle simply reacts to a physical change near its tip.&lt;/p&gt;

&lt;p&gt;Airflow changes.&lt;/p&gt;

&lt;p&gt;Pressure changes.&lt;/p&gt;

&lt;p&gt;The valve trips.&lt;/p&gt;

&lt;p&gt;Fuel stops.&lt;/p&gt;

&lt;p&gt;That makes the system simple, fast, and reliable without requiring sensors inside the vehicle.&lt;/p&gt;

&lt;p&gt;I wrote a deeper explanation of the sensing hole, pressure system, diaphragm, shutoff mechanism, and why pumps sometimes stop early here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://olivez.in/blog/how-does-a-gas-pump-know-when-your-tank-is-full" rel="noopener noreferrer"&gt;Read more on Olivez&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mechanics</category>
      <category>howthingswork</category>
    </item>
    <item>
      <title>Why QR Codes Can Still Work When Part of Them Is Missing</title>
      <dc:creator>kaifi</dc:creator>
      <pubDate>Wed, 07 Oct 2026 08:32:06 +0000</pubDate>
      <link>https://dev.to/kaifi_d2b8f3a1151e923d5a2/why-qr-codes-can-still-work-when-part-of-them-is-missing-3o3m</link>
      <guid>https://dev.to/kaifi_d2b8f3a1151e923d5a2/why-qr-codes-can-still-work-when-part-of-them-is-missing-3o3m</guid>
      <description>&lt;p&gt;A QR code can be scratched, partly covered, printed badly, or have a logo placed over it and still scan correctly.&lt;/p&gt;

&lt;p&gt;That seems strange. If some of the black and white squares are missing, shouldn’t part of the information disappear too?&lt;/p&gt;

&lt;p&gt;The reason is simple: a QR code does not store only the message. It also contains structure and extra recovery data designed to tolerate errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  A QR code is more than a grid
&lt;/h2&gt;

&lt;p&gt;The small black and white squares are called modules, but they do not all have the same job.&lt;/p&gt;

&lt;p&gt;The three large square patterns near the corners are finder patterns. They help a scanner locate the QR code, determine its orientation, and understand how the grid is positioned.&lt;/p&gt;

&lt;p&gt;Other areas contain timing information, alignment patterns, format information, encoded data, and error-correction codewords.&lt;/p&gt;

&lt;p&gt;That means location matters when a QR code is damaged.&lt;/p&gt;

&lt;p&gt;Losing a few data modules may be recoverable. Damaging an important structural pattern can stop the scanner from reading the code at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reed-Solomon error correction
&lt;/h2&gt;

&lt;p&gt;QR codes use Reed-Solomon error correction.&lt;/p&gt;

&lt;p&gt;Instead of storing only the minimum data required for the message, the QR code includes additional information that can be used to reconstruct some missing or corrupted data.&lt;/p&gt;

&lt;p&gt;There are four QR error-correction levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;L:&lt;/strong&gt; roughly 7%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;M:&lt;/strong&gt; roughly 15%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Q:&lt;/strong&gt; roughly 25%&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;H:&lt;/strong&gt; roughly 30%&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These percentages are useful guidelines, not guarantees.&lt;/p&gt;

&lt;p&gt;A QR code set to Level H does not mean you can remove any random 30% of it and expect it to work.&lt;/p&gt;

&lt;p&gt;Where the damage occurs matters just as much as how much is damaged.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why QR codes can contain logos
&lt;/h2&gt;

&lt;p&gt;This is also why many branded QR codes can place a logo in the center.&lt;/p&gt;

&lt;p&gt;The logo intentionally covers part of the code, while the remaining data and error-correction information allow the scanner to recover what is missing.&lt;/p&gt;

&lt;p&gt;Higher error correction usually gives a designer more room for this, but there are still limits.&lt;/p&gt;

&lt;p&gt;A logo that is too large, low contrast, or placed over important patterns can make the QR code unreliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Detection and recovery are different problems
&lt;/h2&gt;

&lt;p&gt;A scanner has to do two things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find and understand the QR code.&lt;/li&gt;
&lt;li&gt;Decode the information inside it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Error correction mainly helps with the second step.&lt;/p&gt;

&lt;p&gt;If the scanner cannot locate the code properly because a finder pattern is damaged, the data may technically still be recoverable, but the scanner may never reach that stage.&lt;/p&gt;

&lt;p&gt;This is why two QR codes with similar amounts of visible damage can behave very differently.&lt;/p&gt;

&lt;p&gt;One may scan instantly while the other fails completely.&lt;/p&gt;

&lt;h2&gt;
  
  
  The quiet zone matters too
&lt;/h2&gt;

&lt;p&gt;The blank margin around a QR code is called the quiet zone.&lt;/p&gt;

&lt;p&gt;It helps the scanner distinguish the QR code from nearby text, images, or other visual elements.&lt;/p&gt;

&lt;p&gt;A QR code can fail even when its actual data is intact if the quiet zone is removed or cluttered.&lt;/p&gt;

&lt;p&gt;So readability depends on more than the encoded message itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why badly damaged QR codes sometimes still scan
&lt;/h2&gt;

&lt;p&gt;Whether a damaged QR code works depends on several things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;error-correction level&lt;/li&gt;
&lt;li&gt;location of the damage&lt;/li&gt;
&lt;li&gt;condition of finder and alignment patterns&lt;/li&gt;
&lt;li&gt;QR code size&lt;/li&gt;
&lt;li&gt;print quality&lt;/li&gt;
&lt;li&gt;contrast&lt;/li&gt;
&lt;li&gt;lighting&lt;/li&gt;
&lt;li&gt;camera quality&lt;/li&gt;
&lt;li&gt;the surrounding quiet zone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scanner is not simply measuring how much of the image is missing. It is trying to reconstruct a structured code.&lt;/p&gt;

&lt;p&gt;That is why a QR code can sometimes look badly damaged and still work perfectly.&lt;/p&gt;

&lt;p&gt;The deeper explanation, including masking, codewords, alignment patterns, and why damage percentages can be misleading, is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://olivez.in/blog/why-can-a-qr-code-still-work-when-part-of-it-is-missing" rel="noopener noreferrer"&gt;Read more on Olivez&lt;/a&gt;&lt;/p&gt;

</description>
      <category>qrcode</category>
      <category>programming</category>
      <category>techtalks</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
