Rule of thumb for noise reduction? - Page 1
Forum section: electronics / beginners

author: Rick Law
author_rank: Super Contributor
timestamp: July 19, 2013, 01:47:10 am
content: Gentlemen, I know reducing noise in a circuit is both a deep science and an art when done well. I am not trained in EE, so I don't even know the first thing about noise reduction. I am about totransfer a working circuit from a breadboard to a PCB. I would appreciate any "make sure you do..." and "make sure you don't..." that you can share.The circuit is not a complex one, just voltage divider, OpAmp gain control resistors, a home-made Arduino-UNO, and two voltage regulators.(1) First OpAmp (from aquad OpAmp) with3 resisters(A,B, & C) as voltage divider. A 2P3T switch controls whether the divider is zero/(A+B+C), A/(A+B+C), or (A+B)/(A+B+C) andthe divider feeds the OpAmp+. The other pole of the2p3Tis +5V connected to 3 indicator LEDs depending showing which one of the three selection is made.(2) Second OpAmp from the quad is connected same as #1(3) Third OpAmp is connected asnon-inverting amplifier(directly from V in) with a 2P3T controlling 3 resistors for Rf and Rg: zero/(A+B+C), A/(B+C), (A+B) /C. Second pole connects to +5V LED indicators depending on throw.(4) Forth OpAmp same as #3.(5) The four OpAmp output goes to the ATMega ADC0, ADC1, ADC2, ADC3.(6) On the LED indicator side of the 2P3T, the last two throw of the +5 goes to the indicator LED and the ATMega digital lines to tell the ATMega what the selection of the dividers/amplifiers settings.(6) TheATMega328 is "plain vanilla"like as shown in "bread boarding an Ardunio UNO" in the Arduino site, and with an FT232RL breakout board that is slightly different. It is connected to an "off-board" I2C lcd display. The homemade Ardunio is already on a PCB, but I plan to put the same similar circuit on this new PCB.(7)Two voltage regulators. An7805 (or LS7805since 100ma seem adequate) with 100nF pre and 100nF post caps for the home-made Arduino part and the LED indicators. AnLM317L-N(100mA) with 100nF pre-post caps and a trim pot to give the OpAmp 6.5V-ish. It is trimmed to give full 5V output by the OpAmp.I plan to use a prototyping board with 1/10 inch spacing holes and copper pad for each hole (not the strip kind). I will need toreserve a 6 holes by 15 holes space for the FT232breakout board.This circuit worked rather well for my voltage logging. I want to keep it around since I will likely log again. However, I do know that it is noise sensitive. Every other day (or so), the board get into some slight oscillation in the single digit mV range. It worked well enough that I want to keep it around, but I know the less noise I introduce the better.I did not learn much EE while in college. So, I at best I am not good. If you would share your rule of thumbs, your top-few do's and don'ts before I commit this to a PCB. I would appreciate it.Thanks!!Rick

author: lgbeno
author_rank: Frequent Contributor
timestamp: July 19, 2013, 03:05:08 am
content: Make sure that you don't leave the inputs if any opamps floating. Also add adequate decoupling caps between the power rails.That would be a decent start.

author: c4757p
author_rank: Super Contributor
timestamp: July 19, 2013, 03:14:45 am
content: It's not hard to goof up and make a fast op amp oscillate - especially not on a breadboard. Add a feedback capacitor from output to inverting input, selected to slow it down to no faster than your circuit requires.

author: Rerouter
author_rank: Super Contributor
timestamp: July 19, 2013, 03:28:13 am
content: to better clarify the above poster the value would be in the high pF to low nF depending on how slow you can run it while not undermining its purpose,

author: Rick Law
author_rank: Super Contributor
timestamp: July 20, 2013, 02:23:44 am
content: Thank you all, guys, I will give those a try.

author: Odysseus
author_rank: Regular Contributor
timestamp: July 20, 2013, 06:56:40 am
content: Here's some good bedtime reading:www.ti.com/lit/ml/sloa082/sloa082.pdf?As a rule of thumb, I try to avoid using resistances above 10K if I'm building an audio circuit. I can start to hear noise from impedances around 100K if I use my earbuds.

