100kHz noise on power supply when USB is plugged in

Status
Not open for further replies.

dudmahn

Member
Hi,

I have a Teensy 3.2 hooked up to a breadboard, and I'm working on a project that will require reading from an ADC. I was seeing some 100kHz noise (pulses) on the ADC input, so I stripped everything down to the bare essentials to troubleshoot the problem. On the breadboard now, I have just the Teensy with connections to 5V (on the VIN pin) and ground. The 5V supply is fed from a Pololu 5V 2.5A buck converter, which is fed from a 3S LiPo battery at approx. 12V. The reason for the external regulator is that the board will eventually be powering equipment that draws up to 2 amps at 5V, and I want to power this equipment in the field with a large LiPo battery.

Here's a photo of the breadboard setup (ignore the Pololu on the left, it's just an extra part, not connected to anything):
breadboard.jpg

I've cut the trace to separate VIN from VUSB as indicated in this diagram (I tested with a multimeter, and there is no continuity between the pads on either side of the red line):
cut_trace.png

With this configuration, I'm seeing 100kHz pulses on the 5V supply when connected via USB to my computer (actually there's a USB hub in between):
5v_supply_with_usb.jpg

And when I disconnect USB, the 5V supply looks much cleaner. Still not super clean, but I suspect this noise is from the Pololu, which switches at 400kHz.
5v_supply_without_usb.jpg

At this point, I'm just running a very basic example app, nothing much going on here:
Code:
void setup() {
  // put your setup code here, to run once:
  Serial.begin(38400);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Hello World");
  delay(1000);
}

My question is: Is the 100kHz noise expected behavior, or am I doing something wrong? Is there anything that can be done to clean up that noise?
 
The +5V power supply from any computer's USB port, and +5V from any switching regulator will typically have a lot of noise. These supplies are designed for computers which still work fine with a large amount of AC noise on the nominal DC voltage supply. You mention using the ADC so if you are doing low-level analog stuff you have to clean up the noise on the supply, This may mean some effort to filter all connections to and from your circuit, such as RC and/or LC "pi filters" and attention to "ground loops" also. In some cases when you connect your oscilloscope ground to your circuit, you may have changed its behavior.
https://en.wikipedia.org/wiki/Capacitor-input_filter
 
Just wondering what shows when:
- touch only the GND to GND of USB cable to the Teensy
- is the HUB powered, any change unplugging it
- pull the USB from the computer
 
The +5V power supply from any computer's USB port, and +5V from any switching regulator will typically have a lot of noise. These supplies are designed for computers which still work fine with a large amount of AC noise on the nominal DC voltage supply. You mention using the ADC so if you are doing low-level analog stuff you have to clean up the noise on the supply, This may mean some effort to filter all connections to and from your circuit, such as RC and/or LC "pi filters" and attention to "ground loops" also. In some cases when you connect your oscilloscope ground to your circuit, you may have changed its behavior.
https://en.wikipedia.org/wiki/Capacitor-input_filter

Thanks for the input. I'm working with ADC to sample a voltage that has a relatively small range, between 0.5V and 1.1V, so there's not much room to accommodate noise like this. I am performing a moving average of several samples, so may be possible to smooth out the noise in software. However, I'll also investigate adding a hardware filter to smooth the 5V supply out as much as possible.
 
Just wondering what shows when:
- touch only the GND to GND of USB cable to the Teensy
- is the HUB powered, any change unplugging it
- pull the USB from the computer

Touching the scope ground only to the USB ground (USB connector on the Teensy actually) yields no improvement.
The hub is powered. Removing power yields no improvement.
Connecting directly to the computer USB port yields no improvement.

That said, I did find that if I wiggle the USB plug in the socket on the hub, I can get the noise to go away. When held at just the right angle in the socket, the noise goes away, and USB comms still work. I see the same behavior with the USB socket on the computer. I've also tried it with 2 different USB cables, and the behavior is the same with the hub and computer.

This is very strange... I wonder what's going on between the plug and socket that would cause the noise to occur, and then go away when the plug is tilted at just the right angle?
 
Probably a ground loop where GND is "transported" once by one of the 4 USB pins, and once by the shielding of the USB cable and plugs...
 
May it is not the angle (of cable?) at the usb hub, but the distance of the cable from the teensy?
I noted strong 'audio' interferences of USB cable from my custom audio boards.
 
Probably a ground loop where GND is "transported" once by one of the 4 USB pins, and once by the shielding of the USB cable and plugs...

