Signal distortion only when USB is connected. - Page 1
Forum section: electronics / beginners

author: permal
author_rank: Regular Contributor
timestamp: December 10, 2017, 07:40:32 pm
content: Hi,I'm working on my first larger circuit and so far things are working out above expectation, but I've got one issue I can't find the cause of; whenever the USB cable is connected to the MCU breakout board (Sparkfun ESP32 Thing), I get severe signal distortion in two of my input lines, see the attached images.The input signal is a 5V active low signal (Wiegand signal from a keypad, powered from the same 12V as the rest of the circuit). The first image shows what it looks like with the USB connected, the second one with only the device's own power supply running. This is measured on pin 1 & 8, left side of U401 (TXB0102DCU) in the middle of the schematic.As can be seen in the third image I put a jumper (JP401, center left of the MCU on the right side in the image) for the 3.3V power of the MCU to be able to cut it off from the internal power while the USB is connected, but the distortion is present even with that off.Could someone please give me some pointers what I've done wrong?The entire schematic is availablehere, in KiCad format, and also attached as a PDF to this post.Update: Connecting a Laptop running only on batteries, i.e. isolated from mains results in the same distortion.

author: ogden
author_rank: Super Contributor
timestamp: December 10, 2017, 07:49:35 pm
content: At the moment hard to tell. Where do you connect your USB? Could be some weird ground loop problem or supply isolation failure somewhere in the chain (PC/scope/device). Any chance to connect your thing to completely isolated (from mains) USB power bank or laptop?

author: permal
author_rank: Regular Contributor
timestamp: December 10, 2017, 07:53:42 pm
content: Quote from: ogden on December 10, 2017, 07:49:35 pmIt's to a PC (connected to mains), I'll try with a laptop running on batteries and see if that makes a difference.

author: permal
author_rank: Regular Contributor
timestamp: December 10, 2017, 07:58:10 pm
content: Quote from: permal on December 10, 2017, 07:53:42 pmMade no difference, same distortion with Laptop running on batteries.

author: ogden
author_rank: Super Contributor
timestamp: December 10, 2017, 08:04:28 pm
content: Quote from: permal on December 10, 2017, 07:53:42 pmWhen I see some unwanted noise, I determine it's frequency and obviously try to findsource of it. When you know source, then it is much easier to find it's path into your circuit. First suspect of such spikes - switching supply somewhere around. Very handy accessory for your scope when you seek for switching noise is straight core inductor like this:Connect your scope probe to it's leads and sniff around all the supplies in the chain, try to find EM field that matches frequency of the suspect noise.

author: ogden
author_rank: Super Contributor
timestamp: December 10, 2017, 08:09:59 pm
content: Quote from: permal on December 10, 2017, 07:58:10 pmWhat do you see on other side of level shifter U401? Try to find origin of the noise/signal. Measure all around your circuit and components connected to it! Amplitude is enermous BTW.Some RIgol scopes have host USB port - try to plug it there. Same result? Maybe 0.5A of standard USB is not enough to power your circuit. Try phone charger that can deliver 1A as well.

author: permal
author_rank: Regular Contributor
timestamp: December 10, 2017, 08:22:07 pm
content: Quote from: ogden on December 10, 2017, 08:04:28 pmYou mean to use the inductor as a antenna? One pin connected to the scope, the other unconnected?Quote from: ogden on December 10, 2017, 08:09:59 pmSame thing on the other side of U401. Same thing with the USB connected to the Rigol. The 0.5mA from USB is enough, power draw is <400mA.

author: ogden
author_rank: Super Contributor
timestamp: December 10, 2017, 08:32:06 pm
content: Quote from: permal on December 10, 2017, 08:22:07 pmAsmagneticfield antenna. Which means both pins connected - one to ground lead an another to tip of the probe. Noise ishuge- you shall see it just by simply probing. Inductor is just convenient & isolated "magnetic field probe" to check what's going on in the supply transformers and high current tracks.QuoteI would test it anyway using powerful enough 5V supply (into the VUSB). You never know what is inrush current unless you properly measure it (which most likely you did not). You do not tell what's connected to "pin 1 & 8, left side of U401" and how connected, how it is powered. Maybe noise is coming from there?

author: permal
author_rank: Regular Contributor
timestamp: December 10, 2017, 08:45:08 pm
content: Perhaps it wasn't clear, but I did write:QuoteSo that is what is connected to pin 1 & 8. The signal is fine as long as the USB isn't connected.The entire circuit, including the keypad, draws less than 400mA, I've set my powersupply to cut of at 400mA and it is not cutting off. Unfortunately I don't have the schematics for the keypad, but it is what I assume is a standard Wiegand interface; D0, D1 and GND.