Tutorial 7 of 10

Hardware safety

Check electrical and profile assumptions before wiring.

Difficulty
Beginner hardware
Time
15 min
Review baseline
App 0.2.0 beta · firmware 0.6.0 · PBLE/1

Prerequisites

  • A board-specific pinout and a powered-off circuit

Outcomes

  • Check voltage, current, polarity, and common ground
  • Avoid assuming pins from a generic firmware profile
  • Review wiring before applying power or running code

Release-aware guidance

Compatibility

The review baseline above is not a promise about the installer currently being served. Confirm the active version, exact profile, and enabled action on the current firmware and flash page before provisioning or changing hardware.

Qualified firmwaredescribes firmware evidence. The table below describes this lesson's scope; it does not turn designed compatibility into hardware validation.

Lesson scope for the five firmware profiles
Firmware profileLesson scope
Classic ESP32 (4 MiB)esp32-4mbDesigned for this profile
ESP32-S3 N16R8 · lean genericesp32-s3-n16r8Designed for this profile
Waveshare ESP32-S3-LCD-1.47Bwaveshare-esp32-s3-lcd-147bDesigned for this profile
ESP32-C3 (4 MiB)esp32-c3-4mbDesigned for this profile
Raspberry Pi Pico 2 Wrpi-pico2-wDesigned for this profile

This review method is designed for every profile. It intentionally provides no pin selection: generic-profile firmware and exact-board hardware identity are different claims.

Before you begin

A generic ESP profile has no carrier pin map, so there is no safe generic pin assumption. Use exact carrier documentation and component datasheets. The exact Pico 2 W and Waveshare B-version profiles expose only the documented onboard surfaces named in their own lessons.

Choose the right evidence

Classify before you connect

  1. Portable code

    Uses no carrier pin, fixed peripheral, or exact-board assumption.

  2. Configured capability

    Requires your reviewed pin choices, electrical limits, and wiring.

  3. Exact board

    Names one carrier, its matching firmware image, and fixed onboard surface.

The example class determines what must be verified before Run; designed compatibility is not physical validation.

Three compatibility classes

Portable
Console, language, data, workflow, or filesystem code with no pin or external-peripheral assumption.
Configured capability
GPIO, ADC, PWM, I2C, SPI, or NeoPixel behavior whose pins and circuit must be supplied from exact documentation.
Exact board
A named carrier surface such as Pico 2 W Pin("LED") or Waveshare LCD wiring; another carrier with the same MCU is outside that claim.

What PyBLE does not decide for you

Firmware qualification does not prove your circuit, chosen pin, peripheral voltage, power source, component current, resistor value, pull configuration, or bus wiring. Example design metadata is also not HIL evidence. The safe path is documentation, calculation, cold wiring, inspection, a bounded first effect, Stop, and cleanup.

Follow in order

Tutorial steps

  1. Power off and identify every exact part

    Disconnect board and peripheral power. Record the full board/carrier name and revision, component part number, supply voltage, signal voltage, and intended connection. Open the exact carrier documentation and each component datasheet—not a pinout for a similar board.

    Stop if: a suffix, board revision, component marking, voltage domain, or pin label is unknown.

  2. Classify the code before choosing pins

    Decide whether the example is portable, capability-configured, or exact-board-only. Portable code assumes no physical peripheral. Capability code requires your explicit pins and circuit. Exact-board code applies only to the named carrier revision.

    Expected: you can name the example class and explain why your exact hardware is or is not in its designed scope.

  3. Build a pin and conflict worksheet

    For each signal, copy the physical header location, GPIO or exact MicroPython pin name, mode, pull state, voltage capability, and shared peripheral use from the exact documentation. Check input-only pins, boot/strapping pins, flash or PSRAM connections, and pins already used by displays, USB, radio, or another device.

    Stop if: a selected pin is reserved, input-only for an output role, a boot/strapping risk, or shared in an incompatible way.

  4. Review the electrical path

    Confirm supply and logic voltage, maximum source/sink current, polarity, component power demand, shared ground, current-limiting resistor or other required protection, and any level shifting or separate supply. Account for startup states before user code configures a pin.

    Stop if: a voltage or current limit is exceeded, grounds cannot be shared safely, or required resistor, protection, or level conversion is missing.

  5. Bound the program before execution

    Read the complete source. Identify its maximum loop count or duration, highest output level, expected physical effect, Console progress, Stop behavior, exception behavior, and final cleanup state. Replace an unbounded effect with a finite test before first power-up.

    Expected: you can state the bounded effect, when to press Stop, and the exact cleanup that returns outputs and power to a safe state.

  6. Wire cold, inspect, then power

    With all power removed, make the reviewed connections. Trace every wire from source to destination against the worksheet, check polarity and protection again, remove loose conductors, then apply power while ready to disconnect it.

    Stop if: the powered board resets, heats, smells unusual, draws unexpected current, or a component behaves before Run.

  7. Run once, observe, Stop, and clean up

    Verify connected identity, choose Run explicitly, and compare the bounded physical and Console observations with the plan. Press Stop on any mismatch. When the test ends, drive outputs to their safe state when possible, disconnect peripheral power, then remove wiring.

    Expected: the finite effect matches the plan and the circuit finishes powered down in the documented cleanup state.

Need recovery help?

Stop at the current step, record the exact profile, board identity, app and firmware versions, and the first useful error. Then use the PyBLE support and recovery guide.