Why Worry About IPC Standards for PCB Design?

When I got started creating my first boards, the last thing I was thinking about was producing a board at huge scale, or even at low volume. As a young student, the most important thing to me was getting my great ideas to work as I imagined. Once I started working in the electronics industry as a professional, I quickly realized that the alphabet soup of standards was a useful tool for designers and manufacturers alike.

Among the most important and widely accepted standards for PCB design, fabrication, and assembly are the IPC standards. The list of IPC standards for PCB design is extensive. This set of documents covers everything from plating on exposed copper, to bare board cleanliness. Manufacturers make sure to familiarize themselves with the fabrication and assembly portions of the IPC standards for PCB design, but PCB designers should do their best to understand the design portions of the IPC standards.

What’s in the IPC Standards for PCB Design?

The short answer is: everything! Every aspect of PCB design, fabrication, and manufacturing you’ve ever considered is most likely associated with some IPC standard. Obviously, the list is too long to repeat here, but some of the important design standards are covered in the IPC standards for PCB design. Before scanning through the list below, be sure you’ve familiarized yourself with some basic guidelines for PCB design.

IPC 6012: Acceptability Criteria

When designers are building a new rigid board to comply with IPC standards and ensure manufacturability, the IPC 6012 standard is the place to get basic requirements. This set of standards, as well as the IPC-A-600 standard, will tell you what a manufacturer looks for when they receive your board. These standards address solderability, conductor width and spacing, structural integrity, and substrate material requirements. Some related standards are:

  • IPC-6011: Generic Performance Specification for Printed Boards
  • IPC-6013: Specification for Printed Wiring, Flexible and Rigid-Flex
  • IPC-6016: Qualification and Performance Specification for High Density Interconnect (HDI) Structures
  • IPC-6018: Qualification and Performance Specification for High Frequency (Microwave) Printed Boards
  • IPC- 6202: Performance Guide Manual for Single- and Double-Sided Flexible Printed Wiring Boards
  • IPC-2251: Design Guide for the Packaging of High Speed Electronic Circuit
  • IPC-7351B: Generic Requirements for Surface Mount Design and Land Pattern Standards

IPC-4761: Via Plugging

If you plan to use plugged vias, or plated-over vias, then you’ll need to review this important standard for via design. You’ll need to ensure your plugging and/or plating strategy is properly designed to ensure these structures do not fail during operation.

IPC-2221: High Voltage Clearance Standards

This standard defines safe clearance distances between conductive elements in high voltage PCBs. This standard also provides requirements on material quality, layout guidelines, and much more. A related specification for flexible PCBs is the IPC-2223 standard.

IPC-2152: High Voltage Clearance Standards

The new IPC-2152 standard provides much better guidance on designing boards with the appropriate trace width to prevent excessive temperature rise. This standard also addresses the required distance between traces and distances to copper planes.

IPC-2141A: High-Speed Controlled Impedance Standards

If you’re designing a high speed or high frequency board that requires controlled impedance routing, the IPC-2141 standard contains some impedance formulas for different trace geometries. However, the equations in these standards are known to be less accurate than other equations for microstrip and stripline impedance. Read more about the controversy here.

IPC standards for PCB design flowchart

The list of relevant IPC standards for PCB design and their application areas.

Take Advantage of Constraints in Your Design Software

Complying with IPC standards for PCB design becomes much easier when you use the right design software. I’ve never met anyone that can keep track of all the important IPC standards, and it doesn’t hurt to use design software that can help ensure compliance. If you plan to produce your board at scale, you need to ensure that important IPC design specifications are encoded in your EDA software as rules and constraints.

EDA software plays an important role in ensuring compliance with IPC standards for PCB design. EDA software, specifically for circuit and PCB design, is highly adaptable and includes tools that allow you to create nearly any conductive structure and layout you can imagine. Many design choices you make might be electrically correct, but they may not comply with IPC standards, and they may not be manufacturable. However, if you choose the right design software, you can identify DFM violations and any design choices that don’t comply with IPC standards.

The best software for PCB design will include important IPC standards as editable design constraints. If your board needs to obey more stringent standards than those defined by the IPC, you’ll need to edit an existing constraint or define a new one. While this takes some up-front time, you’ll be able to spot any design choices saves you from making a costly redesign before production.

Defining clearance constraints using IPC standards for PCB design

Example of a clearance constraint you can define in your next PCB design

There are a number of other important standards that play a role in PCB design software. Some of these have nothing to do with electrical functionality of an assembled board, and instead focus on footprints, symbols, and models used for components in PCB design software. Other standards bodies, such as the International Electrotechnical Commission (IEC) and Underwriters Laboratories (UL), set standards on PCB functionality, assembly, and their incorporation in specific products.

If you want to ensure your next board will comply with IPC standards for PCB design, you can take advantage of the rules-driven online design platform in Upverter®. This easy-to-use browser-based platform is ideal for designing new PCBs from start to finish. You can easily pick an existing template from a vast range of open-source hardware projects, and important IPC and DFM standards are defined as design constraints automatically.

You can sign up for free and get access to the best browser-based PCB layout editor, schematic editor, and component database. Visit Upverter today to learn more.

USB Connector Layout in Your Next PCB

USB-A connector in a computer

I tend to lose track of all my devices that can connect to my computer via USB, and I only expect the number of devices to increase, especially as so many products become embedded. These products will need one or more USB connectors to interface with a computer or other device. Whether you are using a standard USB-A or USB-B connector, or you want to use a Mini/Micro form factor, you’ll need to place a connector on your board and route it correctly.

