Always having issues with noise

Steve2381

Senior Member
Hey all.

I have a complicated circuit. Basics... 40x2 running a Max7219. This Multiplexes 60 leds inside illuminated buttons.
I have tried to keep the MAX7219 near the IC, but it wasn't possible to have it on the same PCB. So its about 10" away, with its data lines run in a screened cable.

As the leds are spread over a control panel. obviously the outputs of the Max7219 are wired over a larger area. However I don't think that particularly causes an issue (well I hope not).

I always seem to run into trouble with supply noise. The Max7219 is randomly either illuminating all the leds, or sometimes they drop out. Other times they work fine.
The entire panel worked fine for weeks on the bench (off a dedicated bench supply), but now its playing up once installed.

There was a HC-05 bluetooth module in circuit, and they are notoriously noisy so I have removed that for now.
I am running the project off a new 70w computer PSU. I thought that would give me a nice high quality supply. Apparently not. It is showing a nice 5.12v consistently.

Got the usual 0.1uf and 100uf across the chips. What else can I do? I am pretty sure its supply noise or noise on the data lines.

Is there any way of protecting the data lines = CLK, DIN and LOAD? Can any of these be pulled high/low? Would that help?

I also considered ferrite beads, but I believe you need to work out the correct value, and I don't have a scope.

Any suggestions would be immensely appreciated.
 

wayne_weedon

New Member
Switch Mode PSUs can be quite noisy. A ferrite might cure it. Last year I built a data logger using an *rduino for my Colleges Greenpower race car it has an I2C LCD display on a cable about 4 feet long. It was ok on the bench but in the car the Microcontroller would random reset when the motor was turned on or off! A Ferrite stolen from a broken usb lead cured the issue with just one wrap of the cable though it.

Had other issues with noise when using cheap buck converters, especially corruption when writing to SD cards. Those had to be mounted a fair way away from the Microcontroller.

Wayne..
 

The bear

Senior Member
The usual reply to noise (Power supply), is to power your devices with batteries, that will hopefully remove the noise problem.
If that cures your problem, then you can concentrate on improving your power source.

Regards, bear..
 

tmfkam

Senior Member
I found a hex Schmitt trigger buffer/inverter connected inline with all the Clock, Data, CS lines - wired so that each of the lines has two buffer/inverters (so as to "invert" the invertion) reduced the niose picked up on my remote wiring from a controller board to a remote display connected through around 2m of ribbon cable through a machine with three motors and a large solenoid all powered using PWM.

I initially did this to standardise a design that required the data line to be inverted for some display types, but not for other types. Simply omitting one of the buffer/inverter stages for the data line allows the same PCB to be used and the schmitt triggers reduce noise pickup enormously.
 

oracacle

Senior Member
without knowing more about the circuit it is difficult to say.
The closest I have come to this sort of issue is with a project I am currently working on. It has an amplified analogue sensor which operates fine until the contrast of the display is altered. The amplifier then picks up the noise on the power rail and causes the system to think that there has been a change of state on the sensor. I could have used a huge array of capacitors to get around the problem (talking 2000uf+). The simpler solution in the end was to have separate regulators for each part of the circuit. it maybe worth knocking up some breakout power boards, take the power from the 12v line of the PSU and power each board separately, make sure there is a shared ground - the ground should be shared in the PSU but in maybe worth while connected the grounds of the boards together anyway.
 

Steve2381

Senior Member
Hmmm
Not possible to run it off batteries, far too much stuff going on.
Thing that is annoying is its all nicely installed now. It was fully prototyped on the huge breadboard and it worked lovely.
Transferred each part of the circuit over to pcb's and tried them off the breadboard... fine.
Install it all and it fails. Nothing worse than undoing a tidy install.
I thought the computer PSU would be a lovely clean supply, but perhaps its not. Really must save and get a scope.
I will have to play about and see if I can make any progress.
I did find some inline ferrite beads on Ebay... at 99p, it can't hurt to try em
 

hippy

Technical Support
Staff member
How are you driving the clock and data lines - bit-banged, HSPI ?

It could be that the time between setting data and clocking that to the display is a bit too marginal.
 

Buzby

Senior Member
... Not possible to run it off batteries, far too much stuff going on. ...
I think the intention was to temporarily run off batteries, just to test if it was PSU problems or not.
... Really must save and get a scope ...
Yep, can't argue with that. Plenty on eBay. Old Skool CRT monsters, single-board LCD scopes, shiny new proper kit, the choice is yours.
 

Buzby

