The short answer
A real-time embedded system is a dedicated computer built into a larger product whose job is only done correctly if its results arrive on time. It reads inputs from the physical world, such as sensors, buttons, or messages on a bus. It then computes a response and drives outputs, such as motors, valves, displays, or radios, within a deadline that the design guarantees.
The key idea is that correctness depends on timing as well as on the result. A correct answer delivered too late counts as a wrong answer, or at least a degraded one.
For a longer treatment of the field, including how these systems are programmed, see our overview of real-time embedded systems.
Breaking down the term
“Embedded”
An embedded system is a computer that exists to serve a specific product rather than to be used as a general-purpose computer. It’s usually built around a microcontroller or a small processor. It runs firmware written for that one job, and it’s often invisible to the user. The controller in a washing machine, the engine control unit in a car, and the processor in a smoke detector are all embedded systems.
Typical traits:
- Dedicated function. It runs one application, not whatever the user installs.
- Tight resources. Memory, CPU speed, power, and cost are limited.
- Direct hardware interaction. It talks to sensors, actuators, and peripherals through pins, timers, ADCs, and serial buses.
- Long unattended operation. Many run for years without a reboot or a person watching.
“Real-time”
In computing, “real-time” means the system has to respond to events within bounded, predictable time. The bound might be microseconds for a motor current loop, milliseconds for a brake controller, or seconds for a process alarm. What matters is that the bound is known and met.
Put the two together and you have a dedicated computer, inside a product, that has to keep up with the physical world it’s connected to.
A worked example: sense, decide, act, on time
Consider a simplified anti-lock braking function:
- Sense. Wheel-speed sensors produce pulses. A timer peripheral measures them, and the firmware calculates each wheel’s speed.
- Decide. The software compares wheel speeds with vehicle speed. If one wheel is slowing much faster than the others, it’s about to lock.
- Act. The controller switches hydraulic valves to briefly reduce brake pressure on that wheel, then restores it.
- Repeat. This cycle runs over and over, many times per second, for as long as the driver brakes hard.
The decision is only useful if it reaches the valves in time. If the computation is late, the wheel has already locked and the result is worthless. That’s what makes this a real-time requirement: the timing is part of the specification, just like the arithmetic.
Real-time does not mean fast
“Real-time” is often read as “very fast”, but the defining property is predictability, sometimes called determinism.
- A desktop PC is far faster than a small microcontroller. It still isn’t a real-time system in the strict sense, because it can’t promise that a given piece of code will finish within a fixed time every time. Background tasks, caches, and power management all add unpredictable delays.
- A slow 16 MHz microcontroller can be a perfectly good real-time system if every response is guaranteed to fit inside its deadline.
- A requirement such as “close the valve within two seconds of a high-pressure alarm, every time” is a real-time requirement with a generous deadline.
Engineers care about two related measures: latency, the delay from an event to the response, and jitter, how much that delay varies from one occurrence to the next. A real-time design keeps both within known limits.
Key characteristics of a real-time embedded system
- Deadline-driven. Requirements include timing, not just functions: “respond within X”, “run every Y”.
- Deterministic. Worst-case response times can be bounded and checked, not just the average.
- Reactive. The system responds to external events, often through interrupts, and controls physical outputs.
- Concurrent. Several activities happen at once: sampling, control, communication, and user interface. The software has to share the CPU among them without letting less urgent work delay urgent work.
- Resource-constrained. Timing has to be met on cheap, low-power hardware with limited RAM.
- Reliable. Many must recover from faults on their own, using watchdogs, safe states, and fault handling.
Hard, firm, and soft real-time
Real-time requirements are usually grouped by what a missed deadline costs:
- Hard: a miss counts as a failure. Airbag triggering and brake control are standard examples.
- Firm: an occasional miss is tolerable, but a late result is useless and is discarded, such as a sensor sample that arrives after its processing window.
- Soft: a miss lowers quality but the result still has some value, such as audio playback or a display refresh.
These labels apply to individual requirements, not whole products. One device often contains all three. Our article on hard vs soft real-time systems and timing constraints covers the categories and the kinds of timing constraint in detail.
How real-time embedded systems are built
There are three common approaches, and plenty of products combine them.
- Bare metal (no operating system). A main loop handles routine work, and interrupt service routines handle urgent events. This is simple and very predictable for small systems.
- Real-time operating system (RTOS). A small kernel such as FreeRTOS, Zephyr, or ThreadX runs several tasks and always gives the CPU to the highest-priority task that’s ready. This makes it easier to keep urgent work from waiting behind slow work. It’s a common choice once a design has several independent activities or a protocol stack.
- Real-time Linux. On larger processors, Linux with the
PREEMPT_RTcapabilities can offer low, fairly consistent latency alongside networking and file systems. Very strict deadlines are often still handed to a separate microcontroller or core.
Using an RTOS doesn’t make a system real-time on its own, and not using one doesn’t stop it being real-time. What matters is whether the worst-case timing is known and met. If you’re weighing the first two options, see RTOS vs super loop: when do you actually need an RTOS?, and for how an RTOS decides what runs next, see real-time scheduling and multitasking in embedded systems.
Is every embedded system real-time?
No. The two terms overlap a lot, but they aren’t the same:
- Embedded but not strictly real-time: a digital photo frame or a simple calculator. It has to feel responsive, but there’s no meaningful deadline.
- Real-time but not embedded: some trading systems and broadcast servers have strict timing requirements but run on general-purpose servers in data centers.
- Both: engine controllers, motor drives, flight controls, pacemakers, and industrial robots.
In practice, most embedded systems have some timing requirements, even if they’re soft. A thermostat that took a minute to react to a button press would still be a bad product. For many more examples across industries, see real-time system applications and examples.
Frequently asked questions
What is an example of an RTOS?
Widely used examples include FreeRTOS, Zephyr, and Eclipse ThreadX for microcontrollers, and VxWorks, QNX, and INTEGRITY for larger and often safety-critical systems. Our comparison of FreeRTOS, Zephyr, and ThreadX covers the three most common open-source choices.
What’s the difference between IoT and embedded systems?
An embedded system is any dedicated computer inside a product. An IoT device is an embedded system that’s also connected, typically to the internet or a cloud service, so it can report data or be controlled remotely. Every IoT device contains an embedded system, but plenty of embedded systems, such as a basic microwave controller, aren’t connected at all.
Do real-time embedded systems always need an RTOS?
No. Many hard real-time functions run on bare metal with carefully designed interrupts. An RTOS helps when the software has several independent activities with different urgency, but it adds RAM use and new kinds of bugs.
What language are real-time embedded systems written in?
C is still the most common, with C++ widely used as well. Rust is gaining ground, especially where memory safety is a priority. Small parts, such as startup code or very time-critical routines, are sometimes written in assembly.