Interesting. Any way to address this? Maybe disconnect the shielding from the ground pin on the Teensy? Or maybe hack up a USB cable to cut the shielding near the connector on the Teensy?
 
May it is not the angle (of cable?) at the usb hub, but the distance of the cable from the teensy?
I noted strong 'audio' interferences of USB cable from my custom audio boards.

It's definitely the angle of the plug in the connector. A very minute adjustment here (without moving the cable at all) make a huge difference in the noise.
 
You'd want to filter this with an LC filter, using an inductor rated for the current you will pull through it.
Unfortunately, that's hard to do on the USB input port. Perhaps you can add filtering if you pull power out of the Teensy?
Also, how do you hook up the signal you're sampling? Are you isolating the analog domain to the AGND and analog-in pins?
 
I've grown up in a world where there were still separate power supplies for the analog and digital circuit parts. Bt I understand that a MCU with integrated DACs and ADCs does not allow this. To get around the noise problem and to improve the resolution in your specific use case, I'd imagine an extra OP amp circuit (on a well filtered power supply rail which does amplify and shift the 0.5 to 1.1V voltage into a 0 to 3.3V signal, which (in case this pre-amp does not add extra noise) would decrease the noise level at the input by factor 5 to 6
 
I'd try to hack the cable

I have some interesting results to report... I hacked the shielding on the cable, and the noise is still there, and tilting the plug in the socket no longer helps. It's one step backwards, but perhaps it's a clue to what's going on? Perhaps an intermittent shielding connection on the socket in the hub (and also in my computer!)?
 
You'd want to filter this with an LC filter, using an inductor rated for the current you will pull through it.
Unfortunately, that's hard to do on the USB input port. Perhaps you can add filtering if you pull power out of the Teensy?

Just as a reminder, I've cut the VIN/VUSB trace, so I'm not powering anything from USB.

Also, how do you hook up the signal you're sampling? Are you isolating the analog domain to the AGND and analog-in pins?

I had AGND directly connected to the common ground on the breadboard. Perhaps there's a better way to do this. However, I'm at the point right now where I'd just like to get the 5V power supply cleaned up, and see how much that helps with the noise on the analog signals. I'll be powering 8 devices from the 5V supply, and each of these devices will be outputting an analog signal. I figure that if they're getting dirty power, it's likely that they'll output a dirty signal.
 
I've grown up in a world where there were still separate power supplies for the analog and digital circuit parts. Bt I understand that a MCU with integrated DACs and ADCs does not allow this. To get around the noise problem and to improve the resolution in your specific use case, I'd imagine an extra OP amp circuit (on a well filtered power supply rail which does amplify and shift the 0.5 to 1.1V voltage into a 0 to 3.3V signal, which (in case this pre-amp does not add extra noise) would decrease the noise level at the input by factor 5 to 6

Can you recommend an op amp IC component that will do this? The boards will be hand-built, and the design has 8 separate ADC signals. I'll be releasing PCBs so that others can build the board as well, and I'd like it to be relatively easy to build. Placing 8 more components on the board seems reasonable. However, if the op amp route is going to take a several discrete components per channel to make it work, then I'm afraid the board is going to be too complex.
 
AFAIK, AGND is internally already connected to GND, so no need for external connection.

Hmm... Looking at the Teensy 3.2 schematic, I see that AGND is connected to GND through a ferrite. So, would connecting it to GND externally make things worse?
 
For 8 channels, 2 quad op-amps, 1 capacitor, 2 resistors, plus 2 resistors per channel were needed, which brings the number of components to at least 21...

But beforehand, did you try to "clean" simply the input signals? A 330R resistor between the voltage input and the analog pin, and a 3,3nF capacitor between the analog pin and GND could be much simpler, cheaper, and of the same efficiency...
 
Hmm... Looking at the Teensy 3.2 schematic, I see that AGND is connected to GND through a ferrite. So, would connecting it to GND externally make things worse?

Grounding is not a science, it's a philosophy, metaphysics, or a religion. Thus, try it out and see what happens. :)
 
Grounding is not a science, it's a philosophy, metaphysics, or a religion. Thus, try it out and see what happens. :)

Not finding a summary of the nebulous nature of AGND I started this thread - hoping to get some understanding.

Interesting that 'cable angle or pressure' resulted in the noise drop out - perhaps the pressure results in closing a gap or improved connectivity?

Given OP :: "powering equipment that draws up to 2 amps at 5V"

My questions above are from my recent project where 2 Amp LED Matrix showed what I assume was a GND loop from my non EE point of view ( power was from USB HUB common to the PC/Teensy )- the USB power source showed 1.5 A in use - then touching USB GND dropped measured current to 0.9 A at the same time the display intensity went up. This was with VUSB<>VIN cut on Teensy so just that added GND path improved electron flow. At the same time as noted it then seemed to require a button push to program the Teensy - so that current moving impaired USB operation. When using a suitable USB battery the GND and power were isolated from the program USB and it drew 2 AMPS and worked properly.
 
For 8 channels, 2 quad op-amps, 1 capacitor, 2 resistors, plus 2 resistors per channel were needed, which brings the number of components to at least 21...

But beforehand, did you try to "clean" simply the input signals? A 330R resistor between the voltage input and the analog pin, and a 3,3nF capacitor between the analog pin and GND could be much simpler, cheaper, and of the same efficiency...

21 components doesn't seem too bad to get more resolution on the ADC signal. I'm currently using the Teensy's internal 1.2V reference, but loosing that 500mV on the bottom end bothers me a little. I'd like to filter out noise above 1kHz, so I currently have an rc lowpass filter consisting of a 2.2K resistor and 0.1uF cap. This does a pretty good job at cleaning up the ADC signal from random noise, but the 100kHz pulses are still coming though at 230mV peak-to-peak. With USB disconnected (or tilted at the right angle) I'm seeing 115mV peak-to-peak pulses at 400kHz (the frequency of my Pololu buck regulator). It's a noisy little bastard, and I'm thinking I should put some effort into cleaning up the 5V supply, because this noise does appear to be present on the analog signals.

Shall I assume that an rc filter would still be needed before the op amp, if I choose to go the op amp route?
 
Not finding a summary of the nebulous nature of AGND I started this thread - hoping to get some understanding.

Interesting that 'cable angle or pressure' resulted in the noise drop out - perhaps the pressure results in closing a gap or improved connectivity?

Given OP :: "powering equipment that draws up to 2 amps at 5V"

My questions above are from my recent project where 2 Amp LED Matrix showed what I assume was a GND loop from my non EE point of view ( power was from USB HUB common to the PC/Teensy )- the USB power source showed 1.5 A in use - then touching USB GND dropped measured current to 0.9 A at the same time the display intensity went up. This was with VUSB<>VIN cut on Teensy so just that added GND path improved electron flow. At the same time as noted it then seemed to require a button push to program the Teensy - so that current moving impaired USB operation. When using a suitable USB battery the GND and power were isolated from the program USB and it drew 2 AMPS and worked properly.

Very interesting. I'm not sure I understand, though. Are you saying the teensy was drawing current from USB, even though the VUSB/VIN trace was cut? And then you bridged the VUSB/VIN pads and supplied power from a "suitable USB battery" instead of an external source to VIN, and things started working correctly?
 
Very interesting. I'm not sure I understand, though. Are you saying the teensy was drawing current from USB, even though the VUSB/VIN trace was cut? And then you bridged the VUSB/VIN pads and supplied power from a "suitable USB battery" instead of an external source to VIN, and things started working correctly?

Not sure I understand what I'm seeing well enough to be more clear, but No. VUSB<>VIN was cut and still is. So AFAIK only GND was adding a path (LOOP?) for the display. The USB HUB ( common to PC's USB 3.0 rear connector ) was an "iPAD" CHARGE port - so I assumed it would provide the needed power for the display - but my 'Charge Dr' showed it limited to 1.5 A. When the USB was connected to Teensy only an alternate GND path was provided. Doing that dropped 'Charge Dr.' reported current to 0.9A because there were that many fewer electrons getting through its measurement path - at the same time the display brightness jumped.
It 'seems' to me the USB Charge port could supply the needed current and the GND was limited and once another GND path showed up the 1024 LEDS when to a brighter white and the Teensy GND path was ab/used to facilitate that and compromised the USB function. { I also thought this noteworthy to consider when a Teensy user says 'I need to push PGM Button to upload code' }

Also observed the Charge Dr. connector was quite WARM measuring current to the USB battery box. The battery box is 20 AH unit with 2.5 and 3.5 AMP USB supply ports. The Battery box measures it's own current ( in and out) and removing the Charge Dr. it then showed a full 2A going to the Display with no change when USB plugged to Teensy for proper AUTO program uploading.
 
Status
Not open for further replies.
Back
Top