This is rather easy to do in most layouts as the USB signalling standards are not too difficult to work with. Let’s look at what you need to do to incorporate a standard USB-A or USB-B into your PCB. You can then apply the same USB connector layout procedures to other USB form factors, such as USB Micro and USB Mini.

USB Connector Layout Guidelines: USB-A and USB-B

The critical layout rule that makes USB work so well is its use of differential pairs for routing. If you’re routing differential pairs in your schematic, you should make sure to indicate them with “p” (positive side) and “n” (negative side) on net names. This ensures your constraint manager recognizes these lines as differential pairs in your layout. In total, a USB-A or USB-B connector contains four connections: the differential pair mentioned above, a power connection, and a ground connection (see the image below).

USB connector layout diagram

USB connector layout and pinout diagram

The connector itself is shielded, which provides protection against interference. When taken alongside the use of differential pair routing, USB interfaces have strong resistance to interference within a board and from external sources.

The connector also needs to mount to the PCB using some small mounting holes. You should check your component datasheets for applicable hole sizes. Many USB connectors recommend using the standard 1.57 mm board thickness, so you should not place USB connectors on much thinner boards. The mounting connector crimps onto the backside of the board, so no external mounting screws are required.

When creating a USB connector layout, you won’t need a ground plane directly beneath the connector, although it is a good idea to place a ground plane beneath the differential pairs, i.e., in a microstrip configuration. Whether you need an internal ground plane below your surface layer also depends on the type of interface you are using. This is discussed more below.

USB PHY Interface

What about getting data from your MCU, MPU, or FPGA to your USB connector and to an external device? Unless your processor contains a built-in USB PHY interface, you’ll need to use a bridge component to generate data to send over a USB connector. A USB bridge is an IC that receives data using some common signalling protocols (e.g., SPI, I2C, or UART), and converts the data to the non-return to zero (NRZ) signalling used in USB. Similarly, if you are building a board to receive data over USB, you’ll need a bridge component to convert that data to one of these other signalling standards.

There are a number of components you can quickly bring into your board as a USB bridge:

  • FT232RL: This SMT component is a UART to USB 2.0 bridge that will interface.
  • FT201XQ-T: This QFP component is similar to the FT232RL, although it interfaces with I2C.
  • TUSB7320IRKMR: This SMT component is more powerful and can support USB 3.0 (see below). This particular component targets applications like notebook computers. It can interface using a number of protocols, including PCIe.
  • TUSB2077A: This component provides support up to 7 USB ports.

All these components are readily available from a variety of distributors.

USB 2.0 vs. USB 3.0

The first difference between USB 2.0 and 3.0 is the data transfer rate. USB 2.0 is rated up to 480 Mbit/s, while USB 3.0 reaches up to 4800 Mbit/s. If you are working with an application that requires extremely synchronous high data transfer rates, then go with USB 3.0, although USB 2.0 is still sufficient for many applications involving streaming audio, file transfer, and plenty of other applications. Note that USB 3.0 is backward compatible with USB 2.0.

At the board level, USB 2.0 and 3.0 use different termination schemes, depending on the impedance of the PHY component. Series resistors are used for termination, but the size and placement of the termination resistor depends on the component as different manufacturers use different output impedance specifications.

The USB connector bus has an input impedance of ~90 Ohms, while the driver output impedance ranges from ~28 to ~44 Ohms, so the resistor you need for termination will be particular to the component. If you don’t include termination resistors, an eye diagram for a data stream will not meet the requirement in the USB specifications. Be sure to check your datasheets for termination specifications, especially if the component supports both USB 2.0 and 3.0.

USB 2.0 and 3.0 connector layout

These blue connectors are USB 3.0 interfaces, and the black connectors are USB 2.0 interfaces.

The USB connector layout guidelines shown here can be easily brought into your next PCB when you use Upverter®. This easy-to-use browser-based platform is ideal for designing new PCBs from start to finish. You can easily pick an existing template from a vast range of open-source hardware projects, and you can find the connector and USB bridge components you need from the Parts Database.

Sign up for free and get access to the best browser-based PCB layout editor, schematic editor, and component database. Visit Upverter today to learn more.

Project Design Walkthrough: Airsoft Tracer Unit, Part 3

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Project Design Walkthrough_ Airsoft Tracer Unit, Part 3

We are back to work on the Airsoft Tracer Unit we started in Part 1 and continued in Part 2. We are building a unit that fits on the end of an airsoft gun and exposes the dark plastic BBs traveling through to UV light, exciting the luminescent material on the BB. This will make the BB glow brightly, making it easy to see during night games, or indoors. In previous articles, we selected our top level components, prototyped, and extensively tested the photogate for detecting the BB. We also ruled out the use of an LED lighting power supply for limiting the current on the UV emitters. In the first article, I mentioned looking at using an SR Latch to hold the state of the photogate after a BB passed through, but hoped that we would not need to do that.

In this article, we’ll be writing some code to run on an LPC11U24. We will be using the MBED online compiler platform to get the basics of our code written for the project, and see if we can do away with the SR latch. Ideally, we should be capturing the edge change of the signal quite rapidly so we can also use the LED unit as a chronograph as well as for ensuring the UV emitter array is only on when the BB is traveling past it.

Microcontroller Test Setup