Senior Member
An affordable 'scope. ... Regards, bear..
I'm sorry, but I wouldn't recommend anything that needs a seperate display.
I've got a few scopes, including that picaxe scope, a similar one with an onboard OLED, and a 'proper' scope.

The OLED one is permanently powered on my breadboard, the proper one get powered up when I need it, and the pixaxe one stays in the drawer.
It's just too much hassle to power it up, find the app on the PC, juggle windows onscreen, all the time wondering if there is some USB or ground loop issue likely to spring up.

A seperatley powered, self contained one is the minimum I would suggest.
 

mikeyBoo

Senior Member
A very old noise reduction method used in industrial drive panels:
One of the easiest (also cheapest) methods for noise reduction is twisted wire pairs. e.g. if you have a frequency signal & common, twist them together. For a power supply distribution each pair (usually red & black wires) should be twisted. Wires can be twisted "to perfection" using the following simple method:
01 cut 2 wires to equal length
02 clamp wire ends in a vise
03 put other two ends of wire in a drill chuck
04 twist 'em up using a drill while keeping the wires pulled fairly straight
05 that's all
 

Steve2381

Senior Member
Hey all
I have that scope kit... don't get on with it. Proper scope is on the shopping list.

I have made progress....

All my supply lines are twisted anyway... I always do that with a drill anyway for the sake of neatness.

I had a huge pile of VGA leads, so I robbed a couple of ferrites off those. Put one on the power supply cables.... not much difference, but then fitted one on the 3 core screened comms cable to the MAX7219 (DIN, CLK and LOAD) and instantly fixed it.
I also tied all three comms lines high with 10k's... just to see what happened. It didn't stop it working, so I have left those in (I know they are not really required). Its worked fine now all evening.

Only other thing I have noticed is when the power supply is off (no 0v on the enable lead), I occasionally get a blip of power that illuminates all my LCD displays for a few seconds when all is off.
Not sure what the heck that is.
I will stick a pull-up on the PSU enable line tomorrow and see if that helps (doubt it!).

Thanks all
 

rq3

Senior Member
Hmmm
Not possible to run it off batteries, far too much stuff going on.
Thing that is annoying is its all nicely installed now. It was fully prototyped on the huge breadboard and it worked lovely.
Transferred each part of the circuit over to pcb's and tried them off the breadboard... fine.
Install it all and it fails. Nothing worse than undoing a tidy install.
I thought the computer PSU would be a lovely clean supply, but perhaps its not. Really must save and get a scope.
I will have to play about and see if I can make any progress.
I did find some inline ferrite beads on Ebay... at 99p, it can't hurt to try em
Modern computer power supplies are NASTY. They are variable frequency switching supplies. They are noisy. They are inaccurate. They are unstable. They are built to the minimum requirements needed to power a heavily decoupled motherboard, and usually (read always) need some minimum current draw on one or more outputs to establish and maintain regulation for each and every voltage. Trying to determine WHICH output(s) needs a particular required load is an exercise in futility, since the manufacturer usually won't tell you, since they are built to power particular motherboards, and not your ad hoc circuit.

In my not so humble opinion, using a computer power supply is the best way to drive yourself up the wall when trying to develop and/or debug a new circuit of ANY kind, digital or analog.

For developing/debugging, use batteries, or build/buy a clean LINEAR regulated power supply with massive decoupling. Even better, run a clean linear regulator from batteries!

Once you have your circuit reliably operating, THEN you can try running it on your computer power supply, your automobile charging system, your solar charging system, or your DIY fusion reactor. When your circuit fails, THEN you can address ground loops, power and ground planes on the circuit layout, reactive mismatch leading to regulator oscillation, etc.

I know that computer power supplies are cheap. I know they are readily available. I know that 90% of the time they won't do what you think they do, unless they are installed in a particular computer. Only a good oscilloscope can show you what a computer power supply is really doing, so why bother? Are you trying to troubleshoot your power supply, or your Picaxe? Eliminate the computer power supply, and you have eliminated half of your problem.

In short, build and debug your circuit on a KNOWN CLEAN supply. If it will then run on a computer supply, your design MAY be OK. The converse is not necessarily true.
 
Last edited:

newplumber

Senior Member
I know that computer power supplies are cheap. I know they are readily available. I know that 90% of the time they won't do what you think they do, unless they are installed in a particular computer. Only a good oscilloscope can show you what a computer power supply is really doing, so why bother? Are you trying to troubleshoot your power supply, or your Picaxe? Eliminate the computer power supply, and you have eliminated half of your problem.
Hey RQ3 up here in North Dakota computer power supplies work fine ...must be that we are to cold to know what a good power supply is :)
but it good info you wrote ...maybe someday when I build some complicated bus/comms project I'll keep it in mind
 

