CircuitPython on a Pico H drives an IR transceiver: it prints the code for any remote button it hears, and sends a code it's given, NEC, Samsung, or raw pulses for the rest. pico_tty.py drives it over USB serial. wiring.md says how to put it together. The flake starts here: a dev shell (nix develop --command make test) and a check that runs the doctests. Tested: make install, then make send turned on a Vizio TV. Generated-by: Claude Opus 5.5
49 lines
2.6 KiB
Markdown
49 lines
2.6 KiB
Markdown
# Wiring the IR emitter
|
||
|
||
A Raspberry Pi Pico H drives an Adafruit IR transceiver, so a computer on USB can learn a remote's codes and send them. The pins here must match [code.py](code.py)'s.
|
||
|
||
## Parts
|
||
|
||
- [Adafruit IR remote transceiver](https://www.adafruit.com/product/5990) (5990): a 940 nm emitter and a 38 kHz receiver, STEMMA JST PH 2 mm
|
||
- Raspberry Pi Pico H: the H has its headers soldered on
|
||
- a breakaway 0.1" header strip: 4 pins for the IR board
|
||
- a breadboard and 4 female-to-female jumpers, or short wires soldered direct, with heat shrink, for something more compact
|
||
- a micro-USB **data** cable: a charge-only cable gives power but no serial port
|
||
|
||
No soldering at all, by mail: Adafruit's [JST PH 2 mm 4-pin to female socket cable](https://www.adafruit.com/product/3950) (3950) in place of the header pins and jumpers. Not a STEMMA QT or Qwiic cable: that's JST SH, 1 mm, and won't fit.
|
||
|
||
## On a breadboard
|
||
|
||
The Pico H plugs straight in, straddling the center gap. The IR board needs 4 pins first: snap 4 off the breakaway header strip, plug their long ends into the breadboard, set the board on them, and solder.
|
||
|
||
Breadboard held long side horizontal: columns 1–30 across, rows a–j down, the gap between e and f. Each column's a–e is one strip, and f–j another.
|
||
|
||
```
|
||
1 2 3 4 5 ... 20 23 24 25 26
|
||
a . . . . . . o o o o <- IR board's 4 pins; board off the top edge
|
||
b . . G . P R . . . .
|
||
c # # # # # ... # . . . . <- Pico pins 40..21: c1 VBUS, c3 GND, c5 3V3(OUT), c20 GP16
|
||
d . . . . . . . . . .
|
||
e . . . . . . . . . .
|
||
------------------- center gap -------------------
|
||
f . . . . . .
|
||
g . . . . . .
|
||
h # # # # # ... # <- Pico pins 1..20: h20 GP15
|
||
i . . . . . S
|
||
j . . . . . .
|
||
^ Pico's USB end at column 1
|
||
```
|
||
|
||
Four jumpers, from the Pico's strips to the IR board's (read the board's labels for which pin is which):
|
||
|
||
| from | Pico pin | to IR board | |
|
||
|---|---|---|---|
|
||
| P: b5 | 36, 3V3(OUT) | VIN | power |
|
||
| G: b3 | 38, GND | GND | |
|
||
| R: b20 | 21, GP16 | IR Out | receive |
|
||
| S: i20 | 20, GP15 | IR In | send; crosses the gap |
|
||
|
||
Power is 3.3 V, not 5 V: the Pico's pins can't take 5 V, and the receiver's output may be pulled up to VIN. The emitter reaches less far at 3.3 V; across a room should be fine.
|
||
|
||
Then `make flash install` (see [the Makefile](Makefile)), and `make pulses` to see that the receiver is wired: press any remote button at it while it counts.
|