In Part 2 of this series, we were able to test the photogate in real-world conditions using a 3D printed holder for the light gate components, and using that, we got some traces from the test board with the oscilloscope. We could use the same setup for testing the microcontroller code, however, it’s a little cumbersome to use such a setup for testing purposes. Therefore, I’m setting up a function generator to create a square wave that will closely simulate the timing of the live test I ran. I’m using a 30Hz square wave, which translates to a pulse width of 33.3ms. The square wave is present on two channels, the second of which has a phase of 353° relative to the first. In the airsoft world, 30 rounds per second is considered to be a moderate to high fire rate, which makes this a realistic test speed. The signal going low for 33.33 microseconds (99.9% duty cycle) matches what we measured previously quite well for the highest speed rounds, and the 353° phase of the second channel gives a 613μs gap between the first and second channel firing, simulating a BB traveling through the tracer unit.

Oscilloscope screenshot showing an active low pulse on the yellow channel and similar but delayed pulse on the cyan channel
Generated signal simulating BB entrance (yellow) and exit (cyan) with difference in time between the pulses of 613.6μs 

By using a function generator, we have a ‘best case scenario’ signal that we can use to develop firmware that will prove out the concept and give us reliable timing information to work with.

Using MBED

This code is being developed using MBED, which is an online compiler (which can also be installed on a computer) that uses an open source hardware abstraction layer for ARM Cortex M0 to M4 series devices and is developed by both ARM and the community. This means the code compiled with MBED is portable across many different devices without having to change controller-specific startup code or specific registers for each device’s peripherals. This is similar to the Arduino library, but only for ARM controllers. The online compiler provides a good user experience and makes collaborating with teams easy through built-in source control. There’s a wide range of useful functions built in, as well as many libraries for specific external devices published by the community that are easy to pull into your project.

Because it supports such a diverse range of controllers, my colleagues and I have experienced frustrating bugs that tend to be very platform-specific. For example, on one microcontroller, the timer has a 32-bit implementation, thus overflows after about 35 mins, but on another microcontroller, the timer for the same function has a 64-bit implementation and doesn’t exhibit the same failure. Also, due to the hardware abstraction layer, some portions of code can take significantly longer to execute than if you had used the register/peripheral directly with controller-specific code. The very slight delay this introduces is a common aspect of all hardware abstraction libraries (like Arduino), and is just something you need to work with for the convenience of the library. The platform-specific bugs do eventually get fixed when reported, but it can be a little frustrating when you come across one, and switching to another microcontroller can resolve the issues.

That being said, the bugs are few and far between, and code quality in MBED is generally very high. The platform allows rapid prototyping and evaluation of many microcontrollers to optimize cost, and makes development easy. Although the code for this project is going to be quite simple, timings need to be fairly tight to ensure the UV emitters turn on quickly and don’t stay on too long after the BB has exited the unit. The emitters generate a lot of heat, and we are doing away with current limiting, so to save them from premature failure we need to keep them on for the shortest period possible.

Software Requirements

In part 1, we looked at the overall specifications/requirements for the device, but didn’t go into details for the firmware. This is a very simple device, so it’s software requirements are brief.

Required Functionality:

  • Detect first photogate transition to low level signal.
  • Turn on UV LEDs while the BB transits the tracer unit.
  • Detect second photogate transition to low level signal.
  • Turn UV Emitters off when BB exits the tracer unit.
  • If the exit hasn’t been detected after 700μs, turn the UV emitters off.

Future “nice-to-have” functionality would include a Bluetooth chronograph with memory, allowing you to look back at velocity consistency at the end of the game.

Initial Test Code

We can implement this code in one of two ways:

  • Using a loop to poll the input pins to look for a state change.
  • Using interrupts to execute code when the pin experiences the changing edge we are looking for.

I’m going to go down the interrupt route, as the amount of code we need to run when the interrupt fires is very small, so implementation is going to be very easy. My main concern is whether the interrupt will be raised by the LPC11U24 microcontroller, and makes its way through MBEDs code to my user code quickly enough. If the delay is too long, it might make this infeasible.

A polling loop is an effective way to implement this functionality too, but if we have some code that will take a long time to run inside the loop, such as future Bluetooth functionality, it could block loop iteration for long enough to cause the microcontroller to completely miss the signal transition from high to low. On the other hand, with an interrupt, that long-running code will be paused while the interrupt is handled, and then execution will continue once the interrupt service routine is complete. This allows us to still perform any long-running tasks we may need in the main loop without having to worry about losing a pulse as a BB passes through the light gates.

Programming the LPC11U24

I’m starting out my code with the mbed_blinky template. This code just flashes LED1 on the dev board on and off every 200ms.

The first thing I like to do is set up some definitions for the pins I’ll be using on the microcontroller. This makes changing between dev boards easy, and makes it very clear where all the connections go if you pick the project up again at a later date, or are designing the schematic to go with the circuit board.

#define PIN_GATEONE P0_7 // p21
#define PIN_GATETWO P0_17// p22

#define PIN_LED2 p15 // for oscilloscope to watch

#define PIN_LEDOUT P1_8 // this is LED1
#define PIN_STATUSOUT P1_9 // this is LED2

I’ve defined my pins for both gates, a signal for my oscilloscope to watch, a status LED that will be flashed by the main loop, and another that will flash in time with the oscilloscope watch pin.

In a larger project, I’d have all the definitions in a separate header file to make it so I didn’t need to scroll through all the definitions at the start of the file. It makes it a lot easier to move pins around as you’re routing a circuit board to have all the definitions in one place with recognizable names, rather than having to hunt through multiple areas of code to change pin definitions.

Next, we need to define the IO objects. There are two interrupts for the light gates, and 3 digital outputs for the LEDs. That’s all the project requires—it’s nice and simple.

InterruptIn gateOne(PIN_GATEONE);
InterruptIn gateTwo(PIN_GATETWO);

DigitalOut led(PIN_LEDOUT);
DigitalOut led2(PIN_LED2);
DigitalOut status(PIN_STATUSOUT);

