The formulas you reach for most when building a robot, with one worked example each. Every number below was recomputed by hand. Examples use assumed values, not measurements from a build, so replace them with your own parts.
Electricity
- Ohm’s law: V = I x R. Power: P = V x I = I x I x R = V x V / R.
- LED resistor: R = (supply voltage – LED voltage) / LED current. Example: (5 – 2) / 0.010 = 300 ohm.
- Voltage divider: Vout = Vin x R2 / (R1 + R2). Example: 5 V with 1 k and 2 k gives 5 x 2000 / 3000 = 3.33 V.
- Heat in a wire or joint: P = I x I x R. Example: 5 A through 0.05 ohm is 5 x 5 x 0.05 = 1.25 W.
- PWM average voltage: duty cycle x supply. Example: 60 percent of 12 V is 7.2 V.
Check any result with the Ohm’s law and power calculator and the LED resistor and voltage divider calculator.
Batteries
- Energy in watt-hours = volts x amp-hours.
- Runtime in hours = energy x usable fraction / load in watts.
- Example: 11.1 V x 2.2 Ah = 24.42 Wh. Using 80 percent gives 19.5 Wh. At a 10 W load that is 19.5 / 10 = about 1.95 hours.
- Series adds voltage, parallel adds capacity. Example: 3s2p of 3.7 V, 2.5 Ah cells is 11.1 V, 5 Ah and 55.5 Wh.
- Fuse size: load current x 1.25 for a continuous load, then round up to the next standard size, never above what the wire can carry.
Try the battery runtime calculator and the battery pack calculator.
Motors, wheels and gears
- Wheel speed = pi x diameter x revolutions per second. Example: 65 mm wheel at 2 rev/s is 3.1416 x 0.065 x 2 = 0.408 m/s.
- Torque = force x distance. Example: a 0.5 kg load at 0.2 m is 0.5 x 9.81 x 0.2 = 0.981 N m, about 10 kgf cm. Add a safety margin before choosing a motor.
- Gear ratio = driven teeth / driver teeth. Output speed = input speed / ratio. Output torque is about input torque x ratio x efficiency. Example: a 20 tooth gear driving a 60 tooth gear gives ratio 3, so 300 rpm becomes 100 rpm.
- Encoder distance per count = pi x diameter / counts per wheel revolution. Example: 65 mm wheel, 20 counts per revolution: 204.2 / 20 = 10.2 mm per count.
- Stepper step rate = revolutions per second x steps per revolution. Example: 200 full steps with 16x microstepping is 3200 steps per revolution; at 120 rpm (2 rev/s) that is 6400 steps per second.
Use the wheel speed calculator, servo torque calculator, gear train calculator, encoder calculator and stepper frequency calculator.
Signals and communication
- Period = 1 / frequency. A 50 Hz servo signal repeats every 20 ms.
- Typical hobby servo pulse: about 1 ms to 2 ms inside that 20 ms period, which is 5 to 10 percent duty. Check your servo’s datasheet for its real range.
- Serial speed: at 9600 baud with 8 data bits, no parity and 1 stop bit, each byte takes 10 bits, so about 960 bytes per second at most.
- Sampling: sample at more than twice the fastest change you need to see, and filter before you sample.
See the servo pulse and PWM calculator.
Use these responsibly
Formulas give an estimate, not a guarantee. Real motors have friction, batteries sag under load and parts vary. Measure on your own robot, keep a margin, and read the datasheet of every part. The tools hub lists every calculator, and the Learn hub explains the ideas behind them.
Last reviewed: November 2026. Free to copy and adapt for your own project, with credit. Written, checked and maintained by Jignesh Panchal of Jaadu Digital. See the editorial standard.