Author Topic: Circuit noise decoupling  (Read 2277 times)

0 Members and 1 Guest are viewing this topic.

Offline swat3dTopic starter

  • Contributor
  • Posts: 27
Circuit noise decoupling
« on: April 22, 2016, 02:07:42 am »
Hi,

I'm working on a constant current circuit to drive a high power LED. I'm basically feeding a pwm signal through a rc low pass filter to the non-inverting input of an opamp. The ouput of the opamp drives the gate of a mosfet and the inverting gets the feedback from a shunt resistor on the mosfet source.

Everything works fine when generating the signal from a frequency generator. However when i feed the signal from a micro controller (Atmega328p) i get a lot of noise, about 15mv peak to peak, which is unacceptable given that I'm aiming for 1mv precision.

I have all recommended bypass caps installed:
10uF and 1uF on the input and output of the 7805.
.1uF on all ics between vcc and ground.

I have tried increasing the capacitance on the ICs and it goes down a little but still within unacceptable levels.

The only thing that has worked so far taking the noise down to 1mv peak to peak is putting a resistor in series at the micro vcc to form a low pass filter. However i can only go so high with the resistor given that it will limit the current to the micro and stop functioning.

Also this works fine when i disconnect power and ground from pins 20,21,22 and only leave 7,8. Same story with the other ones, i have to use a low pass filter to remove the noise completely.

There seem to be 2 overlapping noise frequencies, 1uS and .5uS from what i can tell.

I was hoping you guys could shine some light or give some recommendations.

I'm attaching the schematic and the pictures of the breadboard.

Thanks a lot in advance, i appreciate the help.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Circuit noise decoupling
« Reply #1 on: April 22, 2016, 02:43:17 am »
Simply get rid of the breadboard with stray couplings and resistances between all the circuit grounds and use a properly layed out pcb with a ground plane on one side. The positive supply tracks should be wide.
 

Offline swat3dTopic starter

  • Contributor
  • Posts: 27
Re: Circuit noise decoupling
« Reply #2 on: April 22, 2016, 03:20:18 am »
Ok. Really will it make that much of a difference? We are talking almost 20mv of noise. I really didn't want to order boards until I had the design tested. How do you guys go about testing a design if a breadboard is that inaccurate?
 

Offline janekm

  • Supporter
  • ****
  • Posts: 515
  • Country: gb
Re: Circuit noise decoupling
« Reply #3 on: April 22, 2016, 07:13:05 am »
Well it's not the 80s any more... PCBs cost nothing compared to engineer time (even at the hobby level, arguably).
In the 80s, one would have probably done some sort of point-to-point wiring on top of a copper plane. Or just a home-etched PCB.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20804
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Circuit noise decoupling
« Reply #4 on: April 22, 2016, 07:24:14 am »
What is the peak current, and what is the transition time? Rule of thumb is that 1mm of wire is a 1nH inductor.

Then calculate V=Ldi/dt.

Don't use solderless breadboards, ensure good groundplanes, think where currents will flow. For prototyping, use "dead-bug" and "manhatten" techniques.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline swat3dTopic starter

  • Contributor
  • Posts: 27
Re: Circuit noise decoupling
« Reply #5 on: April 22, 2016, 01:51:56 pm »
Alright! I guess I underestimated how bad breadboards can be. I'll get the pcbs prototyped right away!
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Circuit noise decoupling
« Reply #6 on: April 25, 2016, 12:16:10 am »
Alright! I guess I underestimated how bad breadboards can be. I'll get the pcbs prototyped right away!

Whoa Nelly!

Looking at your 2nd oscillograph it looks a lot more like oscillation to me. If it were me I'd investigate that before moving on to a PCB prototype. If nothing else try a dead bug layout on a bare copper board prototype first to make sure that you've not got stability issues.

Do not underestimate how fast the edges of microprocessor signals can be and how much wideband noise this can spray forwards into your circuit, they can prevoke bad behaviour that you won't see from more civilised signal sources. I regularly see ringing on MCU outputs that's too little to bother digital circuitry but is plenty enough to upset analogue circuitry. Funnily enough I saw exactly this the other day on a (slightly more sophisticated) PWM to analogue converter that I was building. In that case a 220R series terminating resistor made the problem disappear. Mine was driving a CMOS analogue switch in a switched integrator and the ringing was breaking through the switch's internal gate capacitance into the analogue output.

A quick diagnostic test to see if it's your current layout or the actual MCU signal that is the problem is to leave the MCU running but disconnect just the PWM source and try driving the filter with the sig-gen again. It the output is clean you've got stability issues, if it's still noisy then it's noise from the MCU coupled in via poor layout.

Another note - your layout is BIG with long leads. You've almost tried to gather up as many parasitics from your board and environment as possible. Keep things compact and leads SHORT especially near sensitive points such as Op Amp inputs and FET gates. That lead from your Op Amp to your FET is begging to collect rubbish, as is the long lead from your filter to the Op Amp input.
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf