Voltage, Current, and Ohm's Law
Voltage is the push, current is the flow, and resistance is how hard the path is. Ohm's law links the three. It is the first thing to check when wiring any sensor, LED, or motor on a robot.
Ohm's law and power
An LED has a nearly fixed voltage drop \(V_f\), about 2 V for a red one. The resistor sets its current:
What to notice
Lower the resistance and the current climbs, shown by faster dots. Push it past 20 mA and the LED burns out. Without the resistor, almost nothing would limit the current. The resistor also heats up: this page uses a common quarter-watt resistor, and it warns when the power passes 0.25 W.
The same check applies across a robot. A sensor pin, a motor driver, and a battery cable all have current limits, and \(P = I^2 R\) is why thin wires get hot with motor currents.