DC motor control via a relay - filter required?

Hi,

I've an idea for a project that will use an arduino to control a 12volt, 3amp DC motor.

My plan is to use a battery (12v) to supply both the arduino (via a 5v reg) and the DC motor. The arduino will use a 5volt relay to switch the motor on and off. I know that a motor has inductance, and switching it on and off may generate electrical noise and spikes.

My question is this - is the noise the motor may generate likely to be enough to effect the arduino? If so, do I need some sort of simple filtering, and if so whats the best way of achieving this? (diode? decoupling capacitor?)

Thanks

IMO I would use a snubbing diode across the motor coil. However, show us your proposed schematic. I would use a DC to DC switching regulator for the 12V to 5V. If you experience problems still, the try a .2uf with 100 ohm resistor also across the coil. .

Post a link for the motor specs

Why would you use a relay to turn the motor off ? (instead of a mosfet )

show us your proposed schematic.

I haven't got a full schematic just yet - I'm hoping these replies will give me some ideas before I start ordering stuff.

Post a link for the motor specs

The motor is actually inside a linear actuator, so I don't have full details of the motor itself. Here's a link to the Linear actuator on ebay.

Why would you use a relay to turn the motor off ? (instead of a mosfet )

A number of reasons (maybe not good ones, but reasons nevertheless) 1) When I google, most of the arduino/motor control circuits I get back seem to use relays. 2) A relay provides better isolation between the controlling circuit and the load (so I'm told) 3) I want to also be able to invert the polarity of the motor (to change direction), this may be easier to achieve with relays

product/250mm-stroke-12V-DC-electric-linear-actuator-solar-tracker

Continuous Current(A):0.8A-5A

When I google, most of the arduino/motor control circuits I get back seem to use relays.
2) A relay provides better isolation between the controlling circuit and the load (so I’m told)

Not true. It really depends on the motor voltage and current.
Obviously you’re not going to use a mosfet for an ac motor.
A dc motor that draws in excess of 20 A is going to be more difficult to drive with a mosfet but certainly doable.

As far as isolation, if you want electrical isolation you can use opto isolated mosfet to drive it.

Hobbyists with little or no electronics experience are prone to choose relays because they do not require any knowledge (to speak of ) of electronics.

Sparkfun sells mosfets that would drive that motor (12V@5A)

  1. I want to also be able to invert the polarity of the motor (to change direction), this may be easier to achieve with relays

Obviously you have never heard of an H-BRIDGE which is the standard way to drive bidirectional dc motors. Almost all such motors are driven by H-bridges.

H-BRIDGE DRIVER

Hobbyists with little or no electronics experience are prone to choose relays because they do not require any knowledge (to speak of ) of electronics.

Yes - that's why I chose them to, also I have lots of relays lying around in my workshop!

heard of an H-BRIDGE which is the standard way to drive bidirectional dc motors

A 'h-bridge' can be implemented as a solid-state or relay solution.

The pololu shield you link to are probably a bit of an overkill for my purposes - I guess you're paying more for PWM control of the motor - whereas I just need simple on/off/reverse functionality. I shall investigate solid state relays and MOSFETs.

Solid state relays that work with DC and mosfets are the same thing.

I implemented an h-bridge mosfet driver for an actuator using a pot and the MAP function such that midposition on the pot was midposition on the actuator and CCW on the pot lowered actuator and CW on the pot raised actuator.

Back to the original question, the output of the 5V source, be it a DC-DC converter or a linear regulator, should probably be pretty clean. The motor is liable to make a mess of the 12V, but who cares?

OK, "who cares" was a bit flippant. There are reasons to care, like running something else on the 12V that you haven't mentioned, radiated noise emissions, etc. If the answer to my flippant question is that you care, then a filter as previously suggested would be a good idea. But if the 5V is all you're concerned about, then you're probably fine. If you're worried, hook up the battery, motor, and converter/regulator, and look at the 5V on a scope.

My plan is to use a battery (12v) to supply both the arduino (via a 5v reg) and the DC motor. The arduino will use a 5volt relay to switch the motor on and off. I know that a motor has inductance, and switching it on and off may generate electrical noise and spikes.

My question is this - is the noise the motor may generate likely to be enough to effect the arduino? If so, do I need some sort of simple filtering, and if so whats the best way of achieving this? (diode? decoupling capacitor?)

It's never a good idea to run a microprocessor off the same supply that's running a motor. Even if the 5V is regulated. If the motor pulls down the unregulated 12V input of the arduino onboard 5V regulator , you are still going to have a spike on the 5V side. If it is completely impossible to have a separate supply for the arduino then you are forced to add large electrolytic filter caps (>= 470 uf) to both the unregulated 12V (preferably a 1000 uF here) and the 5V line (470 uF). In addition, you will need to add 0.1 uf decoupling caps to the 5V line as close to the arduino as possible.

But if the 5V is all you're concerned about, then you're probably fine. If you're worried, hook up the battery, motor, and converter/regulator, and look at the 5V on a scope.

Not to sound too obvious here, but would anyone who has access to an oscilloscope and also knows how to use be posting to ask if they should run a microprocessor board off a motor power supply ?

raschemmel: Not to sound too obvious here, but would anyone who has access to an oscilloscope and also knows how to use be posting to ask if they should run a microprocessor board off a motor power supply ?

Depends. Someone with access to a scope and only very basic knowledge of how to use it may not be in the habit of turning to it when he or she should. Something like this would be a good place to start.

Unless the OP is a student , taking a lab class where he has access to a scope, I rather doubt he would have a scope or access to one if he wasn't a student. I think a more logical question would be : "Do you have access to a scope ?"

Fulliautomatix: Yes - that's why I chose them to, also I have lots of relays lying around in my workshop!

This is really crazy, but you can get 2 relays with opto-isolation and drivers on a PCB for less cost than you could build your own using existing relays in your workshop.

Could search for a type that has 12V relay coils (and opto isolators) so that you could use the same power supply as the motor to energize the relays.

Interference (emissions) should not affect the Arduino as this is low voltage. Usually problems surface when switching 120VAC (or higher) inductive loads. IMHO opto isolation is always a good approach - no power rail interference and simpler to wire up (no GND connection from the relay board to the Arduino).

MOSFET H-bridge is also good ... you might want both to investigate both methods in your testing.