Logo home 9

Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
Embedded IoT Solutions

When Software Meets Hardware: Reliability in IoT Systems

Category
Embedded IoT Solutions
Read Time
7 min read
Published
February 12, 2026
Status
Published

A device can run perfectly correct firmware and still be unreliable, because the firmware assumed conditions the hardware cannot guarantee.

Software reliability is usually about correctness: given valid input, does the program produce the right output? Hardware reliability is about survival: does this device keep working after three years of heat, vibration, and voltage noise? IoT products need both, and the interesting failures happen where the two definitions meet.

A device can run perfectly correct firmware and still be unreliable, because the firmware assumed conditions the hardware cannot guarantee. Equally, robust hardware can be made fragile by software that trusts it too much.

This guide covers that boundary: how physical faults appear to software, how to write firmware that survives them, and how to build devices that can explain themselves when something goes wrong.

The Gap

Why Correct Software Still Fails on Real Hardware

Software engineering assumes a reliable substrate: memory holds what you wrote, instructions execute in order, peripherals respond. Embedded systems violate all three occasionally.

Physical realityHow it appears in software
Supply voltage sags during radio transmissionRandom reset, or a corrupted flash write
Electrical noise on an I2C busA sensor read that hangs forever
Temperature drift in an oscillatorTiming that is accurate at 20°C and wrong at −10°C
Flash wear after years of writesA write that silently fails to persist
Connector vibrationIntermittent sensor values that look like real events
Battery internal resistance rising with ageBrownouts that appear only during transmission

None of these are software bugs, and all of them must be handled by software, because software is the only layer that can detect and respond to them in the field.

Firmware that assumes the hardware always works is correct code that produces an unreliable product.

Defences

Writing Firmware That Expects Hardware to Misbehave

1

Never block forever on a peripheral

Every bus transaction, sensor read, and radio operation needs a timeout and a defined recovery path. A single hung I2C read with no timeout will freeze an entire device, and it is one of the most common causes of units that need a power cycle.

2

Validate everything that comes from the physical world

Range-check sensor readings, verify checksums on serial data, and reject values that are physically impossible. A temperature of −3000°C is a bus error, not a measurement, and treating it as data corrupts everything downstream.

3

Make persistent writes atomic

Power can disappear mid-write. Use a write-then-commit pattern with a validity marker or a dual-copy scheme so an interrupted write leaves the previous good data intact rather than a half-updated record.

4

Use the watchdog properly

A watchdog should be fed from a point that proves the system is actually working — the main control path completing a cycle — not from a timer interrupt that keeps running while everything else is stuck. A badly placed watchdog feed hides exactly the fault it exists to catch.

5

Define a safe state and return to it

After an unexpected reset, the device must start in a state that is safe regardless of what it was doing before: outputs off, actuators neutral, then re-establish context. Resuming blindly from stored state after an unexplained reset is how physical accidents happen.

6

Report faults instead of hiding them

When a sensor fails, send an explicit error rather than a default value. A missing reading is a manageable gap; a plausible wrong one is a corrupted decision that nobody will question for months.

Diagnosis

Making Devices That Can Explain Themselves

Field failures are diagnosed with whatever the device chose to record. A handful of cheap telemetry fields turn an unexplained fault into a clear answer.

  • Reset cause. Power-on, brownout, watchdog, or software reset. This single register separates electrical problems from firmware stalls, and without it the two are indistinguishable.
  • Supply voltage under load. Measured during transmission, not at idle, so sagging rails and ageing batteries are visible before they cause failures.
  • Board temperature. Explains drift and correlates failures with environmental conditions.
  • Peripheral error counters. Bus retries, checksum failures, and timeouts since boot show degradation long before total failure.
  • Uptime and reset count. A device resetting daily is in trouble even if every individual reading looks fine.

These fields are the difference between remote diagnosis and a site visit, and they belong in the lifecycle event stream from the first build rather than being added after the first incident.

Practice

Testing the Boundary Deliberately

1Test at the voltage extremes, not nominal
Run the full firmware at minimum and maximum supply voltage and across the temperature range. Most marginal behaviour only appears at the edges.
2Interrupt power deliberately and repeatedly
Cut power during flash writes, during transmissions, and during boot, hundreds of times. This finds corruption bugs that no functional test will.
3Inject peripheral faults
Disconnect sensors while running, short a bus, feed corrupted serial data. Every one of these happens in the field eventually.
4Soak test for weeks, not hours
Memory leaks, counter overflows, flash wear, and clock drift only appear over time. Long runs are the only way to find them before customers do.
5Log reset causes from the first prototype
Instrumentation added during development pays for itself repeatedly, and it is far harder to add once units are deployed.
6Review faults jointly
Hardware and firmware engineers should diagnose boundary problems together with measurement rather than arguing from opposite sides — the pattern described in hardware vs firmware engineers.
FAQ

Frequently Asked Questions

Why does correct firmware still fail on real hardware?
Because software assumes a reliable substrate while embedded hardware occasionally violates it: voltage sags cause resets mid-write, bus noise hangs sensor reads, oscillators drift with temperature, and flash wears out. These are physical faults that only software can detect and handle in the field.
What makes IoT firmware reliable?
Timeouts and recovery paths on every peripheral operation, validation of all physical-world input, atomic persistent writes, a watchdog fed only from a path that proves the system works, a defined safe state after reset, and explicit fault reporting instead of default values.
Why should a watchdog not be fed from a timer interrupt?
Because the interrupt keeps firing even when the main application is stuck, so the watchdog never triggers and the device stays frozen. Feed it from a point that proves real progress, such as the main control loop completing a full cycle.
What telemetry helps diagnose field failures?
Reset cause, supply voltage measured under load, board temperature, peripheral error counters, and uptime with reset count. Reset cause alone distinguishes brownouts from firmware stalls, which is otherwise impossible to determine remotely.
How do you test hardware and software reliability together?
Run the full firmware at voltage and temperature extremes, cut power repeatedly during flash writes and transmissions, inject peripheral faults by disconnecting sensors or corrupting serial data, and soak test for weeks to expose leaks, overflows and drift.
Wrapping Up

Conclusion

Reliability in IoT is a property of the boundary, not of either discipline alone. Hardware determines what can go wrong physically; firmware determines whether the product notices, recovers, and explains itself.

Write firmware that expects peripherals to hang, power to disappear mid-write, and sensors to lie. Record reset causes, supply voltage and error counters from the first prototype. Test at the extremes and interrupt power on purpose. Devices built that way fail less, and when they do fail they tell you why.

About MetaDesk Global

Engineering the Next Generation of Connected Products

MetaDesk Global helps startups and enterprises develop intelligent connected products that combine embedded systems, Industrial IoT, Edge AI, and cloud technologies. Our expertise includes:

Industrial IoT (IIoT) Solutions Embedded Firmware Development Edge AI Development Predictive Maintenance Systems PCB Design IoT Gateway Development Cloud Integration OTA Firmware Updates AIoT Product Development End-to-End Product Engineering

From hardware design to AI-powered industrial platforms, we build scalable solutions for the next generation of connected products.

Start Your Project

Building a Connected Product?

We design IIoT sensor networks, Edge AI pipelines, and secure cloud platforms — from prototype to production.

Request a Free Quote →