author: fcb
author_rank: Super Contributor
timestamp: July 20, 2013, 11:50:54 am
content: Best to draw up a schematic and post that for constructive comments before layout. We can then highlight the areas you'll need to pay attention to.

author: Rick Law
author_rank: Super Contributor
timestamp: July 20, 2013, 07:23:35 pm
content: Quote from: fcb on July 20, 2013, 11:50:54 amYeah, I had it drawn up but it was so simple I thought you guys may find it a waste of time to look at a simple voltage divider. But, it does make it clearer.Figure 1 - the input part(one of two identical pairs), a quad opamp with four 2p3t switch. 2 OpAmps are direct followers as buffer between the voltage divider and ADC; 2 OpAmps as multiplier for low voltage measurements.Note1: There are four LED indicator circuit one for each 2P3T switch.Note2: I am still playing around with what resistor values I want to use since after committing to PCB, it would be harder to change. Currently:For the 2 OpAmps using Divider, resistors are 8.2K+2K+2K for volt measurement- 1/1 : when connected into top of resistor series. So OpAmp+ input is tie to ground with 12.2K- 1/3 : 8.2K+4K = 4/12.2 = 1/3.05- 1/6 : 10.2K+2K for = 2/12.2 = 1/6.1For the 2 OpAmps as Multiplier, resistors are 11K,10K,1K (for mV across 1or 0.1ohm shunt)- follower (at top of resistor series) OpAmp out direct to Inverted Input AND tie to ground with 22K- 2x: 1+(11/(10+1))=2X- 22x: 1+((10+11)/1)=22X.Figure 2 - the OpAmp power supply(which I am considering using a 100mA LM317LN since I have not seen it drawn over 60mA).Figure 3 - the 5v power for ATMega328 and LEDwhich is also connected to ATMega digial line inputIdid not draw the ATMega part- bare bone straight off breadboarding the Ardunio. ATMega, crystal+caps, LED+resistor at D13, FT232 breakout board. I added a 220nF at the 5V power input and a power-on LED otherwise it is bare bone.Thanks for the input.I can live with the small oscillation. My big questions as I begin the layout are:(1) would it be wise to use a small PCB (short connection) and try to squeeze everything on to a 18x24 holes (2inch by 2.5inch) prototyping board -- or to spread it out to a 3x4.5 inch board with better separation between the two power supplies, the input, and the AT Mega.(2) my gut feel is the 2p3t switches and the OpAmp should be close by. They switches the divider for OpAmp input, or switch the feedback resistors in the OpAmp feedback circuit. That would mean the LED indicators (which also connects to ATMega to digital lines) are also near the OpAmp. I am not they are noise generators.(3) The OpAmp-out (no long low mV but low V) may not be as sensitive to noise as OpAmp-in since it is already amplified. Would it be wise to keep the ATMega too close since it may cause noise for the OpAmp input part to pick up. On the other hand, if I separate it, the input connection to ADC is longer giving it more of a chance to pick up noise. So, what should it be... That I found hard to experiment, and once committed to solder, hard to change.Thanks for your suggestions!

author: c4757p
author_rank: Super Contributor
timestamp: July 20, 2013, 07:52:54 pm
content: Careful with that power supply. LM317 has a minimum current of 10mA, and even the datasheet-recommended 240 ohm resistor doesn't meet that (the diagrams are improperly coped from the LM117, which has a lower minimum). Then you've increased it even more to 470. It's not just a theoretical minimum, I've seen them throw tantrums if you don't draw the minimum current.Quote from: Rick Law on July 20, 2013, 07:23:35 pm1) No reason to spread it out too far, just watch your grounding and signal traces. If you can make it compact without sacrificing proper layout, go for it.2) If the circuit is laid out exactly like this, then yes, they should be close. If you can live with a slower response, decouple the signal coming from the switch with a small capacitor (to the op amp output on the multiplier and to ground on the divider) and then you can move them farther away. The LEDsmaygenerate a bit of noise, but a capacitor should fix that.3) The signal at the op amp output is quite low impedance and shouldn't be too susceptible to noise pickup. Don't put it a mile from the ADC and you'll be fine.

