Skip to the content
PCBKitNew board
2 layers85 × 56.5 mmModemHAT, the printed circuit board in 3D

Classic Phone Modem HAT for the Raspberry Pi

Size
85 × 56.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
111
Nets
110
Pads
376
Tracks, vias
764, 197
Pours
12
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
4 Jun 2022
Updated
1 Jul 2024

Overview

ModemHAT is an open-source printed circuit board by astuder, from the astuder/ModemHAT repository on GitHub. It is a 2-layer board of 85 × 56.5 mm with 111 parts on 110 nets, routed with 764 tracks and 197 vias.

It is built around the 74LVC541AD, LM4819M and SI2457-D-FT, with the SI3018-F-GS, CAT24C32YI-GT3 and 25LC320AT-I/ST among its other parts. Its parts include 41 resistors, 30 capacitors, 9 diodes, 6 ICs and 5 transistors.

Main components

12

README

README.md

Modem HAT for the Raspberry Pi

This HAT is a modem that connects the Raspberry Pi to a plain old analog telephone line.

Render of Modem HAT

The modem presents itself to the Raspberry Pi on an UART and is controlled with the classic AT command set. It supports various standards (V.22bis, V.32bis, V.34, V.90, ...) at speeds of up to 56 kbps.

The design is based on a Skyworks ISOmodem chipset, specifically Si2457 data modem and Si3018 line side driver. The implementation closely follows the circuits described in application note AN93.

The Modem HAT was successfully tested on the Shadytel phone network at Toorcamp 2022.

[!CAUTION] Whatever your jurisdiction, we're pretty positive that connecting this device to the public phone system IS NOT LEGAL! Don't blame us if you get into trouble.

Raspberry Pi Configuration

[!NOTE] This information was tested on Raspberry Pi 4 and Raspberry 5, running Raspberry Pi OS 12 (Bookworm). There may be differences for other versions of the Pi and/or Pi OS.

The modem HAT requires a Raspberry Pi 4 or newer.

The modem communicates through the Pi's UART on GPIO 8-11, and requires CTS and RTS for flow control. The modem supports automatic baudrate detection at speeds up to 307.2 kps.

Before first use after power-up, the modem needs to be reset. To reset the modem, GPIO25 (pin 22) is set low for at least 500ms, then set high, followed by a delay of at least 300ms.

By default, the modem is configured for operation in the United States. For other countries the modem may have to be reconfigured after reset. See AN93 chapter 6.2 for details.

Below are the configuration steps for Raspberry Pi 4 and Raspberry Pi 5.

Raspberry Pi 4

To enable the UART, edit /boot/firmware/config.txt and add the following line at the end of the file:

dtoverlay=uart4,ctsrts

After rebooting the Raspberry Pi, the UART is mapped to /dev/ttyAMA4.

To reset the modem, run the Python script reset-pi4.py.

The modem is now ready to use. For example connect to the modem by running:

screen /dev/ttyAMA4 115200

Once connected to the modem, if you type at and press enter, the modem should respond with OK.

Raspberry Pi 5

To enable the UART, edit /boot/firmware/config.txt and add the following line at the end of the file:

dtoverlay=uart3-pi5,ctsrts

After rebooting the Raspberry Pi, the UART is mapped to /dev/ttyAMA3.

To reset the modem, run the Python script reset-pi5.py.

The modem is now ready to use. For example connect to the modem by running:

screen /dev/ttyAMA3 115200

Once connected to the modem, if you type at and press enter, the modem should respond with OK.

AT Command Set

The modem supports the basic Hayes command set.

For a complete list of supported AT commands as well as configuration registers refer to AN93 chapters 5.4 through 5.7.

Raspberry Pi GPIO Pinout

Required connections:

PinDescription
13.3V power for modem chipset
2,45V power for audio amplifier
6GND
19UART CTS
21UART RX
22Modem reset, RPi GPIO25
23UART RTS
24UART TX

Optional connections:

PinDescription
13Modem interrupt, RPi GPIO27
15Modem boot config EEPROM SDIO, RPi GPIO22
16Modem boot config EEPROM CS, RPi GPIO23
18Modem boot config EEPROM CLK, Rpi GPIO24
27RPi config EEPROM SDA
28RPi config EEPROM SCL

In the standard configuration of the HAT, the modem boot config and interrupt pins are not electrically connected to the Rasbperry Pi GPIO header. Populate R29-R32 with 0-ohm resistors to use these pins.

Building Your Own HAT

General

Large parts of the HAT are based on the hardware design reference in application note AN93 chapter 4. Where applicable, identical component designators are used to simplify cross-referencing.

I used solder paste, stencil and reflow oven for assembly of the HAT. I also ordered partially assembled boards from JLCPCB, and manually soldered the parts that they didn't have in stock (modem chipset and high-voltage capacitors).

After soldering the through-hole parts (RJ11 connector, speaker), make sure to clip the leads on the bottom side of the HAT to avoid shorting with metal parts on the Raspberry Pi.

