Tutorial: designing shields for Arduino Uno R3 with DipTrace

Background

The purpose of this tutorial is to give the reader a basic understanding of the steps involved in designing a simple printed circuit board (so-called shield) for the popular Arduino Uno platform. The steps are not comprehensive (deliberate choice), but the process involves a bit of trial and error, which is considered the best way of learning this topic. Otherwise it would just be copying/pasting with little, if any, pedagogical value.

The attentive reader will soon realise that there are no schematics in this tutorial. This is again a deliberate choice, as the task is to “reverse engineer” a printed circuit board based on the physical limitations (i.e. design rules) provided by the printed circuit board manufacturer and the inherent limitations in the design of the Arduino Uno R3 header connectors.

 

Why would you need a customised printed circuit board in the first place?

The market is flooded with shields for Arduino. However, many of these shields have been designed for the mass market and might not fullfill your particular needs. This brief tutorial describes a cost-effective way of designing and producing your own shields enabling customisation of printed circuit boards, whenever the need arises. Such skills are quite desirable, if you suddently have a specialised sensor that is not available on a breakout board and you would like to interface it in a robust setup free of error-prone loose wires.

Besides, it can be quite challenging trying to fit lots of components onto a relatively limited space with all the physical constraints that might be present. Lastly, there is great didactive value in the whole error correction process and occasional software glitches (!) that improve your analytical skills and sharpen your technical senses.

Current prices at iTEAD trend at USD 9.90 for ten printed circuit boards with the dimensions 50 mm x 50 mm x 1.6 mm (double-layer, FR4 glass fibre, HASL surface treatment, silk screen, 2×2500 square mm surface area), USD 14.90 for ten printed circuit boards with the dimensions 100 mm x 50 mm x 1.6 mm (double the surface compared to the smaller board), and USD 19.90 for ten printed circuit boards with dimensions 100 mm x 100 mm x 1.6 mm. In other words, less than USD 1.00 for a 50 mm x 50 mm printed circuit board, USD 1.49 for a 100 mm x 50 mm printed circuit board, and USD 1.99 for a 100 mm x 100 mm printed circuit board.

Design basis

Design objective: to create a generic template for shield following the Arduino Uno R3 connection convention. Physical dimensions of the printed circuit board are maximum 50 mm x 50 mm, so that it fits onto the smallest of the iTEAD templates. Connections to the Arduino Uno R3 pins should be self-explanatory with amble documentation printed onto the printed circuit board itself.

 

Starting from scratch

Start by reading the design rules from your printed circuit board manufacturer. I use iTEAD, so their design rules apply in this case.

Next, download and install DipTrace along with the 3D models. Attractive licensing terms apply, if you are a hobbyist not seeking to profit from your designs. Send them an e-mail and they will provide you with a key for a 500 pin version, 4 signal layers, free of charge. You can always upgrade, if you need more pins or decide to go commercial.

Start DipTrace PCB, go to View, and switch to imperial units (mil), activate grid (F11), under View select 20 mil grid size, and finally locate the Con header selection menu on the lefthandside.

The header rows with pin spacing of 0.1″ (2.54 mm) form the basis of our design file. Part numbers are shown in the following figure. Dimensions are given in 1/1000 inch (mil).

Figure. Four pin headers arranged in the standard Arduino Uno R3 pattern. Dimensions in 1/1000 in (mil)

 

Note the three numbers to remember for Arduino Uno R3: the two vertical header rows are spaced 1900 mils apart; the headers on the lefthandside (lower: 10 pins, upper: 8 pins) have a 160 mil gap; the headers on the righthandside (lower: 8 pins, upper: 6 pins) have a 200 mil gap. That is it.

Switching to metric scale reveals that we are challenging the manufacturering specifications from iTEAD. These thin solder rings/pads around the header pins are located so close to the printed circuit board edge that they risk breaking off, if they are put under mechanical stress. This we need to fix so that we meet the design specifications.

Figure. Four pin headers arranged in the standard Arduino Uno R3 pattern. Dimensions in 1/1000 m (mm)

 

Taking a closer look at the solder pads (the white areas inside the pin header patterns) suggests that they can fit within the 50 mm x 50 mm limitation – and at the same time be made more mechanically stable – if we change their appearence a bit. Click on a random pad, right click, and select pad properties.

Figure. Pad properties menu

 

Try manipulating the parameters width and height for the ellipse, click Ok, and see the changes. In this example, width is set to 2.2 mm and height to 1.5 mm.

Figure. Pad properties menu with altered parameters

 

The result looks promising. The pads are becoming narrower meaning that they will better fit on the printed circuit board with the given dimensions.

Figure. Altered pads on all four pin headers

 

The distance between the outer points on the pins across the printed circuit board has decreased from 49.96 mm to 49.76 mm. The design rules state that there should be a minimum of 0.2 mm from the board edge to the pad, so a maximum width of 49.60 mm is desireable. The pad properties are manipulated a bit more.

Figure. Pad properties menu with altered parameters

 

The resulting width is 49.56 mm, which meets the design rule specification.

Figure. Pin headers meeting design rule specifications

 

Now add a 50 mm x 50 mm printed circuit board (Object, Board points) and fit it around the pin headers. The clearance to both sides of the printed circuit board is 0.22 mm, which is within the design rule specification of 0.2 mm board clearance to pads.

Figure. Printed circuit board fitted around pin headers

 

