Electronics in a Prototype

Modules, dev boards and custom boards, power budgets and battery life, integration and first tests.

From module to custom board

Electronics prototypes follow their own ladder: simulate the circuit, build it from modules on a breadboard, make it permanent on perfboard or a carrier board, and only then design a custom PCB. Each step proves the one before it, and the software can be written long before the hardware is final. See PCB Prototyping for the board side and Electronics Fundamentals for the circuits.

  • Prove one subsystem at a time: sensor, then actuator, then communication, then the whole. Debugging one change at a time is far faster than debugging ten.
  • Use ready-made modules for everything that is not the point of the experiment.
  • Move to solder when contacts misbehave: breadboards give intermittent faults with motors and above a few MHz (see Breadboards, Perfboard and Hand Wiring).
  • Make it testable: test points, a debug header, status LEDs, and room to add parts.

Choosing modules and dev boards

BoardVoltage, speedCurrent (typical)Notes
Arduino Uno / Nano class (AVR)5 V, 16 MHzAbout 45 mA runSimple; many shields; modest speed
Raspberry Pi Pico (RP2040)3.3 V, 133 MHz dual coreAbout 25 mA runPIO state machines; cheap; no radio (Pico W has Wi-Fi)
ESP32 (Wi-Fi + Bluetooth)3.3 V, 240 MHz80 to 240 mA with radio onWireless prototypes; deep sleep about 10 µA
STM32 Nucleo3.3 V, 48 to 480 MHz10 to 150 mAProfessional toolchain; many peripherals
Raspberry Pi (Linux)5 V, 1 GHz and more400 mA to 1.2 AFull OS, camera, networking; not real time
Nordic nRF523.3 V, 64 MHzFew mA; µA in sleepLow-power Bluetooth
  • Choose by the hardest requirement: radio, speed, low power, an operating system or a particular peripheral.
  • Check the logic voltage: 3.3 V and 5 V parts do not mix without level shifting.
  • Buy from known sources; clone modules vary in quality (counterfeit chips, wrong regulators).
  • Use sensor modules with an I2C or SPI interface and their libraries to get readings in an hour.
  • Software side: see Embedded Systems.

The power budget and battery life

Write the current of every part in every mode, weight it by the time spent in each, and add. The average current sets the battery life.

Iavg = (Iactive × tactive + Isleep × tsleep) ÷ T, Runtime = capacity × usable fraction ÷ Iavg

Worked example: a sensor node on a 2 000 mAh cell

  • The node wakes for 2 s every 60 s at 80 mA (microcontroller, radio and sensor), and sleeps at 0.02 mA (20 µA) for the rest.
  • Iavg = (80 × 2 + 0.02 × 58) ÷ 60 = 2.69 mA.
  • Runtime = 2 000 × 0.8 ÷ 2.69 = 596 h = 24.8 days. Running continuously at 80 mA the same cell lasts only 20 h (0.8 days).
  • Per cycle the active 2 s uses 160 mA·s of charge and the sleep uses only 1.2 mA·s: shorten the active time (or its current) before trying to reduce the sleep current.
Wake-up intervalAverage currentRuntime on 2 000 mAh (80 %)In days
10 s16.02 mA100 h4 days
60 s2.69 mA596 h25 days
300 s0.55 mA2 892 h121 days
3 600 s0.06 mA24 832 h1 035 days

More about low-power design is in Embedded Systems and Data Logging. Measure the real sleep current: a floating pin or a module’s LED can spoil the budget.

Batteries, regulators and bursts

Worked example: why the radio resets the board

  • A lithium-polymer cell has an internal resistance of about 0.15 Ω (more when cold or nearly empty). A radio burst of 0.5 A drops 0.5 × 0.15 = 0.075 V inside the cell.
  • At a cell voltage of 3.4 V the terminal falls to 3.33 V in the burst. A regulator for 3.3 V with 0.25 V dropout needs at least 3.55 V: the supply collapses and the board resets.
  • Fixes: a low-dropout regulator or a buck-boost converter; a capacitor to supply the burst: C = I t ÷ ΔV = 0.4 A × 0.2 ms ÷ 0.2 V = 400 µF (use 470 µF or more); a cell with lower internal resistance.
  • Lithium cells need protection (a protection circuit, a proper charger, no puncturing): they can burn violently (see Fire, Fuels and Explosion).
  • Use a current-limited bench supply for development, then switch to the battery.
  • Add a fuse or PTC and reverse-polarity protection to every prototype.
  • Measure the current in each mode with a meter or a shunt and scope, not from the data sheet alone.
  • Allow for temperature: a cold lithium cell delivers a fraction of its room-temperature capacity.

Wiring and connectors in a prototype

