Designing a custom Meshtastic PCB: MCU, SX1262 radio, RF layout and firmware support

Top view of a green circuit board with an nRF52840 chip, an SX1262 radio module and a short 50 Ω trace to an edge SMA antenna.
A custom node in outline: the MCU, an SX1262 module and a short, grounded RF feed to the antenna connector. Diagram: Gerber3D · Data: Supported Hardware Overview (Meshtastic docs)

A custom Meshtastic node is built from a few parts. You need a microcontroller (MCU) the firmware already knows, usually an nRF52840 or ESP32-S3. You add a Semtech SX1262 LoRa radio (a long-range, low-power radio chip) and a short 50 Ω path to the antenna. The firmware side is a small variant folder. What decides whether your board is any good is the RF layout and the power budget.

What Meshtastic expects from the hardware

Meshtastic describes itself as an open source, off-grid, decentralized mesh network. It is built to run on affordable, low-power devices. Each node relays (passes on) packets for the other nodes over LoRa. So messages travel without cell towers or internet.

The firmware README lists ESP32, nRF52, RP2040/RP2350 and Linux-based devices as targets. The docs also describe STM32WL builds, with some features left out to fit its memory. For the radio, the hardware docs recommend the SX1262 over the older SX127x parts, and most current Meshtastic hardware uses it. If you stay within these choices, you're designing a board the firmware can already drive.

Choosing the MCU and the radio

Meshtastic's device docs state the trade-off plainly. nRF52-based devices use less power than ESP32-based ones. They are generally preferred for solar and handheld nodes. ESP32-S3 boards are often cheaper and add Wi-Fi.

Building blockExamples in the device docsGood forWatch out for
nRF52840 + SX1262RAK4631 (WisBlock), Heltec Mesh Node T114Battery, solar, handheldsNo Wi-Fi
ESP32-S3 + SX1262Heltec LoRa32 V3 and V4Cheap base stations, Wi-Fi/MQTT gatewaysHigher current draw
SX1262 module with power amplifierEbyte E22-900M30S (30 dBm), used in community DIY buildsFixed routers needing rangeSupply current, RF switch wiring, legal power limits

For a first board, use a radio module rather than a bare SX1262. The module has already solved the matching network (the parts that tune the radio to the antenna), the harmonic filtering and the RF switch. You only route power, SPI and a few control lines. A complete MCU-plus-radio module such as the RAK4631 goes one step further: you route power, a few GPIOs and the antenna.

If you do go chip-down (placing the bare radio chip on your own board), start from Semtech's reference design. Also read its application note AN1200.66 (PCB design guidelines) for the SX1261/62. Johanson also makes an integrated passive device (several passive parts in one package). It replaces the whole SX1261/62 front-end matching network with a single 0805 part at 868 and 915 MHz, which saves a lot of tuning.

The RXEN/TXEN detail on Ebyte E22 modules

The E22-900M30S adds a PA (power amplifier, for transmit) and an LNA (low-noise amplifier, for receive). An RF switch picks between them, and the RXEN and TXEN pins control that switch. Community builds on the Meshtastic forum describe two wirings.

In the first, the MCU drives both pins and DIO2 is left unconnected. In the second, TXEN is tied to DIO2 so the radio switches itself. RXEN is still wired to an MCU pin that the firmware defines as SX126X_RXEN. Pick one and make your firmware variant describe exactly that.

RF layout: short, 50 Ω, heavily grounded

Custom nodes often disappoint in the same way. A perfectly good radio is followed by a bad 20 mm of copper. The rules are short:

  • Run the RF trace from the module pin to the connector as a 50 Ω line. Use microstrip (a trace over a ground plane) or grounded coplanar waveguide (a trace with ground beside it and below it). Calculate it for your fab's real stack-up (the layer thicknesses and materials). Our impedance calculator gives you the width.
  • Keep it as short and straight as the layout allows. No vias, no test-point stubs, no branches.
  • Put a row of ground vias along both sides of the trace. Put a solid ground plane under it. Johanson's layout notes for its SX126x filter say ground via placement is key to harmonic attenuation (removing unwanted multiples of the signal frequency).
  • Add a pi network footprint near the connector: one series pad and two shunt pads (pads to ground). Fit a 0 Ω link in series and leave the shunts unpopulated. Then you can tune later without a respin (a new board revision).
  • Use a u.FL connector (a tiny snap-on RF connector) for an internal antenna lead. Use an edge-mount SMA at the board edge for an external antenna. u.FL connectors aren't built for repeated plugging, so don't make them the user-facing port.
Copper drawing of a 50 Ω trace from a LoRa module to an edge SMA, with ground vias on both sides, a pi network, and a section view.
The RF layout rules above, drawn out: a 50 Ω trace with no vias, ground vias along both sides, and a pi network with empty shunt pads near the connector. Not to scale. Diagram: Gerber3D

Keep the LoRa feed away from the 2.4 GHz antenna on an ESP32 or nRF52 board. Keep it away from any GPS patch antenna too. And never transmit with nothing on the connector. A PA driving an open port is an easy way to damage it.

Band and duty cycle depend on where you live

The SX1262 tunes from 150 to 960 MHz. But your matching network and antenna only work well in one band. So decide the region before layout. These are the settings from Meshtastic's LoRa configuration table:

Region settingFrequency rangeDuty cycleFirmware power cap
US902.0-928.0 MHz100%30 dBm
EU_868869.4-869.65 MHz10%27 dBm
EU_433433.0-434.0 MHz10%12 dBm

The EU_868 slice matches the 869.4-869.65 MHz band in CEPT's ERC Recommendation 70-03. That band allows 500 mW e.r.p. (effective radiated power) at under 10% duty cycle (the share of time spent transmitting). Meshtastic tracks airtime over a rolling hour. It stops transmitting when a node hits the limit.

The power cap in the table is the ceiling the firmware applies, not a legal limit. Antenna gain and your national rules decide what you may actually radiate. This is general information as of December 2026. So check your regulator before deploying a high-power build: the FCC's Part 15 rules in the US, or your national authority in Europe.

Power and battery life

For a battery node, the nRF52840 is the easy choice. The radio spends most of its life listening. So the steady current of everything else on the board decides how long a cell lasts.

Several things quietly drain batteries on custom boards. One is a power LED that's always on. Another is a linear regulator with high quiescent current (the current it draws even with no load). Others are a display or GPS with no way to switch it off, and a battery voltage divider that draws current all the time.

Put GPS and display power behind a load switch controlled by a GPIO. For battery sensing, feed a high-value divider (with a small capacitor) into an ADC pin. And measure sleep current with a meter before you trust any estimate.

The usual setup is a single-cell Li-ion battery with a charger IC. If you add a 30 dBm PA module, read its datasheet for transmit current. It's far higher than the bare SX1262's. The regulator and battery have to supply it without the voltage sagging (dropping).

GPS is optional

Meshtastic can share positions. Some commercial nodes, such as the Heltec Mesh Node T114, offer GPS as an option. On your own board, a UART GPS module with an enable pin is enough. Give its patch antenna a clear view of the sky and switch its power, because an always-on GPS can use most of the power budget of an nRF52 node.

How your board gets firmware support

Each board in the meshtastic/firmware repository has a folder under variants/. The folders are grouped by chip family. Inside is a variant.h file that maps the pins (LoRa SPI, BUSY, DIO1, reset, RXEN, buttons, battery ADC, GPS). There is also a platformio.ini environment that extends the chip's base environment.

The build docs suggest copying an existing variant for similar hardware and editing it. That is the sensible way to start.

Set expectations early. Meshtastic's build docs say DIY hardware uses the PRIVATE_HW model number. It is community supported rather than supported by the core team. It does not appear in the Web Flasher or release assets, and it is maintained by you.

Officially supported devices come through the project's Partner and Backer programs. One shortcut: your schematic may copy the pin assignment of a supported board exactly. Then you may be able to run that board's firmware unchanged.

Checklist before you order

  1. Region chosen. The antenna, matching network and module variant are all for that band.
  2. RF trace calculated for your fab's stack-up. No vias on it, ground vias on both sides, pi pads near the connector.
  3. RXEN, TXEN and DIO2 wiring matches what your variant.h will declare.
  4. SPI, BUSY, DIO1 and reset lines go to pins the MCU can use for them.
  5. MCU boot, strapping (pins read at power-up to set the boot mode) and USB pins checked against the datasheet. Our ESP32 layout guide covers the ESP32 side, including the 2.4 GHz antenna keep-out.
  6. Battery sense divider, charger, and switched power for GPS and display.
  7. Antenna connector at the board edge, reachable in the enclosure.

Last step: load the Gerbers into Gerber3D. Run the DFM check (design for manufacturing) against your fab's profile. Then look at the RF trace and its ground vias in the 3D view. Our pre-order Gerber check guide covers the rest.

Questions

Which microcontroller is best for a Meshtastic board?

The nRF52840 if the node runs on a battery or solar, because Meshtastic's docs note nRF52 boards use less power than ESP32 boards. The ESP32-S3 is cheaper and adds Wi-Fi, which suits mains-powered base stations.

Can I use any LoRa chip with Meshtastic?

Meshtastic supports several Semtech radios, but its docs recommend the SX1262 over the older SX127x series, and most current hardware uses it. Make sure the module's control pins can be described in a firmware variant.

What frequency should my Meshtastic board use?

Use the band for your region: 902-928 MHz in the US, and 869.4-869.65 MHz (the EU_868 setting) in the EU, where a 10% duty cycle applies. The antenna and matching network must be built for that band.

Will my custom board be in the Meshtastic web flasher?

Not by default. Meshtastic's build docs say DIY hardware uses the PRIVATE_HW model number, is community supported rather than supported by the core team, and does not appear in the Web Flasher or release assets.

Sources

  1. Meshtastic home page (Meshtastic)
  2. Supported Hardware Overview (Meshtastic docs)
  3. LoRa Configuration and region table (Meshtastic docs)
  4. Building Meshtastic Firmware (Meshtastic docs)
  5. Updates to Supported Hardware (Meshtastic blog)
  6. meshtastic/firmware repository and README (GitHub)
  7. SX1262 product page (Semtech)
  8. New 1W DIY variant: Xiao nRF52840 + Ebyte E22-900M30S (Meshtastic forum)