After this, we have two very simple functions to toggle led and led2 on or off depending on the interrupt that gets fired.

void triggerIn() 
{
    led = led2 = 1;
}
void triggerOut()

{
    led = led2 = 0;
}

triggerIn is for the first gate, with the BB going into the tracer, and triggerOut is for the second gate, where the BB is going out of the tracer.

Finally, we get to our main()function. This is going to turn all the LEDs off immediately on boot, and then configure the interrupts to trigger on the photogate edges.

int main() 
{
led = 0;
led2 = 0;
status = 0;


// Interrupt configuration
// Rising edge for end of BB transit through the gate
gateOne.rise(&triggerIn);

// Falling edge for start of BB transit into gate.
gateTwo.fall(&triggerOut);


while(1) {
status= !status;
wait(0.2);
}
}

The main loop is simply going to flash the status LED (LED2) on and off every 200ms.

Compiling the code is all done online, and programming is as simple as dropping the downloaded hex file onto the LPC11U24’s USB flash drive and hitting the reset button.

Oscilloscope screenshot showing the two pulses from the previous figure and the microcontroller response on the magenta channel
Introducing channel 3 (magenta) with the microcontroller response

It looks like it’s doing what it’s meant to do. There is a bit of a delay as we’d expect, but what’s most worrying to me is it seems to be jittering around a lot.

Oscilloscope screenshot showing pulse width and delay overlay on top of the previous figure
The oscilloscope provides us with pulse width data and delay data. The microsecond deviation is worrying.

Using the oscilloscope to measure this jitter, we can see from the falling edge of channel 1 (yellow) to the rising edge of channel 3 (purple) that we have an average delay of 19.73μs. However, the deviation is unacceptably high at 7.79μs. The total deviation of the pulse width is only 3.38μs, which I find interesting. The code should have highly repeatable results, so the delay and pulse width should be rock solid. The oscilloscope is in high-resolution mode, so we can detect as small as 97.14ns of deviation from the function generator pulse.

After some investigation, I removed the status LED flashing, and more importantly the 200ms wait call. Even though the code should essentially be paused during the wait call, it appears the wait state perhaps takes longer to interrupt than executing code does!

Similar to the figure above, but with more consistent delays and nanosecond deviation levels
All the delay and width measurements are now in nanoseconds!

Simply removing the wait call from the code gives us an absolutely stable pulse width and delay between the edge transitions. It’s actually significantly more repeatable than my new function generator is on average, which is quite encouraging for the code.

Improving the Code

We now have something that can switch on and off if the timing is right, but it’s fairly easy to get this code into a bad state. While the code is reading the signal reliably, messing with the function generator outputs (such as turning one off) makes it unhappy. It’s a valid proof of concept to show the interrupts are stable, however the code wrapping them is not, and it needs a few extra checks and balances in place.

bool triggeredState = 0;

I’m going to introduce a global variable to determine if the LEDs are active or not. I could check the led/led2 variable, but a global bool is going to execute a few nanoseconds faster, as well as make the code more readable and maintainable.

bool triggeredState = 0;

I’m also going to need to implement some code to ensure we don’t have the LEDs on for more than 700 microseconds, so we’ll need a Timer and a couple of timestamp objects.

Timer sysTime;
us_timestamp_t gateStartTime;

The Timer and gateStartTime are global. We’ll also add a local timeCheck variable to main(), which would also make the code more legible and maintainable even though we don’t strictly need it given the implementation.

us_timestamp_t timeCheck;

Now that we have the variables set up, we need to start the sysTime timer in the main() function, so I’ll do that right after we set the LED outputs to be off.

sysTime.start();

Next, I’ll relocate the contents of the interrupt routines into new functions so we can call them safely from other locations in the code. Because of the way MBED implements the interrupt service routine, we could call the ISR directly. Nevertheless, I feel it looks cleaner to have the ISR serve the single purpose of just handling the interrupt. If we were implementing the ISR directly with the microcontroller GPIO peripheral, it would need to be in it’s own single purpose function too.

void ledActivate()
{
led = led2 = triggeredState = 1;

gateStartTime = sysTime.read_high_resolution_us();
}

void ledDeactivate()
{
led = led2 = triggeredState = 0;
}

The ISR then gets changed to first check the triggeredState variable before calling these functions.

void triggerIn() 
{
if (!triggeredState)
ledActivate();
}

void triggerOut()
{
if (triggeredState)
ledDeactivate();
}

Finally, our main loop gets changed to be a check to see if the UV emitters have been on for longer than they are allowed.

while(1) 
{
// check for missed second gate
if (triggeredState)
{
timeCheck = sysTime.read_high_resolution_us() - gateStartTime;

if (timeCheck > LED_TIMEOUT)
{
ledDeactivate();
triggerTransitionRead = 1;
}
}
}

This will check the definition LED_TIMEOUT which is set to 700. If the LED outputs are on for longer than 700μs, the LEDs will be deactivated.

Oscilloscope screenshot showing active low pulse on the yellow channel and no pulse at all on the cyan channel and the finite response we expect on the magenta channel
Response is as we expect with the exit signal on channel 2 (cyan) removed.

With the device programmed, and the second channel on the function generator disabled (simulating the second gate missing the BB entirely), we now have a 716.8μs pulse. If we needed exactly 700μs, we could definitely optimize this further, however the code is doing exactly what it needs to at this point.

Oscilloscope screenshot showing no pulse on the yellow and magenta channels and an active low pulse on the cyan channel
It’s also as we expect with the entrance gate pulse (yellow) removed.