author: Rick Law
author_rank: Super Contributor
timestamp: July 20, 2013, 09:29:56 pm
content: Quote from: c4757p on July 20, 2013, 07:52:54 pmHey!!! Good you point that out!When I first connected it, at the time I knew it was a LM117 diagram instead of LM317 I am using. I used the pot and the resistor I had at hand and I was going to change that later. I totally forgot about that until you point that out again!! Thanks!Yeah, I can live with a slower circuit. During earlier experimentation, I added a 100nF from OpAmp+ to ground cut the noise some but I lost confidence. During the playing around, under some circumstances (I think I was going really low mV at the time, and also tried much larger caps), the OpAmp+ voltage continue to increase slowly. Thinking that it was the charge building up slowly, I added a 100K resistor in parallel with the 100nF capacitor between OpAmp+ and ground and that stopped the cap from building. But I was no longer confident about that being the right thing. With your suggestion, I am putting that 100nF back in.

author: Rick Law
author_rank: Super Contributor
timestamp: July 31, 2013, 07:17:06 am
content: I found the main source(s) of the occasional noise...(1)A particular wall wart. When I have that particular one ON, I see 6mV(ish) 60Hz signal on my input even when I was as far as half to one meter away. (Possibly even longer distances but my cables wont reach)Initially, I was looking at the noise with my DMM. The output appears to be oscillating slowly looking like a 1Hz to 3Hz cycle, so I was hunting for and trying to solve something really slow. It was so slow I never thought of looking at it with my cheapo USB scope. I hook the USB Scope up today thinking "ah, let me see how this noise looks" - and I saw a a matching 60Hz 6mV sine wave going in (to the OpAmp) resulting in an oscillating output when my input is in the low mV range.I think the DMM's was acting like a slow scope doing "equivalent time sampling" but shifted more than enough (X cycles plus a bit) at each sampling point making it look like a 1Hz to 3Hz almost sinusoidal signal.I suppose you experience folks should have a good laugh! (I did). You would probably not be so easily tricked as I was, and main-AC noise would probably be the first few things you think of. I was convinced it came from my power supply. I even tried running it on batteries. But it was something not even related to this circuit. Just a wall wart powering my extra light! After running my circuit on batteries and solved nothing,I didn't even think of checking for 60Hz or how the noise looked until today! Dumb.(2)When my homemade Arduino is under-volt (via the USB), my 78L05 which on my breadboard is to (a) provide AREF and (b) power a few LED indicator; it turned into supplying power for the Mega328 when the USB is under-volt. AREF jumper became my power cable... The 78L05 was over drawn exceeding 100mA into 150mA range. Interestingly, it created a pair of pulses matching a certain amplitude of the 60Hz sine wave noise one on the rise and one on the fall. The 78L05 was too hot to touch. I am not sure why the 78L05 put out the pluses, but it did. This turned my smaller noise into bigger one. (Lucky I noticed the heat as I passed my hand near there. I would not have suspect anything wrong there otherwise.)Now I have to check if I shorted AREF and V+ by mistake when I made this homemade Arduino, or is that the way the AT Mega 328 works (since I have V+ to AT Mega and V+ to ATMega's ADC shorted so ADC draws the same power as the rest of the ATMega 328, that may also make a path between AREF to V+ even if externally I have AREF separated from V+). Checking would be an easy task except I glued a piece of plastic to the back of my prototyping board - the plastic is so I can lay my "Arduino" down on the less clean part of my table where I do soldering - and possibly laying on top of dropped solder I missed.Either way, this part of the fix is easy. I already planned to draw from a 1.5A 7805 for my ATMega part of the circuit instead of drawing power from USB for my final board; so USB power problem is not a concern.While from a $ standpoint, I spend much more than it is worth trying to turn my "run-once volt logger" to be generic and more flexible, this has been educational...