Modem

The modem chipset consists of the digital part Si2457 (U1) and analog part Si3018 (U2).

These are expensive parts, costing US $13-$16 and $6-$8 respectively when purchased from reputable distributors. While tempting, beware of sources like Ebay and AliExpress as parts may be salvaged, old or even fake. It will be much easier to diagnose problems without having to second guess whether the core components of the HAT are genuine.

The HAT uses a 32.768 kHz crystal (Y1) to clock the Si2457, mainly chosen for small size and because I already had a few in my parts bin. The downside of this choice are the slow reset sequence (800 ms) and that this clocking option is only supported by Si2457 revision D (part number SI2457-D-FT) or newer.

If you suspect that you're stuck with an old part, you could try using a 4.9152 MHz crystal instead. In that case you must remove R17 which configures the clock speed. You may also have to replace the load capacitors (C40, C41) with appropriate values. See AN93 chapter 4.1.3 for details.

On the analog side, most of the resistors, capacitors, diodes and transistors have critical voltage, current and/or power ratings. These are all called out in the schematic. See bill of material in AN93 chapter 4.3 for full details.

For bring-up and troubleshooting of the modem portion of the circuit, refer to AN93 chapter 10.1.

Audio Output / Speaker

The audio output is optional and allows monitoring of connection progress via a speaker, and who doesn't love the old-school sounds of two dial-up modems negotiating a session. It's half the reason to build this project! :)

The audio amplifier LM4819 (U4) can be substituted with the higher power, pin-compatible LM4862. Cheap, off-brand substitutes are probably fine too.

The HAT has a footprint for a 15mm speaker, like for example CUI Devices CVS-1508. Alternatively, footprint J3 provides connectivity via a JST-PH connector, or directly soldering speaker wires to the pads.

If audio is not needed, the audio amplifier (U4) and associated parts (C12-C19, R19-R24, SW1, J3) can be left unpopulated.

To enable audio output on the speaker, make sure MUTE switch is set towards the LEDs. The AT command to enable speaker output while dialing and handshaking is ATM1. Speaker volume is controlled with ATL1 through ATL4, where 4 is the loudest.

Modem Boot Config EEPROM

The modem boot config EEPROM is optional and can store AT commands that the modem automatically runs after reset. See AN93 chapter 2.7 for details.

The EEPROM can be programmed by the modem with AT commands. For hacking, the EEPROM can also be connected to the Raspberry Pi by populating R29, R30 and R31. For the latter, keep the modem in reset while interacting with the EEPROM.

If this functionality is not needed, the EEPROM (U6) and associated parts (C22, R26, R27, R28) can be left unpopulated.

Raspberry Pi HAT ID EEPROM

The HAT ID EEPROM is optional and can store information that allows the Raspberry Pi to recognize the HAT and load the required device tree overlay, i.e. automatically configure UART and other pins.

I haven't figured out the content for this EEPROM yet. Specification is here. Contributions are welcome :)

If this functionality is not needed, the EEPROM (U5) and associated parts (C21, R14, R25) can be left unpopulated.

Parts

