Robotics knowledge
Blog
Technical articles on embedded programming, ROS 2, SLAM, Nav2 and AMR/AGV — written from building real robots.
41 articles · Embedded Programming
Bits, bytes, binary and hexadecimal: the native language of microcontrollers
The microcontroller datasheet is full of numbers in the form 0x1F, 8-bit registers, 16-bit addresses. This article explains bit/byte, binary, hexadecimal, and how to read and understand them when embedded programming.
Voltage, current and power: applying Ohm's law in embedded systems
Why does the motor need its own power source instead of being plugged directly into the GPIO pin? Why do LEDs have to have a current-limiting resistor? This article explains voltage, current, power, and Ohm's law — the foundation for not burning out components.
Digital vs analog: why microcontrollers need an ADC to sense the real world
Light, temperature, sound all change continuously (analog) — but the microcontroller only understands 0 and 1 (digital). This article explains the digital/analog difference, and the ADC/PWM that bridges those two worlds.
What is GPIO? The essential multipurpose pin on every microcontroller
What is GPIO, what is the difference between INPUT and OUTPUT modes, why one pin can do so many things, and the most common mistakes when first using GPIO.
Pull-up and pull-down resistors: solving the problem of floating GPIO pins
Push button reads random value even though no one touches it? This is almost always a floating pin problem — pull-up/pull-down resistors are the standard solution, and most microcontrollers already have them internally.
What is an interrupt? Handling events without constant polling
Reading the encoder using digitalRead() in loop() easily misses the pulse when the speed is high. Interrupts allow the MCU to react immediately to an event, instead of having to constantly check — the foundation for accurate encoder reading.
What is a diode? An electronic one-way valve essential for relay and motor control
The diode only allows current to flow in one direction — a simple component, but without it, when controlling a relay/motor via a transistor, it will almost certainly burn out the control component due to reverse current.
What is a transistor? An electronic switch controlled by a small current
GPIO can only output a very small current, not enough to directly control a relay or motor. The transistor solves this by using a small current at the Base pin to turn on/off a much larger current at the Collector-Emitter.
What is a MOSFET? An electronic switch controlled by voltage rather than current
MOSFETs are similar to BJT transistors in their role as electronic switches, but controlled by voltage instead of current — more suitable for high-current loads such as motors, and are the most popular choice in modern motor drivers.
What is a relay? An electrically controlled mechanical switch that isolates 2 circuits
When it is necessary to turn on/off a high voltage load (220V AC) or large current using a control signal from a microcontroller, a relay is the most popular choice — a mechanical switch that opens/closes using electromagnetic force, completely isolating the two circuits.
What is an optocoupler? Isolating signals with light and no electrical connection
Relays are mechanically isolated but are slow and have a limited lifespan. The optocoupler isolates the signal from light — no electrical contact, no mechanical part, much faster switching, suitable for protecting the MCU from the power circuit.
What is an LDO? Simple linear voltage regulation and its thermal cost
12V Li-ion battery but MCU needs exactly 3.3V stable — LDO is the cheapest and simplest way to step-down, but unused excess voltage will turn into heat, not disappear for free.