MFB

Senior Member
Grounding problems?

Unless I missed something in the above comments, the most common source of system noise has not been mentioned. Even a perfect power supply will not reduce noise if the ground wiring layout is at fault. Which all depends on your definition of 'ground'. You may well be able to measure a stable voltage at the output terminal of the power supply but, for example, your microcontroller may see something quite different when sharing a common track/wire with current that is being switched into a bank of LEDs. Without a reliable ground no amount of decoupling capacitors will help.

Fortunately there are many approaches to reducing this problem. The brute force one being to run separate tracks/wires from different sub circuits directly to the power supply ground terminal, but a more elegant approach is to consider likely current paths and layout the ground wiring to reduce interaction between components. However, for high current circuitry the best way to eliminate common ground problems maybe to physically isolate them with opto-couplers.
 

Steve2381

Senior Member
Well we are running OK at the moment.
I never even considered the fact that a computer PSU would be a rubbish supply. Its not a cheap one, but hey ho...

One thing that is annoying is this random power 'blip'. Just every so often and randomly, the LCD's illuminate for a few milliseconds. Trouble is, I can't tie the 0v enable pin high (if that would even make a difference), as there is no high to tie it to until the PSU is on.
Hmmm

I will continue playing and maybe at the end of the project, I will drop the computer PSU out and install something better.
 

inglewoodpete

Senior Member
Disconnect one end of the shield in the interconnecting cable, if not done already. Otherwise, each switching LED will induce noise into the signalling wires. There should be no daisy-chained ground feeds, so run a good earth wire from each board to the power supply.
 
Last edited:

Steve2381

Senior Member
I have 5v, 12v and 0v boards made up to give me connection 'buses' where I need them. Each of these boards has a decoupling arrangement on it.
Then, separate feeds run out to individual boards, which each have their own decoupling on-board near the IC's.
All screened cables are only connected to ground at the start of the cable.

The only issue I am now having is noise on some of my return signal lines from my switches to my 23016 I/O expanders. They are reading switch inputs and the switches furthest away from the PCB are still picking up a bit of random noise and triggered inputs.
Not sure what I can do about that yet.
They are held low with a 10k at the switch end. Maybe move that pull-down nearer the IC? Otherwise its a big pile of unsoldering and running them through another ferrite coil or two.
 

Steve2381

Senior Member
Don't like resurrecting threads after a while, but also seems pointless starting another one about the same thing.

This PSU is noisy and has to go. I noticed tonight that when I use my Dremel on the other side of the workshop, the PSU enable pin is picking up the interference and trying to start the PSU (the Arduino power blips briefly).
All the secondary circuitry is smoothed with caps to within an inch of its life.

I have a huge pile of 7812 and 7805 regulators here.
Any reason I could not get a decent couple of 15v transformers (which I know I have somewhere).... bung the output through a 10A bridge rectifier (only because I have some).... and then parallel the outputs of half a dozen 7805's together to provide a 5v 6A supply?
Obviously each 7805 would have the usual caps either side.

Can you parallel 7805's together to increase the load capacity?

I would also do the same with the 7812's.
Only other item I would need to address is making my own 0v triggered enable system somehow.

Just wondered if the resulting home made PSU would act any better than my computer supply I have here.

OK... Edit to the post. No appears to be the answer.
Looks like the outputs are too unbalanced for it to work correctly. Farnell here I come
 

Steve2381

Senior Member
I have paralleled like that, but I had to place low value series resistors in the outputs. Worked fine.

However you can pickup very good power supplies off eBay.

EDIT: https://www.ebay.com/itm/AC-110V-220V-TO-DC-5V-12V-24V-Switch-Power-Supply-Driver-Adapter-LED-Strip-Light/322482005085?ssPageName=STRK:MEBIDX:IT&_trksid=p2057872.m2749.l2649

But are these not switched mode PSU's? I am suffering noise and these probably are noisy too.

I found a 230v/15v 200VA transformer in the workshop. How do I calculate the potential amperage available from that? Not up to speed on my transformer calcs.
Annoyingly, there doesn't appear to be much in the way of voltage regulators in the 5A range... the only one on Farnell is madly expensive (£50+).

Adding resistors to the outputs will degrade my voltage, and not too happy with the potential for huge heat loss either.... but not sure where to head from here.
Ideally.. I would find a solution for this noisy computer PSU. It's going to be a right pain to remove now.

