Foundations · Lesson 2 of 11 · about 15 min

Hardware basics for software developers

Voltage, current, resistors, and how not to burn a pin

Code can be undone; a burnt LED or a dead pin cannot. Three numbers explain almost every hardware mistake a beginner makes: voltage, current and resistance.

QuantityWhat it isUnitWater picture
Voltage (V)The push that moves electronsvolt (V)Water pressure
Current (I)How much flowsampere (A), usually mALitres per second
Resistance (R)How hard it is to flowohm (Ω)A narrow pipe

Ohm’s law: V = I × R

Know two of the three and you get the third. It tells you how big a resistor must be, how much current a pin sends, and how hot a part gets (power = V × I).

An LED always needs a resistor

An LED drops an almost fixed voltage (about 2 V for red, about 3 V for blue and white). Whatever is left over must be taken by a resistor, or the current rises until the LED or the pin dies. Most pins are happy with 5 to 10 mA.

The BoardPilot Learn screen: a lesson with its 3D board preview
Try it live

The real app, running in your browser: this lesson with its 3D preview on a simulated Raspberry Pi Pico. No install, nothing to plug in.

Pull-up resistors: a defined level

An input connected to nothing floats and reads random values. A pull-up resistor to 3.3 V makes it read HIGH until a button pulls it to GND. Most chips have weak internal pull-ups (INPUT_PULLUP); I2C needs real ones, because the bus must rise fast enough.

Voltage dividers

Two resistors in series split a voltage in the ratio of their values. This is how you read a 5 V signal on a 3.3 V pin, or measure a battery with an ADC.

5 V and 3.3 V do not mix

BoardPilot checks these for you: the wiring rules flag a 5 V part on a 3.3 V pin, a missing ground, and an output on an input-only pin, and the shopping list adds the divider or level shifter you need.

Reading a schematic and a datasheet

Interview questions

  1. Why does an LED need a series resistor, and how do you choose its value?
  2. What happens if you leave a GPIO input floating?
  3. How do you connect a 5 V sensor output to a 3.3 V microcontroller?
  4. Why does I2C need pull-up resistors, and what goes wrong if they are too large?
  5. What is the difference between absolute maximum ratings and recommended operating conditions?

No answers here on purpose: try answering out loud first. In the BoardPilot app, the interview coach reads your own answer and tells you what was right, what is missing and what a senior interviewer would ask next (it uses the AI provider you choose in the app). Embedded systems interview questions →

Key terms

In the app, the lessons come alive

The lessons have interactive demos and hands-on labs checked on your board in the app. These pages are the readable version: the demos are described in words, and the labs need the app.

Download BoardPilot Try the lessons in your browser