Skip to content
Simurq Labs

Learn

How do you turn an Arduino prototype into a PCB?

By Semih Özbir, Electrical and Electronics Engineer

Published · Last reviewed

In this guide · 9

Three ways, in order of effort. A shield plugs onto the Arduino and meets its headers. A carrier board holds a small module such as a Nano. Or the ATmega328P sits on your own board with its minimum circuit: decoupling, a 16 MHz crystal, a reset pull-up, an ICSP header and a USB-to-serial converter.

A shield PCB that plugs onto the UNO

A shield is the least work: the UNO keeps running the sketch, and your board adds the rest at the UNO's size. Take every header position from Arduino's files, not from a photo. The UNO R3's page offers its CAD files, and gives what a shield meets:

  • The outline: 68.6 by 53.4 mm, with four mounting holes of 3.2 mm.
  • The digital side: D0 to D13, then GND, AREF, and SDA and SCL a second time.
  • The other side: a pin left unconnected, IOREF, RESET, 3.3 V, 5 V, two grounds and VIN, then A0 to A5.

One gap is off the 0.1 in grid. Arduino's page for the Duemilanove, a classic ATmega328 board, notes that digital pins 7 and 8 sit 160 mil apart, against 100 mil for the rest. Place the headers from the CAD files, not from a grid.

Three pins need thought. IOREF gives the host's logic level: 5 V on the UNO R3. D0 and D1 are the serial RX and TX, which the board's USB-to-serial converter loads sketches through, so a shield that drives them fights every upload. And RESET is there for a button of the shield's own, since the shield covers the host's.

A carrier board for a small module

A carrier makes a module, such as a Nano, one part of your board: the module keeps the microcontroller and its circuit, and your board adds the rest, at the size you need.

  • Footprint. Take the pin count, row spacing and outline from the module maker's mechanical drawing, then print the layout at 1:1 and lay the module on it.
  • Sockets or solder. Header sockets let you lift the module out to replace or program it. Soldering saves their height and a contact that can work loose.
  • Power. Decide which side supplies it, the module's USB or your board through its power pins, and read the module's schematic before letting both feed it at once.

List the parts around it with a maker and a part number on each line, as the PCB BOM template shows.

The ATmega328P on a board of your own

The most work, and the most freedom over size, shape and parts. Microchip's datasheet and its application note AN2519 set what the chip needs. Pin numbers below are the 28-pin DIP's.

Schematic of an ATmega328P's minimum circuit at 5 V: 100 nF on VCC, AVCC and AREF, a 16 MHz crystal with two capacitors of 12 to 22 pF, a 10 kΩ pull-up on RESET, a 6-pin ICSP header, and a USB-to-serial converter whose DTR reaches RESET through 100 nF.

The ATmega328P's minimum circuit on its 28-pin DIP, simplified and redrawn from Microchip's datasheet and AN2519, with the Duemilanove's auto-reset.

Power, decoupling and the reference

  • 5 V for 16 MHz. The datasheet allows 10 MHz at 2.7 V, rising in a straight line to 20 MHz at 4.5 V. At 3.3 V that line gives about 13 MHz, too slow for a 16 MHz crystal.
  • Decoupling. A capacitor on each supply pair, close to its pins: VCC and GND on 7 and 8, AVCC and GND on 20 and 22. AN2519 asks for one on every pair, AVCC and AREF included, typically 100 nF.
  • AVCC. Tie it to VCC even if the ADC is unused. If the ADC is used, feed it through a low-pass filter, which the datasheet draws as 10 µH and 100 nF.
  • AREF. A capacitor from pin 21 to ground quiets the ADC's reference. Drive it from nothing else if the sketch selects AVCC or the internal 1.1 V, which would be shorted to it.

The clock

A 16 MHz crystal goes between XTAL1 and XTAL2, PB6 and PB7 on pins 9 and 10, with a capacitor from each to ground. The datasheet wants the two equal, and recommends 12 to 22 pF from 8 to 16 MHz. Choose the value from the crystal's own load capacitance, allowing for the board's stray capacitance, which AN2519 puts at 2 to 5 pF a pin. Place the crystal close to the chip, with ground around it. The UNO R3 clocks its chip from a 16 MHz ceramic resonator instead, whose capacitors are the values its maker gives.