The power blipping on the computer PSU (The 0v power enable). Any ideas how I can cure that? I can't tie that 0v trigger line high, as I don't have a high?
Actually... thinking about it, one of the other spare cables from the PSU that I am not using might be a constant supply. I will check.
 

Circuit

Senior Member
Annoyingly, there doesn't appear to be much in the way of voltage regulators in the 5A range... the only one on Farnell is madly expensive (£50+).
How about the Texas Instruments LM338T adjustable 3 terminal positive voltage regulator? States as "capable of supplying in excess of 5A over a 1.2V to 32V output range. " 5 Amp output; 7amp peak. http://www.ti.com/lit/ds/symlink/lm138.pdf. Seems to be around £2.00 inc VAT with most suppliers.

Further quote from the datasheet; "A unique feature of the LM138 family is time dependent current limiting. The current limit circuitry allows peak currents of up to 12 A to be drawn from the regulator for short periods of time. This allows the LM138 to be used with heavy transient loads and speeds start-up under full-load conditions. Under sustained loading conditions, the current limit decreases to a safe value protecting the regulator. Also included on the chip are thermal overload protection and safe area protection for the power transistor. Overload protection remains functional even if the adjustment (ADJ) pin is accidentally disconnected."

This seems to fit the bill?
 

techElder

Well-known member
I don't understand your noise comment about switch mode power supplies. A PC intended PS is expecting filters on the motherboard. Every piece of electronics built today starts with a switch mode PS.
 

Steve2381

Senior Member
OK. I REALLY don't want to remove this computer PSU, as it built in the heart of my project.
But... how do I smooth the supply then? If someone can point me in the right direction regarding smoothing a switched mode PSU output, then I would be grateful.

Each of the 12v and 5v outputs of this computer PSU run to a bus board that has 10uf and 0.1uf caps on for each output. I found 10uf elect more effective than higher values. Would I be better adding other values too?
All my data lines run through ferrite coils, and so does the supply to the Picaxe 40x2. All supply lines are twisted.
Most of my return signal lines to the processor have 0.1uf caps on them down to ground which cured some noise on those lines.

If you turn a heater on, start the Dremel (20 foot away), switch on a light.... the PSU blips the power on momentarily. I tried tying the 0v PSU enable line high with a 10k to the purple constant 5v line of the PSU (its 5v all the time its got 230v)... but that did not cure it.

That LM338T.... interesting. Might investigate those.
 

hippy

Technical Support
Staff member
I found a 230v/15v 200VA transformer in the workshop. How do I calculate the potential amperage available from that?
Notionally; 200VA means V*I = 200, so 200V at 1A or 15V at 13A.


The power blipping on the computer PSU (The 0v power enable). Any ideas how I can cure that? I can't tie that 0v trigger line high, as I don't have a high?
Not exactly sure what you mean by that.

Most ATX supplies will have a "Power On/Enable" input, which needs to be shorted to 0V to enable the main 5V, 12V etc voltages to be output.

Some ATX supplies will require a minimum load before they will power up. There might also be some odd behaviour if the current drops once powered-up. Perhaps that's what you are seeing ?
 

Steve2381

Senior Member
Hmm.. I have a pretty hefty load on the PSU. Don't think its that. Must be 4A of leds alone on the 12v supply.
The Power on/enable input of the PSU (green wire) is enabled with a toggle switch that puts it to ground to power the unit up (through a diode to prevent backfeed from other parts of the power circuit).
Once the Picaxe powers up, it switches on a TIP122 that via a diode, applies ground to the green wire on the power supply module. Effectively shorting out the toggle switch.
This prevents shutting down the Picaxe mid-program if you turned off the toggle switch during the running code.
Another pin of the Picaxe monitors the low output of the switch (its low while its on). Again, a diode ensures it doesn't read the backfed 0v from the PSU.
If it sees the toggle switch has been turned off (pulled high), then it starts the Picaxe into a shutdown routine that turns everything off 'nicely'. Then, its final action is to turn off the TIP122 which drops out the computer PSU.
Make sense? It does all work well.

My only other thought is the wire from the enable connection on the computer PSU is about 400mm long. Could it be picking up interference?
Like I mentioned, operating anything electrically noisy in the workshop makes the PSU blip the power on for a few milliseconds (enough to illuminate the LCD's etc).
 

BeanieBots

Moderator
.. the enable connection on the computer PSU is about 400mm long. Could it be picking up interference? ...
QUOTE]

