Can the picaxe be shieled from interference

I am using a picaxe 28x to run a dc motor through a relay. The program logic works with the motor off but when the motor is on goes on and off and some of the outputs come on momentarily for no reason and then the program stops working all together. Is this a common problem and what could I try.

Thanks so much for all the previous help.
 

Fowkc

Senior Member
This is a fairly common problem, and as the thread title suggests, you know the problem is that when the motor starts, it creates a lot of noise on the power supply rails, which cause the PICAXE to operate incorrectly or reset.

The best way to solve this is to run the PICAXE from an entirely seperate supply to the motor.

If that's not possible, then you need as much filtering as possible to stop supply glitches reaching thr PICAXE. Start with capacitors across the motor terminals and the PICAXE supply pins. Look up "snubber circuits" on google to see how they can help.
 

womai

Senior Member
There is a variety of methods that can be used. The basic idea is of course always that the Picaxe should not see when the supply voltage collapses because the motor suddenly draws a lot of power.

(1) use a separate power supply for the Picaxe. That's a very common approach for robots. E.g. run the motor from a 12V battery pack, and the Picaxe from a separate 6V pack. Also has the advantage that you can use more powerful motors because you are no longer limited by the 5V supply that the Picaxe needs.

(2) Run both from the same pack (e.g. 12V), but use a linear regulator (e.g. 7805) to reduce the voltage for the Picaxe to 5V. Cheaper because only one battery pack is needed. Since the regulator's output voltage does not change when the input voltage changes (at least as long as the input is sufficiently higher than the output), the Picaxe does not care if the motor draws the 12V supply down to e.g. 10V.

In both cases, also provide good power decoupling, i.e. capacitors between power and ground, to buffer sudden spikes in current. At the very least a 100nF (nano-Farad) ceramic capacitor very close to the Picaxe and another one very close to the motor supply points, plus a 10 uF (micro-Farad) electrolytic capacitor for the Picaxe and a large one (1000 uF or more) for the motor. The large capacitors take care of longer spikes, but can't react very fast, the small ones take care of short spikes.

(3) quick fix if you don't have a regulator on hand AND the Picaxe does not draw more than a few mA of current: Put a 100 Ohm resistor in front of the Picaxe's power supply pin, i.e. have the power supply current for the Picaxe (not the motor) flow through this resistor. Then place a 100 uF capacitor as well as a 100nF capacitor between Picaxe power pin and ground pin (i.e. also behind the 100 Ohm resistor). The capacitors act as a reservoir whenever the supply voltage drops (when the motor draws a lot of current), and the resistor prevents the motor from sucking the capacitor empty. BTW, that's a frequently used trick in simple audio amplifiers - in this case the preamplifier stages get decoupled from the current-sucking final power amplifier stage.

Wolfgang
 
Last edited:

BeanieBots

Moderator
Good advice given by womai.
In addition, you should try to prevent the noise comming out of the motor in the first place. A further three 100nF caps mounted at the motor will help a lot. They will also reduce arcing and increase the life of the brushes.
One between the two terminals and one between each terminal and the motor casing.
 

Dippy

Moderator
All good stuff.

I wish there was a Noise and Suppression Data Sheet with all these tips and suggestions shown - these subjects crop up almost daily.

Maybe a complete TroubleShooting Data Sheet inc noise/suppression/etc and psu design.
Maybe a direct link on Forum?
 

MFB

Senior Member
Screened box & feed-thru caps

Even when you follow all the very good advice given above you may still get problems, due to electromagnetic coupling between the motor/wires (rf transmitter) and PICAXE internals (rf receiver in a plastic package).

The only sure way to overcome this type of problem is to mount the PICAXE circuit in a metal box and feed ALL the I/O and power lines via feed-thru capacitors. Filtered version of 9, 15 or 25 ‘D’ connectors are a good source of 1000pF multiple feed-thrus.
 

andrew_qld

Senior Member
Microprocessors need a nice clean suppply.

When I started using Texas Instruments TPS7150's low dropout regulators I found one day that the programing cable wouldn't recognize either of thwo Picaxe chips on my breadboard.

After much hair-tearing I found the 100uF cap had come out. Replacing it fixed the problem.
 
How do I use the feed through capacitors?

Thank you MFD for your suggestion about the isolation of the picaxe, how would I use the feed through capacitors what size and how do I hook them up. Could I use an optocoupler instead or is this not practical?

Thanks for your help.
 

MFB

Senior Member
general screening tips

Opto-couplers certainly have their place in reducing noise problems. When you need to drive a motor etc from a completely separate supply from the micro, the opto-couplers allows you to operated with the two grounds isolated. This approach is especially useful for stripboard construction because of the difficulty of achieving a good ground layout.

However, this would still leave the possibility of radiated interference. Basically, try to think of this in radio terms and apply the same screening techniques. Like enclose the low power PICAXE circuitry in a metal box (try to leave relays etc outside) and treat ALL wires entering or leaving this box as a receiving antenna. Mount a filtered ‘D’ connector on the box and pass each of the above wires, including power, thru a pin. This will typically add 1000pF between the wire and the metalwork of the enclosure, and if you use a filtered plug and socket combination this will increase to 2000pF per wire.

Assuming that you have to mount the circuitry in some form of enclosure, with connectors, this approach is not really that much of a design overhead.
 

toxicmouse

Senior Member
Good advice given by womai.
In addition, you should try to prevent the noise comming out of the motor in the first place. A further three 100nF caps mounted at the motor will help a lot. They will also reduce arcing and increase the life of the brushes.
One between the two terminals and one between each terminal and the motor casing.
why would you want to have a capacitor from each terminal to the motor casing?
 

BeanieBots

Moderator
To prevent case radiation.
Effectively grounds the case and prevents voltages building up between the rotor and the case which itelf "looks like" a capacitor.
 

evanh

Senior Member
I recently had the displeasure of fixing up a crummy PLC that was crashing out on watchdog due to interference. I've never struck anything so sensitive before. I mean the PLC is inside a fully shielded enclosure so the only possible interference was from the wiring. Also, it is running from a regulated 24 volt supply.

First I added a suppressor across the contacts of the one motor relay - didn't help. Next I replaced the relay with a SSR - didn't help. And finally I added diodes across every pneumatic solenoid valve which weren't even inside the enclosure - worked a treat. And these things only draw about 20 mA each!

I almost threw the damn thing out and bought a different brand of PLC. I guess that shows just how damaging the flyback is, even on wimpy coils. The good news is that the PLC's internal relays will last longer with the diodes in place now. :)
 
Top