Avoid Noise In Analog Hardware Design
Most imps include multiple Analog-to-Digital Converters (ADCs) and Digital-To-Analog Converters (DACs), which allow you to handle analog applications without additional hardware. To add to the power of this hardware, the imp API includes classes for analog sampling and fixed-frequency analog output, enabling your device to record and play full analog waveforms. Some applications that make use of this functionality include:
For more information on developing Electric Imp application firmware to record and playback analog waveforms, please take a look at the software-oriented Developer Guide ‘Audio Waveforms And The imp’.
Depending on the application, signal integrity becomes very important in getting good performance from your design. Some simpler applications, such as reading a low-precision sensor like a thermistor, may not require the considerations covered in this guide. For others, such as audio or electrochemical sensors, a few mV of noise can seriously impact performance, causing audible noise in an audio recording or introducing significant error in a sensor reading.
If your design involves recording or playing back full waveforms, or if you’re doing discrete analog readings that can’t tolerate perhaps 50mV of noise, this guide has important information that will help you optimise your design quickly.
The power story for your design has the largest bearing on vulnerability to noise, so this guide spends a fair bit of time on how your design will be powered. It also covers avoiding noise from aliasing and crosstalk.
In order to understand how various sources of noise impact a signal you’re attempting to record, it’s important to understand aliasing.
When any analog waveform is sampled, the maximum frequency that can be faithfully recorded is half the sampling frequency (the Nyquist Rate). If higher-frequency signals are present in the sampled waveform, they will be aliased to a lower frequency; the sampled copy of the high-frequency signal will be indistinguishable from a copy of a lower-frequency signal.
Aliasing can cause serious problems when recording analog waveforms. For example, consider an audio recording application. If an inaudibly high-frequency sound is present when the recording is made, it can be aliased into an audible sound, introducing noise.
To avoid aliasing, an anti-aliasing filter is recommended. An anti-aliasing filter is an analog filter, which filters the incoming signal before sampling. This filter should attempt to block any frequencies above the Nyquist rate of the sampler, ensuring that any signal present can be recorded by the sampler.
The Lala reference design includes a second-order Butterworth low-pass filter for anti-aliasing. This filter effectively blocks frequencies above 8kHz. If the sampler is run at 16kHz, this filter is effective in preventing any high-frequency noise from being aliased into the signal.
Frequency Response of the Lala anti-aliasing filter. Plot generated by Analog Devices’ Filter Design Wizard
Even if your application doesn’t focus on audio, it’s important to consider aliasing. Just as this phenomenon can take inaudibly high-frequency noise from a microphone and move it into the audible band, it can also move high-frequency noise from power supply ripple or load transients and move it into the frequency range of interest.
The key to recording and playing back ‘clean’ analog waveforms is to provide ‘clean’ power to all portions of your analog design. Noise on the power supply of any components that touch the analog signal will be transferred, to some degree, into the analog signal. There are many sources of noise that affect the power supply. Load transients and ground noise are two very dominant sources of noise that affect every design.
The most significant source of noise in your design will probably be load transients on your power supply. Many parts of an Internet-connected device (the WiFi radio and processor, as well as other components your design may include, such as a SPI Flash) draw current from the power supply in large, sudden spikes, causing the entire power rail to ring. When this ringing reaches the analog portions of your design, it will cause noise. To minimize noise from load transients:
Use bypass and filter capacitors as recommended on all major components in your design Bypass capacitors filter high-frequency noise. On devices which exhibit substantial load transients, bypass capacitors help prevent that noise from reaching the power supply rail. On other devices not causing transients, bypass capacitors help prevent noise on the rail from reaching the component.
Separate your power supply rail into a Digital domain and an Analog domain The analog portions of a design often require much less power than the digital or high-power portions of the design, so it’s often possible and practical to use a separate power supply to drive the analog portions of the design. This can provide excellent isolation for devices in the analog domain from load transients caused by high-power devices in the digital domain. This is covered in greater detail shortly.
When current passes through a power or ground path in your design, it will cause a potential difference across that trace; this is simply Ohm’s Law: V = IR. If there is a potential difference between the ground connection at one part and the ground connection at another, the difference is noise. Measures that can be taken to reduce this noise include:
The best way to deal with noise from load transients is to avoid the load transients all together. For maximum isolation between noisy digital components and sensitive analog components, consider using separate power supply rails for these two domains.
In designs which are always-on, where battery life is not a critical parameter, providing separate analog and digital rails can be very simple. In this case, the 3.3V supply for the imp and other high-power components may be regulated with a DC/DC switching regulator or an LDO, depending on power and cost requirements. The analog supply can then be generated with an entirely separate power supply. An LDO is an especially good fit for creating an analog rail, as it does not generate ripple as a switching regulator does.
Example Block Diagram: Separate Analog and Digital Supplies
In some cases, it may not be practical or possible to derive separate analog and digital rails as shown above. There are still options for isolating analog components from digital noise:
Analog Rail derived from Digital Rail with an LDO; the LDO acts as a filter. Note that this is not possible with some imps.
A Pi Filter
imps have has several separate power domains internally, which are broken out differently depending type of imp being used. For most applications, it is simplest to tie these domains together externally. In applications which use a separate analog supply rail. However, the analog supply may also be used to supply the reference voltage for the imp. The specific electrical requirements for each imp type should always be taken from the datasheet for that type of imp.
The internal power domains of the imp:
|VDD||Digital Power Rail. Provides power for the Processor, WiFi Radio, and other parts|
|VDDA||Analog Power Rail. Provides power for the ADCs, DACs, internal timing, and other parts|
|VREF||Reference Voltage. Provides a reference for the ADCs and DACs|
A DC/DC switching power supply operates by switching current through an inductor. Switching DC/DC converters naturally create some ripple as the inductor in the power supply is switched and the output capacitor is charged and discharged. While this ripple is typically very high-frequency (into the tens of megahertz), this noise will be aliased down to lower frequency ranges when sampled. Worse still, because this noise effects the very components used to implement an anti-aliasing filter, the anti-aliasing filter will not protect against it.
The recommended layout for the TPS62172, a commonly used DC/DC Buck Power Supply IC, from TI’s Datasheet
Keep vulnerable components away from the inductor The inductor in a switching power supply can magnetically couple with other components in your circuit, particularly those with high inductance, such as long traces. When two inductors magnetically couple, the resulting circuit is effectively a transformer, allowing noise to move between two electrically unconnected nets. To avoid this, keep sensitive components away from the switching power supply, follow the recommended power supply layout, and be sure to use decoupling capacitors throughout your design.
If possible, use an LDO to provide the analog supply Because an LDO does not work by switching current through an inductor, it produces less ripple and removes the vulnerability to inductive coupling.
Crosstalk occurs when two electrical nets inductively couple, causing the signal on one net to bleed into the other. High-frequency signals are more likely to cause crosstalk, as inductive coupling happens more readily at high frequency. To minimize the risk of inductive coupling and crosstalk, keep high-frequency nets physically separated from sensitive analog traces.
For example, consider an application that uses SPI for high-speed signalling, and also includes analog input and output. It might use hardware.spi189: pin 1 serves as the clock, pin 8 as MOSI (‘Master Output, Slave Input’) and pin 9 as MISO (‘Master Input, Slave Output’). These signals need to be kept as far away as possible from analog signals, preferably with a ground pour in between the high-speed traces and the analog traces to act as a shield.
Early versions of the imp include a pair of pins that is especially susceptible to crosstalk. For each of these pairs, if one of the pins is used for high-speed or analog signalling, the other should not be.
|imp Type||Pin Pair|
|imp001||1 and 2|
|imp002||1 and 2|
|imp003||A and B|
Later imp versions (imp003 and up) are not affected this way.