Skip to content
Back to skills

Peripherals

ASecurity

This skill should be used when the user picks, wires or drives a peripheral part or module, such as displays, sensors, GNSS, IMUs, cameras, Wi-Fi / BLE / LoRa / cellular modules, nRF24L01+, RFID / NFC readers, mouse sensors, buttons and encoders, flash, EEPROM, FRAM, microSD, audio or RTCs. It covers selection, wiring, I2C addresses, layout, libraries and parts to avoid. Load it before recommending or wiring a part, even for a short question, because it lists the addresses, levels and parts t...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 1, 2026
ai-agentsgogitsecurity

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add gkochievi/boulder-hardware-skills --skill peripherals --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Peripherals?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Peripherals
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gkochievi-peripherals/badge)](https://www.skillsdirectory.com/skills/gkochievi-peripherals)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: peripherals
description: This skill should be used when the user picks, wires or drives a peripheral part or module, such as displays, sensors, GNSS, IMUs, cameras, Wi-Fi / BLE / LoRa / cellular modules, nRF24L01+, RFID / NFC readers, mouse sensors, buttons and encoders, flash, EEPROM, FRAM, microSD, audio or RTCs. It covers selection, wiring, I2C addresses, layout, libraries and parts to avoid. Load it before recommending or wiring a part, even for a short question, because it lists the addresses, levels and parts to avoid.
user-invocable: false
---

# Peripherals: displays, sensors, radios, storage, audio, time

Choose the right part for the job, wire it at the right levels, and avoid the parts that are obsolete or only good for demos. Every reference starts with quick rules and ends with sources; each covers selection, wiring, layout, firmware libraries and calibration.

## How to work

1. **Define the job in numbers:** what is measured or shown, range, resolution, accuracy, update rate, distance, viewing conditions, power budget, environment. "A temperature sensor" is not a requirement; "board air, ±0.5 °C, once a minute, on a coin cell" is.
2. **Pick from the selection table** in the matching reference; check that the part is active (not EOL or NRND), in stock on LCSC, and has a maintained library for the chosen firmware platform.
3. **Check the interface:** supply and I/O voltage (most sensors and display controllers are 1.8–3.6 V; character LCDs, MAX7219, WS2812 are 5 V), bus speed, I2C address against every other device on the bus, interrupt and reset pins.
4. **Lay it out for the physics:** temperature and humidity sensors away from heat; IMUs near the board's centre of rotation and away from mounting stress; light sensors behind a window with the right spectrum; antennas at an edge with keep-out; microphones with their port sealed to the enclosure.
5. **Plan calibration and self-test** in firmware: offsets at start-up, factory calibration values stored, sensor presence checked at boot and reported.

## Defaults and traps

**Displays**

- Choose by content, light conditions and power first: character LCD for fixed text, OLED for small high-contrast, TFT for colour and graphics, e-paper for static and battery, LED for long viewing distance.
- SSD1306 on 400 kHz I2C refreshes a full frame in about 23 ms; use SPI above about 20 fps. SH1106 needs its own driver (132-column RAM).
- 5 V HD44780 modules on 3.3 V show faint or no characters; PCF8574 backpacks answer at 0x20–0x27, PCF8574A at 0x38–0x3F.
- Frame time = width × height × bits per pixel / SPI clock; frame buffer = width × height × bpp / 8. Use partial buffers (LVGL) when it does not fit.
- PWM TFT backlights through a transistor; avoid static bright content on OLEDs.

**Sensors**

- Temperature by job: NTC (cheap 0–100 °C), I2C digital chips (board and room air), DS18B20 (cabled probes), PT100 / PT1000 + MAX31865 (precision), thermocouple + amplifier (high temperature).
- Humidity: SHT4x, SHT3x or AHT20; DHT11 is a demo part. CO2: NDIR (SCD40 / SCD41); VOC "eCO2" is an estimate.
- Read register 0xD0 on any "BME280": 0x60 = BME280, 0x58 = BMP280 without humidity.
- DC current: shunt monitor (INA226, INA228), Kelvin-connected; Hall sensors when isolation is needed.
- IMUs: no MPU-6050 / MPU-9250 / ICM-20948 / BNO055 in new designs; ICM-42688-P, ICM-42670-P, LSM6DSO, BMI270 instead. Calibrate gyro bias at every start, accelerometer after soldering, magnetometer in the finished product.
- Light in lux: digital ambient light sensor (OPT3001, VEML7700, BH1750), not an LDR; CdS LDRs are restricted in the EU. Integrate over 100 ms to cancel 100 / 120 Hz flicker.
- I2C address clashes to check: 0x68 (IMUs and RTCs), 0x29 (ST ToF, TCS34725, TSL2591), 0x39, 0x18 / 0x19, 0x40, 0x44, 0x48, 0x76 / 0x77, 0x3C / 0x3D (OLEDs).

**Radios and communication modules**

- Wi-Fi in the product → make an ESP32 the main MCU; an ESP coprocessor only when the main MCU is fixed.
- Use pre-certified modules with exactly the antennas in their grant; PCB antennas at an edge, copper-free on all layers, 15 mm or more from metal.
- LoRa: SX1262-class modules; compute time on air against the regional duty-cycle limit before fixing spreading factor and interval.
- Cellular: supply for 2 A peaks with large low-ESR bulk; no 2G-only modems in new products; level-shift 1.8 V modem UARTs.
- RS-485, CAN, Ethernet and USB host modules: `references/communication-modules.md` with `interfaces-and-protocols` (wiring, termination, protection).
- nRF24L01+: Nordic marks the series not recommended for new designs; keep RF_CH at 1–82 so the whole channel stays inside 2400–2483.5 MHz; set ARD from the product specification table (`scripts/nrf24_link.py`); give the module its own LDO and 10–100 µF. New 2.4 GHz designs: an nRF52 / nRF54 module with ESB (compatible with nRF24 in legacy mode) or BLE (`references/nrf-radio-modules.md`).

**RFID, NFC and input devices**

- MFRC522 is end of life and PN532 not recommended for new designs; for new readers use CLRC663 plus, PN5180 or ST25R3916. A UID or EM4100 ID is not a secret and MIFARE Classic gives no security: authenticate with DESFire EV3 or NTAG 424 DNA.
- Measure the 13.56 MHz antenna in its final housing, then match it (`scripts/rfid_antenna.py`); keep pours out of the loop and matching parts next to it.
- Optical mouse sensors need their matching lens and the datasheet's sensor-to-surface distance; the mechanics decide tracking as much as the chip.
- Full-speed USB polls a mouse at 1 kHz at most and BLE far less; debounce buttons eagerly or with the SPDT latch; check every HID report descriptor with `scripts/hid_descriptor.py`.

**Storage, audio, time**

- Rarely changed settings → MCU NVS / flash; counters written every second → FRAM; files and logs → SPI NOR with LittleFS, or microSD.
- microSD is 3.3 V only, needs 10 kΩ pull-ups on CMD and DAT0–3 even in SPI mode, and a load switch so firmware can power-cycle a stuck card. FAT is not power-fail safe.
- Speaker from an ESP32: MAX98357A (I2S, no MCLK); line out: PCM5102A. Class-D outputs are bridge-tied: never ground a speaker wire.
- Passive buzzers need a square wave, active buzzers DC; drive anything over about 10 mA through a transistor with a flyback diode on magnetic types.
- RTC: DS3231 or RV-8803 when the clock must stay right without network; PCF8563-class or the MCU's RTC only with regular NTP correction. Back it with a coin cell or supercapacitor; never charge a primary CR2032 (remove the charging path on DS3231 "ZS-042" modules).

These defaults summarise the references; where a reference gives conditions or disagreeing sources, follow the reference.

## References

| File | Use for |
|---|---|
| `references/displays.md` | display selection; character LCDs, monochrome graphic LCDs, OLEDs, colour TFTs, RGB / MIPI panels and LVGL, e-paper, LED matrices and 7-segment, smart displays and VFDs; libraries per platform; memory and power per type; connectors and level shifting |
| `references/environmental-and-analog-sensors.md` | temperature, humidity, pressure, gas and air quality, current / voltage / energy, external ADCs and load cells, distance and level, GNSS, reed switches and flow meters, placement and self-heating, I2C address table, calibration, selection table |
| `references/imu-and-motion.md` | IMU concepts and specs, active vs obsolete parts, wiring and addresses, sensor fusion, calibration, PCB layout and mounting, vibration filtering, built-in motion features, magnetic angle sensors, ToF in brief, selection table |
| `references/optical-and-light-sensors.md` | photodiodes, phototransistors, LDRs, ambient light, colour and spectral, IR receivers and emitters, reflective and slotted sensors, ToF distance, PIR, heart rate / SpO2, camera modules, flame / UV / smoke |
| `references/communication-modules.md` | selection by range and power; Wi-Fi, BLE, Thread / Zigbee / Matter, LoRa and sub-GHz, nRF24L01+, cellular, Ethernet, RS-485 / Modbus, CAN, USB host, 433 MHz and IR, NFC / RFID; antennas, certification, protocol stacks |
| `references/nrf-radio-modules.md` | nRF24L01+ in depth (status, modes and timings, Enhanced ShockBurst packet and transaction, ARD table, pipes, registers, legal channels, PA/LNA boards and Si24R1 clones, power, wiring for five platforms, layout, RF24 and bare-metal C, nRF Connect SDK ESB interop) |
| `references/nrf5x-modules.md` | nRF52 / nRF53 / nRF54 module families, module integration (antenna, ground, supply, programming) and certification duties, protocols, SDKs and bootloaders |
| `references/cellular-modems.md` | worldwide LTE Cat 1 (Quectel EG915U / EG915Q) and LTE-M / NB-IoT (BG95-M3, nRF9151) module choice by region, VBAT supply and decoupling, PWRKEY / RESET timing, 1.8 V UART level shifting, SIM, USB and antenna circuits, layout, land-pattern status |
| `references/rfid-and-nfc.md` | LF / HF / UHF basics, ISO 14443 / 15693 / NFC Forum types, EM4100 format, tag security, reader IC table and status, MFRC522 / PN532 / RDM6300 wiring, layout, Wiegand and OSDP outputs, card-detection firmware, regulatory notes |
| `references/rfid-antenna-design.md` | 13.56 MHz loop size, inductance, Q and damping, EMC filter, matching network, RX path, measuring, metal and ferrite, differential or single-ended tuning; 125 kHz coils |
| `references/mouse-and-hid-input.md` | how optical sensors work, PixArt sensor table, lens and mechanics, buttons and debouncing, scroll encoders, MCUs for wired, high-speed and wireless mice, power budget, trackpads and trackballs, wiring and layout, the plugin's routed mouse template and its alternatives |
| `references/hid-usb-and-ble.md` | USB HID descriptors, boot protocol, report IDs, polling interval, high-resolution scrolling, class requests and a TinyUSB example; BLE HID over GATT (HOGP) services and a Zephyr example; the PS/2 mouse protocol |
| `references/storage-audio-and-timekeeping.md` | SPI NOR, EEPROM, FRAM, microSD, file systems; buzzers, I2S DACs and amplifiers, microphones, codecs, MP3 modules; RTCs, backup, NTP and time zones |

## Scripts

| Script | Computes |
|---|---|
| `scripts/nrf24_link.py` | Enhanced ShockBurst air time, one auto-ack transaction and the minimum ARD, retry latency and throughput, channel plan against the legal band, Wi-Fi 1/6/11 and BLE advertising channels |
| `scripts/rfid_antenna.py` | 13.56 MHz loop inductance estimate, Q and damping resistor, EMC filter capacitor, L-network matching to a target impedance with E12/E24 values, LF tuning capacitor |
| `scripts/hid_descriptor.py` | parses and checks a HID report descriptor (report sizes per ID, common errors, boot-mouse layout) and generates a mouse descriptor as a C array |

Each prints a readable report, takes `--json`, reads a `[<script>]` section of `boulder.toml`, and exits 0 ok, 1 check failed, 2 usage error.

## Related skills

- `electronics-fundamentals`: the circuits these parts need (pull-ups, level shifting, ADC front ends, drivers, power).
- `microcontrollers`: which MCU pins and peripherals to use (IO_MUX SPI on ESP32, ADC1, I2S, PIO).
- `embedded-firmware`: drivers and libraries, display fonts and UTF-8 text, persistence, RTC with NTP.
- `pcb-design`: antenna keep-outs, sensor placement, ESD on external connectors.
- `interfaces-and-protocols`: SPI, I2C, UART, RS-485, CAN and USB wiring, termination and protection for these parts.
- `kicad-generator`: circuit blocks for an nRF24L01+ socket, a 13.56 MHz reader front end (CLRC663 plus), W5500 Ethernet, a microSD socket, a LoRa radio (Ra-01SH / Ra-01S) and a GNSS receiver (`kicad-generator/references/circuit-blocks.md`).

## Next step

When this is done, say what comes next: `interfaces-and-protocols` for the bus the part sits on, `kicad-generator` for its circuit block, `embedded-firmware` for the driver.

Files in this skill

  • SKILL.md11.6 KB
  • references/cellular-modems.md9.3 KB
  • references/communication-modules.md35.1 KB
  • references/displays.md30.4 KB
  • references/environmental-and-analog-sensors.md34.8 KB
  • references/hid-usb-and-ble.md22.3 KB
  • references/imu-and-motion.md30.9 KB
  • references/mouse-and-hid-input.md41.7 KB
  • references/nrf-radio-modules.md40.6 KB
  • references/nrf5x-modules.md10 KB
  • references/optical-and-light-sensors.md30.5 KB
  • references/rfid-and-nfc.md38.1 KB
  • references/rfid-antenna-design.md13 KB
  • references/storage-audio-and-timekeeping.md31.3 KB
  • scripts/hid_descriptor.py45.6 KB
  • scripts/nrf24_link.py30 KB
  • scripts/rfid_antenna.py47.3 KB
  • scripts/tests/test_hid_descriptor.py14 KB
  • scripts/tests/test_nrf24_link.py11.6 KB
  • scripts/tests/test_rfid_antenna.py14.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.