Wiring
Every connection in the box, pin by pin. GPIO numbers are the Pi's Broadcom names; pin numbers are positions on the Pi's 40-pin header. Pin 1 is the one with the square solder pad, at the memory card end of the header. Odd pins are on the inner row, even pins on the row along the edge.
Before you wire
Work with everything unplugged. The OLED, the expander and the serial boards run from 3.3 V (header pin 1), never from 5 V: 5 V on the Pi's GPIO pins will damage it. Only the amplifier takes 5 V.
Power
The reference power wiring is not proven safe
This is how our prototype is wired. It has no fuse, no protection against a reversed or wrong supply and no protection against power flowing back from the PC's USB port, and it has not been tested for load or faults. Build it carefully, check it with a meter, and never leave it running unattended.
The reference build feeds the supply's 5 V to the Pi and to the amplifier separately, so the amplifier's current doesn't pass through the Pi. On the Pi it uses two test pads: PP1 (5 V) and PP6 (ground). Find them by the labels printed on your own board, not from a picture of another board, and check them with a meter (below) before you solder.
| From | To |
|---|---|
| Barrel socket centre (+5 V) | Pi PP1 test pad (5 V in), and the amplifier's Vin |
| Barrel socket sleeve (ground) | Pi PP6 test pad (ground), and the amplifier's GND |
| Pi pin 1 (3.3 V) | OLED VCC, expander VCC, the serial boards' VCC |
| Pi pin 6 (ground) | OLED GND, expander GND, the serial boards' GND |
Leave the Pi's header pins 2 and 4 (5 V) unwired. If your barrel socket has a third, switched contact, insulate it and leave it unconnected.
Before you power up, with everything unplugged:
- Check PP1 and PP6 with a meter. PP1 must show continuity to header pin 2 or 4 (5 V), and PP6 to header pin 6 (ground). If they don't, you have the wrong pads: stop.
- Check the barrel socket with the plug in. Plug the supply's plug in (supply unplugged from the wall) and check which socket contact meets the centre pin and which the sleeve. The centre is +5 V.
- Check for shorts between 5 V and ground, and between 3.3 V and ground.
When you use it:
- Use a regulated, protected 5 V supply, centre positive. Our prototype uses a 2.5 A adapter, but no current rating for the whole box has been worked out yet. For the first power-up, use a bench supply with a current limit if you have one.
- Never power the box from the PC's USB port and the barrel socket at once. That is why the USB cable's +5 V wire is cut (see below). Unplug the barrel power before you connect a USB cable that still carries +5 V, and unplug that cable before you plug the barrel power back in.
- Never plug or unplug bare wiring while the box is powered.
- An inline fuse in the 5 V lead from the barrel socket is a good optional extra.
The screen and the lamp board (I2C)
The OLED and the MCP23017 share the Pi's I2C bus.
| Pi | OLED (SSD1306) | Expander (MCP23017) |
|---|---|---|
| GPIO2, pin 3 (SDA) | SDA | SDA |
| GPIO3, pin 5 (SCL) | SCL (may be marked SCK) | SCL |
| Pin 1 (3.3 V) | VCC | VCC |
| Pin 6 (ground) | GND | GND |
- The firmware looks for the OLED at address
0x3c, and the setup page has no setting for another address, so use a0x3cmodule. Check the address on your module before you power up. - For the Waveshare MCP23017 board, leave the A0/A1/A2 address straps open: that gives
0x27(on that board, closing all three gives0x20). With any other MCP23017 board or a bare chip, set the address to0x27(on the chip itself that means A0, A1 and A2 high) and check it. With a wrong address the lamps stay dark. If a bare chip's RESET pin isn't pulled up, tie it to 3.3 V. - The Waveshare expander board already has pull-up resistors on SDA and SCL. Check what your other modules have before you add any more.
The eight lamps
Each lamp is wired from one expander output, through its own 470 ohm resistor, to the LED's anode (the longer leg). The LED's cathode goes to ground. An output that goes high lights its lamp.
| Expander pin | Lamp | Lit when |
|---|---|---|
| GPA0 | PWR | The box is running |
| GPA1 | AA | Auto-answer is on |
| GPA2 | OH | Off hook: in a call |
| GPA3 | CD | Carrier: connected |
| GPA4 | RD | Data going to the PC |
| GPA5 | SD | Data coming from the PC |
| GPA6 | READY | The modem is ready |
| GPA7 | NET | The box is on your Wi-Fi |
Fit them left to right in that order on the front of the case. Leave the GPB pins unwired. Never connect anything to GPB7: the firmware drives it as an output.
The speaker (I2S amplifier)
| Pi | MAX98357A |
|---|---|
| GPIO18, pin 12 | BCLK |
| GPIO19, pin 35 | LRC (LRCLK) |
| GPIO21, pin 40 | DIN |
| 5 V from the supply | Vin |
| Ground | GND |
- The speaker goes between OUT+ and OUT-. Neither of them is ground: never connect either one to ground.
- Leave SD and GAIN unconnected only if your board's own notes say that gives 9 dB gain and the (L+R)/2 mix; ours were taken from the seller's photos, not a schematic. Don't connect SD to a Pi pin: its pull-up may go to 5 V.
- No MCLK wire is needed.
The PC connector (DA15)
The box has one connector for the PC: a female DA15 socket, 15 pins in two rows (8 on top, 7 below; not a three-row VGA socket). USB and the serial line share it. This is our own pinout, not a standard one, so never plug an ordinary 15-pin cable (a joystick, network or VGA cable) into it. The full drawing is page 7 of the wiring plan (PDF, on the Downloads page).
| DA15 pin | Signal | In the box |
|---|---|---|
| 1 | DCD, carrier detect | S2 T1OUT |
| 2 | RXD, data to the PC | S1 T1OUT |
| 3 | TXD, data from the PC | S1 R1IN |
| 4 | DTR, PC ready | S2 R1IN |
| 5 | Ground (serial and USB) | Common ground |
| 6 | DSR, modem ready | S2 T2OUT |
| 7 | RTS, from the PC | S1 R2IN |
| 8 | CTS, to the PC | S1 T2OUT |
| 9 | RI, ring indicator | S3 T1OUT |
| 10 | USB D- | Pi pad PP23 |
| 11 | USB D+ | Pi pad PP22 |
| 12-15 | Not connected |
- No pin carries power: the box runs from its own barrel supply and must never be powered from the PC.
- Find PP22 and PP23 by their printed labels on the Pi and check them with a meter against the data pins of the Pi's USB socket (D- is its pin 2, D+ its pin 3) before you solder.
- Look at the socket's moulded numbers: seen from the front and from the solder side the order is mirrored. The metal shell is not pin 5.
The PC cable starts at a male DA15 plug and splits in two:
| DA15 plug pin | Goes to |
|---|---|
| 10 | USB-A plug pin 2 (D-) |
| 11 | USB-A plug pin 3 (D+) |
| 5 | USB-A plug pin 4 (ground), and DE9 pin 5 |
| 1-9 | The same pins of a female DE9 socket, for a straight-through serial cable |
| USB-A pin 1 (+5 V) | Nothing: cut it short and insulate it |
Keep the two USB data wires twisted together and short. Check the cable with a meter before you first plug it in: no USB pin may touch a serial pin, and the USB +5 V wire must reach nothing.
A prototype drawing
The wiring plan is a prototype drawing and says so: it has no fuse, and plugging the USB side in and out while the box is on has not been qualified yet. Plug the PC cable in with the box switched off.
The serial port (being tested)
Being tested
This wiring hasn't been checked with a real PC yet. USB is the supported connection. Never connect RS-232 signals straight to the Pi: they swing well beyond 3.3 V.
Three MAX3232 boards, called S1, S2 and S3 here, each with VCC to 3.3 V and GND to ground. Their RS-232 side goes to DA15 pins 1-9; from the PC cable's DE9 branch, the serial cable to the PC must be straight-through with all nine wires.
| Signal | Pi | Converter, Pi side | Converter, RS-232 side | DA15 pin |
|---|---|---|---|---|
| Data to the PC (RXD) | GPIO14, pin 8 | S1 T1IN | S1 T1OUT | 2 |
| Data from the PC (TXD) | GPIO15, pin 10 | S1 R1OUT | S1 R1IN | 3 |
| CTS to the PC | GPIO17, pin 11 | S1 T2IN | S1 T2OUT | 8 |
| RTS from the PC | GPIO16, pin 36 | S1 R2OUT | S1 R2IN | 7 |
| DCD, carrier detect | GPIO22, pin 15 | S2 T1IN | S2 T1OUT | 1 |
| DSR, modem ready | GPIO23, pin 16 | S2 T2IN | S2 T2OUT | 6 |
| DTR, PC ready | GPIO27, pin 13 | S2 R1OUT | S2 R1IN | 4 |
| RI, ring indicator | GPIO24, pin 18 | S3 T1IN | S3 T1OUT | 9 |
| Signal ground | Pin 6 | GND | GND | 5 |
- Fit a 10 kilo-ohm pull-up from 3.3 V to each transmitter input in use: S1 T1IN, S1 T2IN, S2 T1IN, S2 T2IN and S3 T1IN.
- On S3, tie the unused T2IN to 3.3 V. Leave every other unused pin unconnected, and never join two outputs together.
- The DA15 socket's metal shell stays unconnected. Pin 9 is the ring indicator, not power.
- The port runs at 115200 bps, 8N1, with RTS/CTS flow control. The box keeps RI off for now: there are no incoming calls yet.
- On Windows, add the modem yourself (don't let Windows detect it): pick a standard modem that allows a maximum port speed of 115200, on that COM port. Set the maximum port speed to 115200 and the flow control to hardware (RTS/CTS).
Next: the case.