As we’d expect from the code, with no start pulse on channel 1, there is no reaction from the microcontroller.

Oscilloscope screenshot showing _ on the yellow channel and _ on the cyan channel and _ on the magenta channel

Finally, with both function generator channels enabled, our pulse is as we’d expect to see—switching on with the first pulse and off with the second.

Long Term Testing

I wanted to make sure we wouldn’t run into any overflows anywhere, so I left the setup running for around 9.5 hours, or 1,000,000 pulses. At the end of the period, the scope looked exactly as I left it, with everything functioning nominally. For the next 24 hours, I would switch on or off a channel on the function generator every time I walked by it, and at the end of the 24 hour period the device was still functioning well.

It appears that, for this project, MBED is going to be the perfect mix of functionality, ease of use, and speed of development. We also ended up not needing any latching of the signal, as the microcontroller is very capable of catching the pulse from the light gate, which will simplify the electronics further.

One Final Change

In the first article in this series I mentioned that I wanted to use the LPC11U12FHN33 microcontroller due to its compact size and low cost. The code I’ve compiled for the LPC11U24 *should* work on the LPC11U12 just fine, however, MBED have mentioned in several forum posts that you should really only use firmware for the exact chip configuration that is on the dev board, including the packaging, or weird things can happen. A friend of mine had this issue recently, in which he had compiled code that worked great on his dev board, but exhibited some strange behavior in his product which used a different package. I certainly can’t blame MBED for this, as most compilers would want you to select the exact part number you are compiling for. That being said, the LPC11U24 in the /401 package on the dev kit has a fairly large footprint—larger than I’d like to use on the circuit board for this.

As we’re only making a couple of these, the extra cost per unit is fairly negligible for a microcontroller upgrade when we are installing over hundreds of dollars (USD) worth of LEDs on the boards. I also have the MBED supported Embedded Artists LPC11U35 breakout board, which features a QFN package microcontroller instead of the QFP on the LPC11U24 dev board. This package change saves a significant amount of board real estate.

So after a quick change of target board in MBED and a switch of the input/output pins, the code is compiled and running on the LPC11U35 instead.

Oscilloscope image showing the response of an LPC11U35 instead of the LPC11U24
The response of the LPC11U35 instead of the LPC11U24

What I find very interesting about the code running on the LPC11U35 is that somehow, we have a much shorter period between the interrupt and the output pin state change. Both microcontrollers offer a 50MHz max speed and are running on a 12MHz crystal oscillator and, ostensibly, have the same architecture internally.

Well, whatever the cause, I’ll happily use this as an excuse to switch to the LPC11U35! A 24 hour test run with the LPC11U35 was also highly successful.

Next Time

We now have the test firmware completed and working reliably. We’ve selected our final microcontroller, and all of our electronics are tested (other than the basic linear regulator used to drive the microcontroller, which doesn’t need any prototyping). We’re finally ready to start on the PCB design in Upverter.

In the next article, we’ll be tackling the schematic capture, PCB layout, and output generation of the manufacturing files to send off to a PCB fabricator.

How to Choose ADC ICs for Your Next Project

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - How to Choose ADC ICs for Your Next Project

Whether you are sensing temperature, humidity, distance, or any other input from a sensor, chances are you will need an ADC to convert the incoming analog signal to a digital signal. Digital signals are easier to process and transmit around a board. When you are designing a data acquisition system from scratch, choosing the right type of ADC is an important task as it will impact the system’s performance and budget. Here’s how to choose ADC ICs for your next PCB and what you need to know about their different operating parameters.

How to Choose ADC ICs

One might argue that platforms like Arduino have a built-in ADC, so why bother with another ADC in the system? The ADC in an Arduino is a 10-bit IC with 4.9 mV step size. For low level signals, you might need a higher/lower resolution or a different step size. In either case, your optimum solution may be to design your own board with an ADC and a microcontroller.

In today’s components market, there is a huge number of ADCs available, each with different topology, resolution, power consumption, price, and other performance aspects. The following figure should give you a good idea of the difference between bandwidth and resolution in different types of systems. This should give you a good idea of the frequencies you’ll be working with and the resolution required for accurate digital conversion in a number of applications.

ADC-1

Resolution vs bandwidth for different applications [Image source]

It is tempting to think that picking an ADC with the highest possible resolution is the best choice for your system, but this is not always the case. While it is true that you need to consider the resolution of your ADC, you also need to understand the range of frequencies it can reliably convert into a digital signal. This is your bandwidth. As an example, if you want to measure distance or proximity (shown in the teal box above), your sensors will likely produce signals in the 1 Hz to about 20 kHz range. The bandwidth of your ADC will need to cover some portion of this signal range if you want to gather accurate measurements.

Types of ADCs

There are many ADC architectures for high precision applications, including Flash, high-speed, and sigma-delta. The choice of architecture is usually determined by the resolution required and the rate at which the input signal is sampled. This actually brings up another important point regarding ADCs; the sampling rate for your ADC needs to be at least double the largest frequency you want to sample.

The most common architectures for imaging, measurement, and data acquisition systems are sigma-delta, successive-approximation register (SAR), and pipeline ADCs. A general distribution of resolution vs. sampling rate is given in the following figure, which provides an idea regarding which ADC best suits a given system.

ADC-2

Resolution vs sampling rate for various ADC architectures [Image source].

This figure tells us something important: there is always a trade-off between resolution and sampling rate. Hence, reaching high resolution is more challenging when you are trying to sample a higher frequency. Let’s look at each ADC topology to understand how this works:

Sigma-Delta ADC

