Question
What is the difference between through-hole (PTH) and surface-mount (SMD) resistors?
Answer
Through-hole resistors have wire leads that go through holes, fit into a breadboard and use colour bands; surface-mount resistors are tiny blocks soldered onto pads on the surface of a PCB and use a printed number code.
| Through-hole (PTH) | Surface-mount (SMD) | |
|---|---|---|
| Mounting | Leads pushed through holes and soldered on the other side, or into a breadboard | Soldered onto pads on top of the PCB |
| Size | Several millimetres, easy to handle | Down to fractions of a millimetre |
| Value marking | Colour bands | Printed numeric code, e.g. 472 = 47 × 10² = 4.7 kΩ |
| Where you meet it | Prototyping, breadboards, hobby kits | Almost every mass-produced board, including the ESP32 dev board |
The split mirrors the IoT development path. You prototype with through-hole parts on a breadboard because you can plug them in and swap them. The product is then made with SMD parts because they are smaller, cheaper and can be placed by machine.
Resistors also come as resistor packs (several in one package) and variable resistors such as the potentiometer, whose resistance changes when you turn the knob.
Tip: the SMD code uses the same idea as the colour bands: two digits then the number of zeros.
Go deeper:
Wikipedia — Surface-mount technology — why SMD replaced through-hole in manufacturing, and its package sizes.
Note saved — thanks!
Question
What is a real-time operating system, and what does "real-time" actually mean?
Answer
An RTOS manages the hardware of an embedded system with precise, predictable timing and high reliability. "Real-time" means every response is guaranteed within a known deadline, not that it is fast.
A general-purpose OS such as Windows or desktop Linux is designed to keep the whole machine busy and be fair to every program. It will usually respond quickly, but it makes no promise: a background update or a page fault can delay your code by an unpredictable amount.
An RTOS makes the opposite trade. It is intended to serve applications that process data as it comes in, and its key goal is that the timing is predictable: the worst-case time to respond to an event is known and bounded. The six properties it is built around are:
- Multi-tasking — several tasks share the processor.
- Small latency — the delay before a task gets the processor is bounded.
- Preemption — a more important task can interrupt a less important one.
- Predictability — you know how long tasks take.
- Determinism — the same inputs lead to the same timing, so deadlines can be proven.
- Responsiveness — inputs and events are handled within a defined short period.
A car's airbag controller is the classic example. Deploying in 15 ms every time is correct; deploying in 1 ms usually and 200 ms occasionally is a failure, even though its average is faster.
Tip: real-time = on time, every time. A late correct answer is a wrong answer.
Go deeper:
Wikipedia — Real-time operating system — hard vs soft real-time, scheduling algorithms and interrupt latency.
FreeRTOS — The FreeRTOS Kernel — the RTOS used for ESP32 development, and why it is small enough for microcontrollers.
Note saved — thanks!