Worked example: the drop in a thin lead

  • A 0.5 m lead of 22 AWG (53 mΩ per m) carrying 2 A to a motor has a round-trip resistance of 2 × 0.5 × 53 = 53 mΩ and drops 0.11 V: 2 % of a 5 V supply. Use 18 AWG or shorter leads (see Wires, Connectors and Cables).
  • Use proper connectors (JST, screw terminals, headers with locking) for anything that moves; bare wires and jumper leads loosen.
  • Strain-relieve every cable where it leaves a board or the case.
  • Color-code power, ground and signals, and label connectors; a reversed battery connector destroys boards.
  • Keep power and signal wires apart and twist the pair for a motor or a long sensor lead.
  • Plan for service: connectors rather than soldered wires let you replace a board.

Fitting electronics in the enclosure

  • Model the boards and batteries in the CAD of the case (use manufacturers’ models) and check the connectors, buttons, LEDs and antennas (see CAD, Simulation and Digital Prototypes).
  • Leave room for wires, about 10 mm around a board and more for a thick cable bend.
  • Heat: a closed box warms up; estimate the temperature (see System Integration) and leave vents or a heat path.
  • Antennas: keep metal and batteries away from the antenna of a radio module; follow the module’s keep-out.
  • Light pipes and buttons: align them with the board in the CAD; the tolerance stack of the case and the board is often the problem (see Mechanisms, Fasteners and Snap-Fits).
  • Make the board removable so that you can reprogram and probe it.

Firmware and the first tests

  • Start with the blink program and the serial console: they prove the power, clock and programming path (see First Power-Up, Bring-up and Testing).
  • Add one peripheral at a time with a test for each, and keep the tests in the code.
  • Log the measurements to a serial port or a card to see what the prototype is doing (see Data Logging).
  • Use a version control system (Git) for firmware as well as for CAD, with a tag for each prototype build.
  • Keep the code simple and the structure ready to grow: a state machine, a main loop and clear modules.

When to make a custom board

Worked example: modules or a custom board?

  • A module-based unit costs $15 in modules; a custom board with the same function costs $5 in parts and boards. The custom board needs 20 hours of design and testing at $50 (about $1 000) plus a respin allowance: NRE of about $1 500 in all.
  • Break-even quantity = NRE ÷ saving per unit = 1 500 ÷ (15 − 5) = 150 units.
  • Below that, build with modules; above it, or when size, power, reliability or radio approval demand it, make the board. The custom board also removes loose wires and makes assembly repeatable.

EMC and safety, early

  • Radiated emissions and immunity tests are a gate for most markets: a prototype with clean layout, a ground plane and filtered cables passes more often (see Signal Integrity and EMC).
  • Pre-compliance with a near-field probe and an ESD gun finds problems cheaply.
  • Safety: mains, batteries and heaters need approved parts, insulation and protection (see From Prototype to Production).
  • Radio modules: use pre-certified modules to avoid the cost of full radio testing, and follow their layout rules.

Troubleshooting

ProblemLikely causeTry
Electronics works intermittentlyBreadboard contacts, loose wires, supply sagSolder it, shorten wires, add decoupling and a bigger supply
Resets when the radio or motor startsSupply drops under burst currentBulk capacitor, lower-dropout regulator, thicker leads
Battery life far shorter than calculatedSleep current higher than assumed (LEDs, pull-ups, modules)Measure each mode; remove or switch off parts
Works on the bench, not in the caseHeat, antenna detuned, wiring disturbedTest in the case early; check temperature and keep-outs
Sensor readings noisyMotor or switching noise; long leadsSeparate and filter the supplies; shorter, twisted leads
Cannot reproduce a working unitUndocumented wiring and settingsDraw the schematic and log the firmware version

Related

FAQ

Should I use a development board or design my own?

Start with a dev board and modules: they are fast and the software can be written at once. Design a custom board when size, power, reliability or volume require it.

How do I estimate battery life?

Average the current over the duty cycle (active and sleep), then divide 80 % of the capacity by the average current.

Why does my project reset when the motor starts?

The supply sags under the starting current: use a larger capacitor, thicker wires, a separate supply for the motor, or a battery with lower internal resistance.

Which microcontroller should I choose for a prototype?

The one you can program fastest that meets the hardest requirement: an ESP32 for wireless, an RP2040 or STM32 for speed and peripherals, an Arduino-class board for simplicity.

When do I need a custom PCB?

When the module version is too big, too costly at volume, unreliable, or cannot meet power and approval needs.

References

  • Horowitz, P. and Hill, W., The Art of Electronics, Cambridge University Press (power, batteries).
  • Battery manufacturers’ data (internal resistance, temperature derating); microcontroller and module data sheets (current in each mode).
  • Ott, H. W., Electromagnetic Compatibility Engineering, Wiley.

Last reviewed: October 2026. Currents, resistances and costs are typical or illustrative: measure your own parts.