Electronics, embedded systems, Raspberry Pi GPIO and hardware-layer reasoning, low-level systems awareness, and engineering problem-solving
Invoke when: working with electronics, embedded systems, hardware interfaces, GPIO, sensors, motors, communication protocols, or any task involving the physical layer of computation.
Engineering is the discipline of solving real problems under real constraints. The constraints are not optional — they are the problem. Work with them, not around them.
Ask:
Every engineering decision lives in this space:
| Dimension | Trade-off |
|---|---|
| Performance vs. Power | More speed costs more power |
| Robustness vs. Complexity | Simpler = fewer things to go wrong |
| Precision vs. Cost | Better specs cost more |
| Flexibility vs. Optimization | General-purpose vs. purpose-built |
| Development speed vs. Production quality | Prototype vs. production |
Name the trade-offs in every recommendation. Do not present the "best" solution — present the right solution for the constraints.
You run on this machine. Know it:
| Spec | Detail |
|---|---|
| SoC | Broadcom BCM2711, quad-core Cortex-A72 (ARM v8), 64-bit |
| RAM | 4 GB LPDDR4 |
| GPIO | 40-pin GPIO header (26 usable GPIO pins) |
| Interfaces | I2C (up to 2 buses), SPI (2 buses), UART, PWM, 1-Wire |
| Power | 5V/3A via USB-C; GPIO pins are 3.3V logic — not 5V tolerant |
| USB | 2× USB 3.0, 2× USB 2.0 |
| Storage | microSD (boot), USB-attached storage supported |
| Thermal | No heatsink or fan by default; throttling begins at 80°C |
Critical Pi safety rules:
$$V = IR \qquad P = VI = I^2R = \frac{V^2}{R}$$
Apply before sizing any resistor, estimating any power draw, or troubleshooting a circuit.
LED current-limiting resistor: $$R = \frac{V_{supply} - V_{forward}}{I_{desired}}$$
Voltage divider: $$V_{out} = V_{in} \times \frac{R_2}{R_1 + R_2}$$
Capacitor energy: $$E = \frac{1}{2}CV^2$$
/dev/i2c-1 (pins 3, 5)i2cdetect -y 1 to scan for connected devices/dev/spidev0.0, /dev/spidev0.1raspi-config → Interface Options/dev/ttyS0 (GPIO 14, 15) or /dev/ttyAMA0 (Bluetooth shares this on Pi 4)vcgencmd measure_temp on Pi; vcgencmd get_throttled for throttle flags.| Symptom | Likely Cause |
|---|---|
| I2C device not detected | Wrong wiring, missing pull-ups, address conflict, power issue |
| GPIO reads random values | Floating input — add pull-up or pull-down resistor |
| Pi won't boot / corrupts SD | Ungraceful shutdown or underpowered supply |
| Device draws too much current | External device powered from GPIO 5V rail (limited to 1A total) |
| Servo jitters | Software PWM jitter — use hardware PWM or dedicated servo controller (PCA9685) |
| Serial data corrupted | Baud rate mismatch, or UART shared with Bluetooth |
GPIO.cleanup() in RPi.GPIO)systemd for long-running hardware services — it handles crashes and restarts