AI 资讯
Because in a Life-Threatening Situation, Every Millisecond Counts
Removing expf() from a fire detector: one header, 1.95x faster, zero accuracy loss A smoke detector is not a demo project. When it fires, someone either evacuates in time or doesn't. The firmware running on that microcontroller has one job, and it needs to do it without hesitation, without bloat, and without dependencies that can fail in unexpected ways. Last May 28th I published a bare-metal fire detection system built with Hasaki 刃先 — a neural network trainer that exports standalone C headers with no runtime, no Python, no TensorFlow. The model is a 12-8-4-1 MLP trained on 28,596 sensor readings. It fits in 3.8 kB of Flash and achieves 99.93% accuracy on held-out data, with a single missed fire event out of 3,599. But there was something in that header that bothered me. static inline float sigmoid ( float x ) { return 1 . 0 f / ( 1 . 0 f + expf ( - x )); } expf() . Right there in a life-safety application. On a microcontroller that may not have a hardware FPU. The problem with expf() on bare metal On processors with a hardware FPU — like the ESP32-C3 — expf() is fast. But the moment you deploy to an ATmega328P, an ATtiny85, or any Cortex-M0 target, that call becomes software floating-point. The CPU has to simulate the operation in firmware, cycle by cycle. It works. But it carries hidden cost: unpredictable latency, dependency on math.h , and a transcendental function sitting in the critical path of every single inference. For a smoke detector running at 1 Hz this might seem irrelevant. But inference latency compounds with sensor reads, normalization, and communication overhead. And more importantly — if you're deploying to a truly constrained target, expf() might be the difference between fitting in Flash or not. The fix: one header from kigu-quant kigu-quant(comming soon) is a new tool in the Rosito Bench ecosystem. It generates ready-to-include C headers for evaluating mathematical functions on microcontrollers — no FPU, no libm, no dependencies. One command: k
开发者
Wi-Fi Doesn't Stand for Wireless Fidelity
Ask almost any engineer what "Wi-Fi" stands for and you'll hear the same answer: "Wireless Fidelity." It is one of the most repeated facts in tech, it appears in textbooks and product manuals, and it is wrong. Wi-Fi does not stand for Wireless Fidelity. In fact, it does not stand for anything at all. A name invented by a branding agency In 1999, the industry group then known as the Wireless Ethernet Compatibility Alliance — today the Wi-Fi Alliance — had a problem. The wireless networking standard it was promoting carried the memorable name "IEEE 802.11b Direct Sequence." That string is precise, but no consumer was ever going to ask a store clerk for an 802.11b router. The technology needed a brand. So the alliance hired Interbrand, the same firm behind names like Prozac and the Compaq brand, to invent something catchy. Interbrand returned with a shortlist of about ten candidates, and the group chose "Wi-Fi." Phil Belanger, a founding member of the alliance, has been blunt about it for years: the name has no expanded meaning. It was picked because it was short, easy to say, and rhymed with "Hi-Fi," a term consumers already associated with high-quality audio gear. So where did "Wireless Fidelity" come from? The myth has a real origin. Some board members were uncomfortable shipping a brand name that "meant nothing," so the alliance briefly bolted on the tagline "The Standard for Wireless Fidelity." It was a backronym — two words reverse-engineered to fit the syllables "Wi" and "Fi" after the fact. The phrase was clumsy, it never described the technology accurately, and once the alliance brought on more marketing-savvy members it was quietly dropped. The tagline disappeared; the misconception it planted did not. Why this matters if you build connected things This is a fun piece of trivia, but it points at something real for anyone doing IoT and embedded development . The protocols we treat as immovable technical bedrock are often shaped as much by branding, licensing,
AI 资讯
Why EIA-96 SMD Resistor Codes Don't Match Their Resistance Values
The first time I encountered an EIA-96 resistor , I assumed the marking would tell me the resistance value directly. I was troubleshooting a PCB and found a resistor marked 24C . Naturally, I expected some relationship between "24" and the actual resistance. After measuring and checking the datasheet, I discovered the resistor was 17.4 kΩ . That raised an obvious question: Why doesn't the code match the resistance value? The Problem With Traditional SMD Codes Most electronics enthusiasts learn resistor markings through familiar examples: 103 = 10 kΩ 472 = 4.7 kΩ 681 = 680 Ω These markings are straightforward. The first digits are significant figures and the last digit is a multiplier. The system works well for common resistor values, especially 5% tolerance components. However, things become complicated when manufacturers need to identify large numbers of precision resistor values on extremely small packages. Enter the EIA-96 Series Precision resistors often use the E96 preferred value series. Instead of having only a handful of values per decade, the E96 series contains 96 standardized resistance values between powers of ten. Some examples include: 100 Ω 102 Ω 105 Ω 107 Ω 110 Ω 113 Ω Notice how closely spaced these values are. Trying to represent all of them with traditional three-digit markings would quickly become messy and inconsistent. A Different Approach Rather than printing the resistance value directly, EIA-96 uses an index system. Each number from 01 to 96 corresponds to one of the standard E96 values. For example: Code Base Value 01 100 24 174 68 499 96 976 A letter is then added to indicate the multiplier. So the resistor marking becomes: Number + Letter Instead of: Resistance Value Example: Decoding 24C Let's break down 24C. First, look up the base value: 24 → 174 Next, decode the multiplier letter: C → ×100 Now calculate: 174 × 100 = 17,400 Ω Final resistance: 17.4 kΩ At first glance, nothing about "24C" resembles 17.4 kΩ, but that's because the code i
AI 资讯
Why Arduino Is Named After a Bar in Italy
Ask a roomful of engineers where the name "Arduino" comes from and you will get confident answers about acronyms, Italian for "bold friend," or some clever electronics pun. Almost all of them are wrong. The most influential open-source microcontroller board in history — the one that introduced millions of students, artists, and tinkerers to embedded development — is named after a bar. The pub in Ivrea The story begins in Ivrea, a small town in northern Italy straddling the Dora Baltea river. In the early 2000s it was home to the Interaction Design Institute Ivrea, where a team led by Massimo Banzi was looking for a cheap, approachable way to teach design students how to make things that sense and respond to the world. The tools available at the time were either too expensive or too intimidating for people who were not electrical engineers. So, in 2005, the team built their own board and released the design as open hardware. They needed a name. Banzi and his collaborators were regulars at a local pub called Bar di Re Arduino — "the Bar of King Arduino." When it came time to christen the project, the bar's name stuck. There was no acronym, no marketing committee, no focus group. The board was named after the place where the people who made it spent their evenings talking through ideas. The medieval king behind the bar The bar itself carries a much older name. Arduin of Ivrea — Arduino in Italian — was a real historical figure, an Italian nobleman who became King of Italy in 1002 and held the crown until 1014. He is one of Ivrea's famous "underdog kings," remembered locally long after his short reign ended. So the chain runs a thousand years deep: a development board used in connected sensors and robots today is named after a pub, which was named after an early-medieval king who ruled around the year 1000. It is the kind of detail that sounds like trivia, but it points at something real about how durable technology actually comes together. Why the origin story matters
AI 资讯
I Made a Battery Admit It Was Only 73% Healthy — On-Device, End to End
Voltage lies. Put a battery under load and its terminal voltage sags. Let it rest and the voltage springs back. A naive fuel gauge watching only voltage will happily tell you a worn-out cell is "fine" right up until it falls off a cliff. The number you actually care about — is this battery still good, or is it time to replace it? — isn't in the instantaneous voltage at all. It's in the capacity : how much charge the cell can still deliver between full and empty. That quantity fades as a cell ages. Tracking it is called State of Health (SoH) , and it's the difference between "the device says 80%" and "the device has 80% of the runtime it had when it was new." I wanted my open-source battery SDK ( ibattery-sdk , Apache-2.0) to learn SoH on the device itself — no cloud model, no floating-point, on MCUs with kilobytes of RAM. This post is the story of getting that working end to end: from a coulomb integral in firmware to a faded value showing up live on a Grafana dashboard. The idea: learn capacity from one full→empty trip You don't need a PhD-grade model to estimate usable capacity. You need two anchors and an ammeter. Full anchor — when the cell is at its full-voltage plateau, declare "this is full" and set the coulomb counter to the rated capacity. Discharge — integrate current over time (coulomb counting). Every milliamp-hour that leaves the cell ticks the counter down. Empty anchor — when the cell hits its empty-voltage threshold, look at how much charge actually flowed. A healthy cell delivers close to its rated capacity before going empty. An aged cell hits empty early — it simply has less to give. From the charge measured between those two anchors, you get the cell's real usable capacity, and SoH = measured / rated . The SDK runs it through an integer EMA (so one noisy excursion doesn't whip the estimate around) and a plausibility guard (reject anything outside 30–120% of rated — that's almost certainly a glitch, not a real measurement). The whole thing is inte
AI 资讯
3 Things AI Secretly Hides from You 🤐
The chatbot is tricking me!!! 💬📜⌛ When you text a chatbot, it doesn’t actually remember who you are or what you said two minutes ago. The exact millisecond it finishes typing a response, its brain completely wipes clean. To pull off the illusion of a continuous, flowing conversation, the web application secretly copy-pastes the entire past chat history, bundles it up, and blasts that whole massive block of text back into the processor every single time you hit send. Your "chat session" is an illusion maintained entirely by an ever-growing stateless prompt wrapper. You aren't interacting with a growing, adapting mind; you are repeatedly gas-lighting a brand-new entity into believing it has been talking to you for an hour. Wait, I am the one training it ??? 🚦🚸🚲 AI models are inherently blind to context; a computer doesn't instinctively know that a specific cluster of raw pixel values represents a real-world object. It requires billions of examples to be manually labeled by a human mind before the math can understand it. Every time you click on squares containing "traffic lights," "crosswalks," or "bicycles" to unlock a website, you are acting as an unpaid data annotator. You are manually labeling complex, messy real-world data points that feed directly into the computer vision systems of autonomous vehicles. The grand paradox of modern cyber security is that we force humans to act like mechanical data annotators to prove they are not computers, all so that computers can learn how to perfectly impersonate humans. The supercomputer is stupider than a toddler... 🍓👶🏻🖥️ We assume AI read letters and words the same way human eyes scan a page. It doesn't—it is entirely alphabet-blind. Before text hits the AI's brain, a parser chops strings of text into numerical blocks called "tokens." For example, the word "strawberry" isn't seen by the model as ten distinct letters; it is compressed into numerical IDs representing chunked pieces like "straw" and "berry". Because it never s
AI 资讯
Creating Robust systemd Services for Embedded Applications
There is a moment every embedded Linux developer hits eventually. You have spent days building something that works beautifully — a sensor pipeline, a streaming server, an MQTT client — and then you reboot the device and everything is silent. Nothing started. You SSH in, manually run your script, and it all comes back to life. The hardware is fine. Your code is fine. You just have no way of automatically running it. That is the gap systemd fills. It is the init system on virtually every modern Linux distribution, and on embedded Linux systems like the Raspberry Pi it is what decides what runs at boot, what gets restarted if it crashes, and where all the logs go. Once you understand how to write a service file, your applications stop being fragile scripts you need to babysit and start being first-class system services that survive reboots, network drops, and unexpected crashes. This tutorial builds up from the simplest possible service file to a production-ready configuration, explaining every line along the way. By the end you will have a service running your own Python application, logging to the system journal, and automatically restarting itself after failures. See Complete Tutorial in Github: Systemd Services Tutorial What systemd Actually Does Before writing any configuration, it helps to understand what problem systemd is solving, because the design of service files makes much more sense once you see the underlying model. When your Raspberry Pi boots, the Linux kernel starts and immediately hands control to process ID 1 — the very first user-space process. On modern systems, that process is systemd . Everything that happens next — mounting filesystems, bringing up the network, starting your application — is orchestrated by systemd. It reads configuration files called unit files that describe what should be started, when, in what order, and what to do if something goes wrong. A service file is just one type of unit file (there are also unit files for timers, so