Reset, programming and USB

  • Reset. RESET is PC6, pin 1. Its internal pull-up, 30 to 60 kΩ, can be too weak where there is noise, AN2519 warns. Add one to VCC: AN2519 gives 4.7 kΩ or more, weak enough for a programmer to pull RESET low, and at least 10 kΩ where debugWIRE is used, so 10 kΩ meets both. It also suggests an ESD diode from RESET to VCC, which the chip leaves out so that it can be programmed at high voltage.
  • ICSP header. MOSI, MISO and SCK on PB3 to PB5 (pins 17 to 19), with RESET, VCC and GND, in the 6-pin connector AVR programmers use. A programmer writes the flash over SPI while holding RESET low: that is how a bootloader gets in, or how a program skips one.
  • USB-to-serial converter. The bootloader takes sketches through the chip's serial port, RXD and TXD on PD0 and PD1 (pins 2 and 3). A converter joins that port to USB, its TX to RXD and its RX to TXD. The Duemilanove used FTDI's FT232RL; the UNO R3 uses a second microcontroller, an ATmega16U2.
  • Auto-reset capacitor. On the Duemilanove, the converter's DTR line reaches RESET through a 100 nF capacitor. When the computer takes DTR low, RESET drops long enough to restart the chip, so an upload needs no button: with the 10 kΩ pull-up above, the pair is an RC of 1 ms.

From breadboard wiring to a schematic

A sketch names pins by Arduino's numbers, and a schematic by the chip's ports. The UNO R3's pinout maps one to the other, and the datasheet places each port pin on the DIP:

  • D0 to D7 are PD0 to PD7, pins 2 to 6 and 11 to 13. D0 and D1 are the serial RXD and TXD.
  • D8 to D13 are PB0 to PB5, pins 14 to 19. D10 to D13 are SPI's SS, MOSI, MISO and SCK.
  • A0 to A5 are PC0 to PC5, pins 23 to 28. A4 and A5 are also I2C's SDA and SCL.

Wire by port name, not by package pin: the surface-mount TQFP numbers its pins differently, and adds two analog inputs, ADC6 and ADC7. D11 to D13 double as the ICSP lines, so whatever hangs on them, like the UNO's LED on D13, sees the programmer's signals too. An LED on a pin needs a series resistor, which the LED resistor calculator sizes.

Then write down what the breadboard does not show: what the board does and whether it must use the ATmega328P, its interfaces, its power source and voltage range, each rail's current and any supply it passes on, its outline and mounting holes, its temperature range and how many boards. PCB Agent asks about whichever of these a description leaves open, in at most two rounds of five questions, before a spec can be approved. Defaults fill most of them, never what the board does, the voltage of an unusual supply or the current of a supply passed on. Custom PCB design covers the full brief for a designer.

What Arduino's licence and name allow

Arduino's designs are open; its name is not.

  • The licence. The UNO R3's schematic carries the Creative Commons Attribution-ShareAlike 4.0 licence. Arduino's trademark page, explaining that licence for its own website's texts, puts it plainly: use the work in your own, as long as yours takes the same licence. A board drawn from Microchip's datasheet, as above, starts from no Arduino file.
  • The name. The same page lets anyone develop an Arduino hardware design into a product, under their own brand name and logo. Arduino's name and logo stay out of that product's name and your company's, and off the board itself. A description may name it after a referential phrase, as in "compatible with Arduino". Never register a trademark containing it, and acknowledge it as Arduino S.r.l.'s wherever you use it.

Limits

This covers the classic AVR boards, the UNO R3 and the Duemilanove, and the ATmega328P. Other Arduino boards use other chips, with circuits of their own. Firmware is left out, and so are writing the bootloader and setting the fuses that select the crystal, beyond the header that does both. It is not legal advice. PCB Agent's library has no ATmega328P module today, and a board's checks are not its test: the roadmap shows where PCB Agent's own boards stand. Arduino is a trademark of Arduino S.r.l.

Sources

Have a board in mind?

PCB Agent is not open to the public yet. Leave your email, and we'll write when early access starts.