These ADCs work well for high precision (16-24 bits) and sampling rates of a few hundred Hz. There are two important processes used in a sigma-delta ADC: oversampling and noise-shaping. Details on implementing each of these signal processing steps are outside the scope of this article.

SAR ADC

Successive approximation register (SAR) ADCs are by far the most popular ADC used in data acquisition systems. They have resolution of 8 to 16 bits with sampling rates up to several MHz. They also have small form factor and low power consumption.

Pipelined ADC

These ADCs are more popular for sampling high frequencies, which can range from a few MHz to hundreds of MHz with resolution of 8 to 16 bits. Some applications include imaging and video systems, high precision RF measurement systems, and Ethernet or wireless transceivers. Pipelined ADCs suffer from initially low latency (i.e., response time), but afterwards they have high throughput.

Placing an ADC in Your PCB

Once you’ve decided on the type of ADC you want to use in your board, you will need to carefully place it in your layout. If you properly designed the ground plane for your board, you’ll have separated your digital and analog portions into different sections. Note that, when working with low frequencies, it is appropriate to place a notch between the two ground sections, but make sure the entire ground plane remains an unseparated copper region.

You’ll need to place the ADC so that it overlaps the split between the digital and analog ground regions. This is appropriate as modern ADCs generally separate the analog and digital pins onto different sides of an ADC. This allows you to route your analog lines to one side of the ADC and the digital output on the other side. It is best to place the ground pins on the ADC as close as possible to the connection between the digital and analog sections of the ground plane. This helps prevent transient noise from the digital side of the chip from interfering with the analog side.

Now that you understand how to choose ADC ICs, you can start with your resolution requirements. One important thing to consider at this point is power consumption. If your design will run on a battery, then you might need to consider sacrificing some resolution to conserve battery life. The output will have some delay, so latency of your ADC should be tolerable. Some applications have severe area constraints, so you might want to use a single ADC in a time-shared fashion rather than multiple ADCs. This will mean a reduction in sampling frequency, but it cuts down on area and power. Also, check the voltage compatibility of the ADC and your microcontroller.

Upverter® gives you an easy, browser-based platform for designing boards from start to finish. You can easily pick an existing template from a vast range of open-source designs and you can also choose from a vast library of verified components. These standard design features are accessible from anywhere by multiple collaborators.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Ethernet PCB Layout in Your Design

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Ethernet PCB Layout in Your Design.jpg

Ethernet is the traditional technology for connecting wired local area networks (LANs), allowing devices to communicate with each other via a standardized protocol. Since it is a local area technology, it is used mostly for networks operating within a single building. You can use Ethernet to connect your new board to the internet, where you have the freedom to save, retrieve, and visualize your data in a browser.

For some designs it is essential to have some level of remote connectivity for data transfer, monitoring, and sometimes for firmware upgrades. Connecting your project to a LAN allows you to tunnel into your board via SSH and modify software when required. Adding Ethernet to your board requires following some particular routing standards and choosing the correct parts for your board.

Design Considerations for Ethernet

Low cost PLDs, like simpler FPGAs and MCUs, typically need to communicate with an external Ethernet controller via SPI. This external controller provides medium access control (MAC), which is governed in its own firmware, and it acts as the physical layer (PHY). This integrated MAC/PHY then connects to the RJ45 connector using a standardized routing scheme. This is shown in the image below.

ethernet1

Ethernet controller for connecting your device to Ethernet [Image source]

Although the MAC and PHY blocks can be integrated into an external Ethernet controller, some newer MCUs include their own integrated Ethernet controller. This means you won’t need to use an external controller IC. Make sure to check the specifications of your MCU/FPGA before searching for an Ethernet controller IC.

Some examples of Ethernet controller IC are the ENC28J60, W5100, W5500, and many others. The RJ-45 connector can also be packaged in a single device, known as Mag-Jack. Using one of these components eliminates the need to design your own magnetic termination circuit. It should be noted that the Ethernet protocol standards clearly state that you must use a transformer on the Ethernet port in order to provide isolation and to remove any DC bias on the signal.

The image below shows an example of a simple RJ-45 Mag-Jack breakout board. The connector on this board includes the magnetic termination circuit required to isolate the connector. This board can be easily soldered to a standard header on an existing MCU board or on a shield board.

ethernet2

RJ-45 Mag-Jack breakout board

When creating an Ethernet PCB layout, the designer needs to choose the maximum data rate, physical media (i.e., which type of cable), and duplex mode. In embedded systems design, one of the most common speed choices is a 100Base protocol (100 Mbps); anything faster is unnecessary as MCUs are not equipped to handle higher speeds. Going to a GBase (1 Gbps) protocol requires a faster processor and controller. Most development boards that include this level of processing power will already include Ethernet; BeagleBone Black and Raspberry Pi are great examples.

Sometimes, it makes more sense to use 10 Mbps, depending on the speed of other devices in your LAN. This will definitely bring a cost advantage, and you might not notice the difference in communication speed unless your network has heavy data traffic or you need to transmit large amounts of data to/from your device. For example, if you are implementing Ethernet external to the MCU, Microchip’s ENC28J60 10 Mbps Ethernet controller is slightly lower cost than their ENC624J600 100 Mbps controller.

Using Ethernet Shields

If you are working with development board like Arduino or Raspberry Pi, then this task becomes easier. Raspberry Pi already has an Ethernet port where you can directly connect the cable. Here is an excellent tutorial for connecting Raspberry Pi to Ethernet.

shutterstock_413359297

Connecting Raspberry Pi 3 Model B to Ethernet

