Basic Electronics 11, Chapter 11: Challenge 1 solution (choose a board for three robots) Formulas: E = V x C E(usable) = 0.8 E P(batt) = P(load) / efficiency t = E(usable) / P(total) linear regulator: battery current = load current, dissipation = (Vin - Vout) x I (A) Sumo robot: Arduino Uno (or a Nano) Reasons: the four IR sensors are 5 V analogue parts, which match the Uno's 5 V logic and 5 V ADC range directly (the Uno has 6 ADC pins, 4 needed); no wireless is needed, so there is nothing to pay for; it is forgiving and has the most tutorials, which suits a beginner. Logic current at 5 V: 45 mA (board) + 4 x 20 mA (sensors) = 125 mA The Uno's regulator is linear, so the battery supplies 125 mA: dissipation = (7.4 - 5) x 0.125 = 0.30 W (a warm regulator, within the board's ability) Battery: E = 7.4 x 1.0 = 7.4 Wh E(usable) = 7.4 x 0.8 = 5.92 Wh Battery power for the logic: 7.4 x 0.125 = 0.925 W Runtime of the logic alone: 5.92 / 0.925 = 6.40 h (check by charge: 1000 mAh x 0.8 / 125 mA = 6.4 h) The motors will shorten this a good deal; this is the figure for the logic only. (B) Phone-driven rover: ESP32 Reasons: Wi-Fi and Bluetooth are on the chip, so no radio module is needed; two cores (one for the network); plenty of PWM channels for the motors and servo. (The Pico W would also do; the ESP32 has more pins and ADC channels.) Rail current: 120 + 80 + 30 = 230 mA at 5 V Load power: 5 x 0.230 = 1.15 W Battery power through the 90 % buck converter: 1.15 / 0.9 = 1.278 W Battery: E = 7.4 x 2.2 = 16.28 Wh E(usable) = 16.28 x 0.8 = 13.02 Wh Runtime of the logic: 13.02 / 1.278 = 10.19 h GPIO34 is an ADC1 pin (and input-only, which is all a divider needs). ADC2 pins stop working while Wi-Fi runs, so a battery monitor on an ADC2 pin would fail exactly when the robot is being driven over Wi-Fi (Basic Electronics 10). (C) Camera rover: Raspberry Pi 4 for the vision, with a Pico beside it for the motors Reasons: image processing needs an operating system and memory (the Pi); the Pi has no ADC and cannot give hard timing, so the Pico drives the motors, reads the encoders and the battery divider (Basic Electronics 10). Total power: 3.0 + 0.25 + 0.15 = 3.40 W Power bank: E = 3.7 x 10 = 37 Wh E(usable) = 37 x 0.85 = 31.45 Wh Runtime: 31.45 / 3.40 = 9.25 h With a Raspberry Pi Zero 2 W (0.8 W under load): total = 0.8 + 0.25 + 0.15 = 1.20 W runtime = 31.45 / 1.20 = 26.2 h (2.8 times longer) What you lose: speed and memory (a quad-core 1 GHz chip with 512 MB, against a faster chip with several GB), so the camera frame rate or the image size must be smaller, or the vision method simpler; the Pi 4 is the better choice for heavier processing, the Zero 2 W for a light, long-running robot. Summary table Robot Board Logic runtime A Arduino Uno 6.4 h (battery 7.4 V, 1000 mAh, linear regulator) B ESP32 10.2 h (battery 7.4 V, 2200 mAh, buck 90 %) C Pi 4 plus Pico 9.25 h (power bank 10 000 mAh); Zero 2 W: 26.2 h Figures for current, power, price and runtime are typical or approximate; real boards differ, so measure the current of your own build with a meter (Basic Electronics 2).