Next, we add a layer of text (silk screen) that is printed onto the circuit boards. Space is limited, so we adapt abbreviations and avoid long explanations; they go in the online documentation of our project. Remember that the backside of the printed circuit board can also contain a silk screen as well as components. Note that the pin headers have been flipped to the backside.

Figure. Printed circuit board with example text on the top silk screen

 

We change the text according to the Arduino Uno R3 documentation.

Figure. Revised silk screen according to Arduino Uno R3 documentation

 

Now we have a standardised design. It can of course be refined further depending on your specific needs. If your are teaching electronics/programming, including visual feedback during debugging (i.e. extensive use of LEDs in connection with digital pins) is probably a good idea. In that case your base design could look like the following figure. Note that the surface-mount current-limiting resistors are mounted on the backside and connected to LEDs with static vias in the centre of the pads.

Figure. Optional LEDs connected to all digital pins, D0 through D13.

 

If you need access to all pins (i.e. for connecting external signal analysers, oscilloscopes etc.), it is a good idea to include test points (TPs). A design with this feature could resemble the one shown in the following figure.

Figure. Test points available for all pins

 

If you need to connect to external sensors, a standardised connector is worth considering. The circuit board has twelve bidirectional digital pins if we neglect Rx/Tx (serial port used for communication with your computer during development). Furthermore, the six analogue inputs are broken out and put on a 3×6 header.

The design could look like the one presented in the following figure.

Figure. Digital pins and analogue input pins broken out to 3×6 headers.

 

Many sensors come with standardised interfaces. Some of the most popular communication interfaces are I2C (inter-integrated chip), SPI (serial peripherial interface), and OW (OneWire). A design with headers for these three protocols could look like the one presented in the following figure.

Figure. Headers added for digital communication

 

Decoupling capacitors (100 nF) should be added close to all VCC pins.

Pullup resistors (2k2) should be added to the SDA and SCL lines (note that this will mean that A4 and A5 can not be used for the analogue-to-digital converter, as I2C communication and A4/A5 share the same pins).

Also, a pullup resistor, 4k7, should be added the the DQ line of the OneWire interface. Note that the DQ line is not wired to any of the digital pins; this is done with a loose wire.

An optional voltage reference (e.g. MCP1541) could be added to the AREF pin and enabled in software for improved stability on the analogue-to-digital conversion results. In that case, make sure that the analogue voltages do not exceed the reference voltage (4096 mV).

These things have been implemented in the preceeding designs.

Now it is time to add traces. It can either be done by ratlining and then using the integrated autorouter or manually. For didactic reasons, it is advisable to do it manually for the first simple designs.

  Figure. Printed circuit board routed manually

 

The remaining connections are autorouted as shown in the next figure. Note that the autorouter decided to add three additional vias given the constraints.

Figure. Autorouted printed circuit board

An interesting software glitch is also encountered: the autorouter decides to remove (!) manually laid out traces on the frontside of the printed circuit board. Look at the connections from A0:A4 and to their respective test points as well as the GND and VCC traces on the lefthandside. They have either been altered or are completely gone. I notified DipTrace about this bug on September 20th, 2014, but it apparently still exists in v. 3.0.0.0.

My fix is to manually re-reoute the traces that disappeared after running the autorouter.

Figure. Manually corrected printed circuit board

 

As a last finish, a so-called copper pour is added to both sides of the printed circuit board. This copper is connected to GND and provides some shielding. Goto Objects, Place copper pour.

Figure. Printed circuit board with copper pour

 

DipTrace PCB allows 3D models of components to be linked to their footprints, which enables you to create realistic 3D renderings of the finished printed circuit board. Note that not all components have associated 3D models.

The front of the printed circuit board without components mounted looks like this:

Figure. 3D rendering, frontside without components

 

Adding the fourteen LEDs (0805 form factor), the three 3×6 header blocks, and the three SIL connectors gives us:

Figure. 3D rendering, frontside with components

 

There is room on the backside to add a white box, which is ideal for writing short notes pertaining to a specific printed circuit board. A quite good aid in both teaching and prototype development.

Figure. 3D rendering, backside without components

 

The fourteen current-limiting resistors for the LEDs are on the righthandside, the voltage reference (MCP1541) and the two decoupling capacitors are placed in the lower righthand corner. The remainder of the components are decoupling capacitors and pullup resistors for the digital communication lines. For I2C, a 2k2 pullup resistor is suggested for both SDA and SCL. For OW a 4k7 pullup resistor is suggested for DQ. Pullup resistors for SPI have been omitted.

Figure. 3D rendering, backside with components

 

Tilting the design gives an impression of the relative sizes of the components.

Figure. 3D rendering, frontside with components, tilted

 

The last part of the exercise is to export the production files and ship them to the manufacturer. Go to Files, Export, and select N/C drill. Then click Auto and Export.

Figure. Setup for export of drill file

 

The generated file is an ASCII file (.txt) and should be labelled logically.

Next, select Files, Export, Gerber.

Figure. Setup for export of Gerber files

 

Text on the back silk screen is already flipped (selected under View), so click Files and fill in the names for the desired files.

Figure. Naming of Gerber files

iTEAD requires seven Gerber files besides the drill file. These seven files have been selected – and named appropriately – in the above figure. Note the file name extensions. The design is named “0x10” so it is repeated in all the file names.

Inspect the produced Gerber files with for instance Gerbv.

Figure. Resulting files

 

Compress all the files (.zip) and submit them to your manufacturer of printed circuit boards.

Comments are closed.