Arduino doesn’t have a direct Ethernet port, but there are shields available on the market that you can connect to your Arduino board. These shields are basically Arduino-compatible boards that have similar layout and contain an Ethernet controller (either Wiznet W5100 or W5500), and an the RJ-45 Mag-Jack. If you are looking for something cheaper, you can easily find small Ethernet modules for around $10. These modules are small in size, but they have limited speed (10 Mbps). Before you buy one, make sure to check pin compatibility and voltage levels. There are a lot of libraries available that can be used and many examples to help get your design up and running.

Ethernet PCB Layout for Your Own Board or Shield

If the available boards do not suit your specification or you need to meet certain area (footprint) or power constraint, then you might want to design your own board or shield. Signal traces from the controller to the RJ45 connector should be routed as short as possible on a single layer, and traces should be routed in a straight path. Try not to bend a trace by more than 45 degrees.

If your MCU/FPGA does not include the PHY layer, and you are not using an integrated Ethernet controller, the MCU/FPGA will act as the MAC layer and will need to communicate with an external PHY IC to drive signals over the RJ45 connector. Routing between the MAC and PHY layers uses MII or RMII routing, depending on the speed you are working with. Once you understand how signals are triggered in each layer, it becomes rather easy to route traces between the various components.

Upverter® provides a great library of reliable components where you can easily find the parts you need for your Ethernet PCB layout. If you are looking for an Ethernet controller, you can find the ENC28J60, W5100, W5500, and other controllers in the parts database. You can find the SI-60062-F, J0011D01BNL, or JXD1-0001NL RJ45 connectors, all of which have built-in magnetics. Here is a great example of an Ethernet controller module with W5500, which you can use as a template.

As a cloud-based PCB design tool, Upverter gives users the ability to share their designs, control revisions, and store design data in a secure online repository which is accessible from any location. You can browse thousands of open-source designs in Upverter’s projects database and pick one to customize for your new design. 

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Choosing and Adding a Display for Arduino Projects

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Choosing and Adding a Display for Arduino Projects.jpg

Many projects that collect data of some kind can be made more user-friendly if a display is added directly to the device rather than using a serial or HDMI monitor. This can also act as an input device if a touchscreen is used. There are a variety of display options available on the market, and Arduino shields are available which provide an easy way to interface with a display for Arduino projects. Let’s take a look at what you can add to your next Arduino project. 

Liquid Crystal Display

These are the most common type of displays used in simpler projects. They are simple to operate, consume a small amount of power, and are very cheap. They usually include an array of characters, with some displays having a backlighting option for ease of reading in low light. It is possible to attach them directly to an Arduino, but they use many pins on the board. An I2C adapter can be used to control the display with only 4 pins.

These screens more desirable than a 7-segment display as they can display a large variety of characters. There is a LiquidCrystal library that you can use to control the LCD, although you will need a different adapter if you are using I2C. Here is a video tutorial on how to set up and use this type of display.

shutterstock_275962166

A 16×2 LCD display that can connect via I2C

7-Segment Display

These are simple displays with 8 LEDs (7 lines and 1 dot) that work pretty much like any LED, where a forward bias will light up the diode. Different numbers or characters can be formed by selectively lighting the segments. They are available in either common anode or common cathode configuration. A good tutorial for using these simpler displays can be found here, where you’ll learn how to interface this display with an Arduino board. These displays come in a variety of sizes ranging from single digits to an array of characters. If you just need to display numbers or a small number of letters (for example, with a door keypad or a timer), then you can give your project a cool retro feel with 7-segment displays.

shutterstock_1479846836

7-segment display (single and array)

5110 Display

These displays were used in old cell phones, where the background was grey and the font was simply a darker shade of grey. These are monochrome LCD displays with 84×48 pixel screen size. These cheaper modules can display text (even multiple lines, depending on the library being used) and images. Although the refresh rate is slow for animations, they work well for simple text display. This display usually comes with a backlight. It has a CMOS LCD controller and these displays only run at about 0.5 mA when on without backlighting. They also have a sleep mode, making them convenient for battery-operated devices.

5110-display

5110 LCD display from Adafruit

OLED Display

If you are looking for something more than a 5110 LCD display, an OLED display can be a good option. At first glance, they look like the 5110 display, but they are significantly better. While the standard screen is 0.96” in monochrome with 128×64 pixels, they are available in a variety of sizes and colors, offering a versatile display for Arduino projects. Their refresh rate is also higher than many other displays. They can communicate with Arduino using I2C, so they do not use a lot of pins. These displays are usually thinner and lighter than an LCD, and they provide higher contrast than an LCD because no backlight is required. The price for these displays is slightly higher than a typical LCD.

shutterstock_570147922

OLED display for Arduino projects

TFT LCD 

Thin-film-transistor (TFT) LCDs are a step up in quality when your project requires a sophisticated display. They are available with or without touchscreen capabilities. They provide high resolution and can display thousands of unique colors. Often they have an SPI interface that integrates naturally into Arduino boards. They consume more power than other displays, but the display quality is better and they come in a similar price range. They usually come with a shield for easy integration. Touchscreens can be especially useful for cases where projects need user feedback and input.

TFT-LCD

TFT LCD that connects to a standard header

The TFT LCD shown above connects to a standard header with pins, but more advanced TFTs can connect to an Arduino or other board with a flex cable. These boards can’t connect directly to a standard Arduino, but they can connect to a standard or custom shield board. Make sure to check how your display connects to your Arduino project as you may need to purchase or design a specific shield.

E-paper Displays