111
QtyValueFootprintReferences
140.1uFCapacitor_SMD:C_0603_1608MetricC5, C6, C11, C14, C15, C16, C17, C18, C20, C21, C22, C50, C52, C56
111KResistor_SMD:R_0603_1608MetricR20, R21, R22, R34, R35, R36, R37, R38, R39, R40, R41
8GRNLED_SMD:LED_0805_2012MetricD2, D3, D4, D5, D6, D7, D8, D9
710KResistor_SMD:R_0603_1608MetricR17, R18, R19, R23, R27, R28, R33
60RResistor_SMD:R_0603_1608MetricR15, R16, R29, R30, R31, R32
4M2.5MountingHole:MountingHole_2.7mm_M2.5H1, H2, H3, H4
31uFCapacitor_SMD:C_0603_1608MetricC13, C19, C54
3600R @100MInductor_SMD:L_0603_1608MetricFB1, FB2, FB3
20.22uFCapacitor_SMD:C_0603_1608MetricC51, C53
2100KResistor_SMD:R_0603_1608MetricR5, R6
2150RResistor_SMD:R_0603_1608MetricR2, R26
218pFCapacitor_SMD:C_0603_1608MetricC40, C41
220MResistor_SMD:R_1206_3216MetricR7, R8
23.9KResistor_SMD:R_0603_1608MetricR14, R25
233pF Y2ModemHAT:C_1808_4520MetricC1, C2
256RResistor_SMD:R_0603_1608MetricR12, R13
2680pF Y2ModemHAT:C_1808_4520MetricC8, C9
2NPN 300V 0.5APackage_TO_SOT_SMD:SOT-23Q1, Q3
2NPN 80V 330mWPackage_TO_SOT_SMD:SOT-323_SC-70Q4, Q5
10.01uFCapacitor_SMD:C_0603_1608MetricC10
10.01uF 250VCapacitor_SMD:C_0805_2012MetricC3
11.07K 1/2WResistor_SMD:R_1210_3225MetricR1
11MResistor_SMD:R_0603_1608MetricR9
11uF 50VCapacitor_SMD:CP_Elec_4x5.4C4
12.49K 1/2WResistor_SMD:R_1210_3225MetricR4
12.7nF 50VCapacitor_SMD:C_0603_1608MetricC7
124LC32Package_SO:TSSOP-8_4.4x3mm_P0.65mmU5
125LC320Package_SO:TSSOP-8_4.4x3mm_P0.65mmU6
12x20 0.1" Stacking HeaderModemHAT:Raspberry_Pi_Stacking_HeaderJ2
13.65K 1/2WResistor_SMD:R_1210_3225MetricR3
1300V 225mAModemHAT:TO-269AA-RD1
132.768kHz 25ppmCrystal:Crystal_SMD_3215-2Pin_3.2x1.5mmY1
143V 1/2WDiode_SMD:D_SOD-123Z1
147KResistor_SMD:R_0603_1608MetricR24
147pFCapacitor_SMD:C_0603_1608MetricC12
1536R 1/4WResistor_SMD:R_1206_3216MetricR10
173.2R 1/2WResistor_SMD:R_1210_3225MetricR11
174LVC541Package_SO:TSSOP-20_4.4x6.5mm_P0.65mmU3
1G***kibuzzard-62720846kibuzzard-62720846
1G***kibuzzard-665D1212kibuzzard-665D1212
1G***kibuzzard-665D11B2kibuzzard-665D11B2
1JSTConnector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_VerticalJ3
1LM4819Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU4
1LOGOModemHAT:model-text2G***
1LOGOModemHAT:shodytel-text-smallG***
1P3100SBDiode_SMD:D_SMBRV1
1PNP 300V 0.5APackage_TO_SOT_SMD:SOT-23Q2
1RJ11Connector_RJ:RJ12_Amphenol_54601-x06_HorizontalJ1
1SW_SPDTButton_Switch_SMD:SW_SPDT_CK_JS102011SAQNSW1
1Si2457Package_SO:TSSOP-24_4.4x7.8mm_P0.65mmU1
1Si3018Package_SO:SOIC-16_3.9x9.9mm_P1.27mmU2
1SpeakerBuzzer_Beeper:Buzzer_15x7.5RM7.6LS1

Questions

How big is the ModemHAT PCB?

It measures 85 × 56.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the ModemHAT use?

111 parts, built around the 74LVC541AD, LM4819M, SI2457-D-FT and SI3018-F-GS. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the ModemHAT KiCad files?

From the astuder/ModemHAT repository on GitHub, at the commit this page was made from: the board is ModemHAT.kicad_pcb and its schematic ModemHAT.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the ModemHAT design in my own project?

Its repository states no licence, so its author keeps all rights: ask astuder before reusing the design.

Similar boards

  • 2 layers85 × 56.5 mmModemHAT, the printed circuit board in 3D

    ModemHAT

    kitspace-test-repos/kicad6-file-collection

    104 partsMIT
  • 2 layers73.9 × 73.2 mmSkyFax, the printed circuit board in 3D

    SkyFax

    ME-IRL/SkyFax

    Fax and data modems built around Skyworks's ISOModem chips.

    98 parts13
  • 2 layers111.7 × 98.3 mmDC25-geiger badge, the printed circuit board in 3D

    DC25-geiger badge

    badgelife/DC208-DC25-geiger-badge

    The DC25-geiger-badge from DC208

    33 parts4MIT
  • 6 layers244 × 244 mmRetroslop, the printed circuit board in 3D

    Retroslop

    CPTforever/8088-MicroATX-Computer

    A 8088 based, IBM 5150 like computer compatible with the MicroATX motherboard form factor.

    193 parts
  • 2 layers100 × 100 mmMacropadultra, the printed circuit board in 3D

    Macropadultra

    LimesOrLemons/Macropaduno

    An ESP32-S3 handheld controller with a custom PCB and 3D-printed enclosure for numerous programmable functions.

    67 parts
  • 2 layers90 × 135 mmVoron badge, the printed circuit board in 3D

    Voron badge

    tanaes/whopping_Voron_mods

    111 parts787GPL-3.0
  • 2 layers79 × 38 mmEthersweep, the printed circuit board in 3D

    Ethersweep

    Neumi/ethersweep

    Open Source, easy to use Ethernet connected stepper motor controller. Built in FreeCAD, KiCAD and Arduino.

    111 parts587
  • 2 layers50.8 × 62.2 mmESP32-GATEWAY Rev I, the printed circuit board in 3D

    ESP32-GATEWAY Rev I

    OLIMEX/ESP32-GATEWAY

    ESP32 IoT Gateway board with BLE WIFI and Ethernet

    111 parts322Apache-2.0