Absolutely. An input with an aerial connected to it.
The art of fixing noise issues is first to identify the source and then take steps to either stop it being produced or reduce sensitivity to it.
Switching inductive loads appears to be the source. PC supplies will already have good noise immunity on the mains input, so it is unlikely to be coming in that way. The other route is airborne radiation. Your problems started when you fitted longer leads which makes your circuit more sensitive to airborne noise.
Unless there is any need for very fast response, consider putting caps on the enable line that is giving you problems. (eg 100nF)
Also, you mention a few lines driven via diodes. These might need pull-ups as well.
The ferrites which you fitted are probably helping by preventing airborne noise getting into your system but this is a very complex area and if fitted to the wrong end of the cable can make things worse. The same is true for screened cable. Which end of the cable has the screen connected can determine if things improve or get worse. Connecting both ends usually makes things worse. Using the screen to carry heavy currents, especially PWM power, will inject noise straight into the data cables.
Is the 12v line of your PSU really rated to >4A? There's not often much load on 12v in a PC and the PSU usually has a rating of around 1A even for the 500W versions.
 

joeygbsn

New Member
Is the 12v line of your PSU really rated to >4A? There's not often much load on 12v in a PC and the PSU usually has a rating of around 1A even for the 500W versions.
Not sure what you mean but in my experience the 12v rail is usually rated to near the full advertised wattage. My 750w PSUs 12v rail is rated to 62A which is 744w. Maybe you are looking at the -12v rail as mine is only rated for half an amp and most seem to be rated around 1A.

https://www.evga.com/products/product.aspx?pn=110-b2-0750-vr
 

hippy

Technical Support
Staff member
My 750w PSUs 12v rail is rated to 62A which is 744w.
I must admit that surprised me, 12V being 2.5 times the 5V current, 5V and 3V3 both being 24A. The small 220W PSU I have to hand is 5V 17A, 12V 12A, 3V3 3A. I guess it depends on exactly what the PSU is expected to supply, motherboard, video cards, disks and other peripherals.
 

joeygbsn

New Member
I must admit that surprised me, 12V being 2.5 times the 5V current, 5V and 3V3 both being 24A. The small 220W PSU I have to hand is 5V 17A, 12V 12A, 3V3 3A. I guess it depends on exactly what the PSU is expected to supply, motherboard, video cards, disks and other peripherals.
Yeah it seems like around 100w between the 5v and 3v3 is about standard and the 12v rail is the only one that really scales up as you get to heftier psus. Probably because the cpu and gpu connectors are both 12v and those are power hungry components. I guess this is getting a bit off topic though. I don't have much experience using ATX psus outside of a pc.
 

eggdweather

Senior Member
I think 100uF is no where near enough to remove switching perturbations from the supply line, it worked OK on a bench power supply, so IMO this should be your first modification.

You can calculate the required capacitor value like this:

The power supply charge Q (in Coulombs) required from the capacitor is Q=I*t, where I is current and t is time.

Also, Q = C*ΔV, where C is the capacitance and ΔV is the voltage drop as current flows out to the load.

So C*ΔV = Q = I*t and rearranging for C gives C = I*t/ΔV

For a 1A load and allowing no-more than 0.2v drop in voltage for no more than 0.05-sec:

C = 1 * 0.05/0.2 = 0.25F = 250,000uF

Your bench power supply is likely to have some larges value C's and the regulator itself will provide and effective increase in this value through its ability to regulate.
 

hippy

Technical Support
Staff member
If you turn a heater on, start the Dremel (20 foot away), switch on a light.... the PSU blips the power on momentarily.
Having come back to the thread and re-reading that, its seems we are possibly conflating two separate issues; power supply rail stability when the PSU is running ("noise"), and false-start-up while things are powered off ("glitch").

It may be worth restating precisely what the issues are, because I can't see how adding supply smoothing will solve any false start-up issues.

I wouldn't expect a PC PSU to be that sensitive to pick-up on its enable lines, but perhaps this one is. You really need to separate the PSU from the rest and assess its behaviour separately to identify what the issue may be and determine how to solve it.

It could perhaps be an issue with what you have connected to the enable line. As I said earlier I couldn't understand talk of adding pull-ups. Perhaps post a circuit diagram and you could try cutting the enable line close to the PSU if you don't want to remove the PSU, disconnect it from existing circuity and see if it exhibits better behaviour with a toggle switch close to the PSU. You can always rejoin the cut wire later.

That said, I recall a PC PSU which would blip the 5V rail after it had shut down. That was not a problem for me but it could have been if it were for high power LED light control.

So maybe glitches are just a 'feature' of PC PSU's, or this PSU in particular, does sometimes glitch its power rails. Glitches wouldn't matter in a PC if the system is held off until such glitches had passed or it was confirmed the supply should be on and voltages were stable.
 
Top