As the name suggests, an E-paper display (commonly found in E-readers) is intended to have the same look as natural paper. They differ from LCD and OLED displays in that they do not emit light, but rather reflect it, making the display very comfortable to read. Another great aspect of these displays is that they can store data for a long period of time without consuming power. This means they can display text or images after they are turned off, making them perfect for low power mobile Arduino projects. Here is a tutorial for using them with Arduino.

e-paper-display

E-paper display

Use a Shield to Add a Display for Arduino Projects

Any of these displays can be a great addition to a new Arduino project. The choice of the best display depends mostly on the display quality you desire and your intended budget. They usually have a shield or can be interfaced directly to the Arduino header pins. Many projects may require multiple components, rather than just a display. It may be better to design a custom shield that can be used to interface with more than one component.

If you’re interested in designing a custom display shield for your Arduino board, Upverter® provides an easy, browser-based platform for designing new PCBs from start to finish. You can easily pick an existing template from a vast range of open-source hardware projects, or you can import Arduino shield templates from Eagle libraries, available from Sparkfun or Adafruit. You can then proceed to lay out the design and make your own shield.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.

Desktop PCB Design Software vs. Online PCB CAD Tools

Get Started with Altium Upverter, Sign Up Now

Upverter Expert - Desktop PCB Design Software vs. Online PCB CAD Tools.jpg

Anyone who is reading this article has already designed their own PCBs in the past, or intends to in the near future. Whether you are a professional or a hobbyist, every now and then the question of which PCB design application is most suitable for your application will come up. And the answer to this question is…it depends!!!!

As far as personal choices go, everyone wants different things from their design software, and everyone has a different level of expertise with their software. Sometimes, the choice of an appropriate PCB design package is governed by your available resources and the required investment. Today, we can divide available software into two categories: desktop applications and online PCB CAD software. Let’s take a look at both categories and their advantages, difficulties, and some popular applications in each category.

What’s the Difference Between Desktop and Online PCB CAD Software

As its name implies, desktop applications must be installed on your local machine. Once you do download and install the software, there is no need for an internet connection to use this software. Online PCB CAD layout tools do not need to be installed on your local machine, although some online tools provide an optional desktop version. This allows users to access the software on-demand. Users don’t need to worry about installation, keep track of their file structure, or worry about constantly compiling and downloading component libraries. However, users must have internet access to use the software.

Who Benefits from Desktop PCB Design Software

Some of the most popular desktop design platforms are Altium Designer, CircuitMaker, Eagle, KiCad, and OrCAD. These are heavy-duty software packages that come with a ton of features; you’ll normally need a license to run a full-featured version. While most of these are Windows, Mac, and Linux compatible, some might need Wine to allow the program to run on a linux-like platform. Once installed, one doesn’t need the internet to work on projects, but usually any work will require frequent data storage, sharing, retrieval, and occasional software updates.

All design data is stored locally on your computer’s HDD or connected storage. You can use some cloud-based storage platforms like Dropbox or Google Drive to save and backup design data. There is some version control software also available, which is preferable to manually transferring data every time you make changes to your design.

Another aspect which users must consider is data sharing. Whenever you are working as part of a team on a complex project, everyone needs a way to collaborate seamlessly on multiple portions of a design. Desktop applications cannot provide these capabilities without expensive addons or third-party software.

 

shutterstock_715844959

Desktop vs. Online PCB CAD tools

Online PCB CAD software

Web-based PCB design software is popular among the open hardware community. All you need is a browser that is compatible with your software and a decent internet connection. The leading names in online PCB CAD tools are Upverter, EasyEDA, and Multisim. Users need not concern themselves with software updates, but these platforms provide different features and disparate levels of support.

All the data is stored in the cloud and can be easily accessed from anywhere in the world. This gives designers freedom to share their data easily without using a separate cloud storage platform. One doesn’t need to worry about version control either because each design version is stored on the cloud.

Perhaps the most important benefit of using online PCB CAD tools is the ability to collaborate. This is where online tools stand out from desktop software. However, not all online PCB CAD platforms provide collaboration features. If you are working on a complex project as part of a team of designers, then you’ll need to ensure that the platform you want to use provides collaboration and data sharing features your team needs to track issues in new designs and make changes to a schematic or layout.

Collaborating in Upverter’s Online PCB CAD Tools

Upverter is an online PCB CAD platform that sets itself apart from other platforms. Here’s some of what makes Upverter different:

  • Import and sharing features. You can import an existing design (Altium, OrCAD, Eagle, etc.) or choose from a great selection of open-source designs from the community. You can design your schematic, layout and choose from a vast library of reliable components.
  • Collaboration and sharing. Collaboration for remote teams is easy in Upverter. Users have access to team-management and advanced access controls, providing multi-level permissions, instant notifications, and version control. Designers do not need to trouble themselves with hitting ‘Save’ each time they change something—Upverter automatically saves design changes in a Google Docs-style interface.
  • Customizable constraints. Upverter has an easy-to-use yet powerful constraint manager that allows users to customize DRC and DFM requirements. The constraint manager also reports violations in real-time so that you can fix errors before you send your board off for production. You can also prioritize rules, enabling you to manage multiple constraints targeting the same object. These constraints can then be examined in a final design review before you move to manufacturing.
  • 3D viewer. Upverter gives you a 3D preview of your layout directly in your browser.

constraints

Constraint Manager Upverter

With the online PCB CAD features in Upverter®, anyone has the ability to create custom projects from a unique browser-based design interface. The schematic design and PCB layout tools can help you take your design from start to finish and prepare for manufacturing. These standard design and production planning features are accessible from anywhere by multiple collaborators.

You can sign up for free and get access to the best browser-based PCB editor, schematic editor, and component database. Visit Upverter today to learn more.