I need to control a linear actuator that has a stall current of 12A with an arduino. To do this I designed a circuit to the best of my ability (which isn't very great) that uses the output pins to turn on a NPN transistor that will turn on a relay. I had to use a transistor because the relay required 200mA to turn on.
Since I'm really new to this, am I missing anything?
Do I need a resistor before the transistor?
I read about a flyback diode but since I'm using a DC motor and when the relay's are off they are grounded so I thought having one wouldn't be needed.
I have not taken any circuit classes before and have never used Eagle before I made this diagram so please don't criticize me too badly.
Your using NPN transistors, the emitter leads need to wire to ground, their collector leads wire to pin 2 of their respective relay, pin one of the relays needs to wire to +12. You need the diodes across the relay coils. And yes you need series base resistors, 200-500 ohms should work OK.
Using the emitter follower configuration, your relays will never see more than the voltage at the transistor bases. As Lefty says, the relays need to be in the feed from the +12 to the collectors and you also need snubbing diodes across their coils to prevent damage to the transistors. At 12 amps your relay contacts are going to experience a bit of arcing so ensure they are conservatively rated (say 20 to 30A rating). I like the way you have configured your reverse switching, since accidentally switching on both inputs simply stops the motor. Many such circuit endeavours actually short circuit the supply in the event of switching both together.
Note that relays usually have two current ratings, one for AC and one for DC, be conservative and use the DC one!
1N4001 diodes across the relay windings are plenty sufficient, make sure they are wired cathode-to-positive. However you also need big diodes across the actuator leads themselves or you will weld your relay contacts shut in no time. These diodes need to handle 12A pulses.
An alternative to this setup us would be a pair of beefy logic-level MOSFETs like the IRL7833 (3.7milliohm at Vgs=4.5V) - these ones would just about get away without needing a heatsink at 12A.
With proper heatsinking MOSFETs with an Ron of upto 25milliohms would be OK, but they must be logic level.
With careful checking of the MOSFET specs you might find that it's built-in zener diodes are able to take the role of the flyback diodes - the key spec here is repetitive avalanche energy. Also a Vds rating of 30V is about right here - somewhat more than twice the supply voltage
I never understood MOSFETS, I get they work just like transistors but when I did a bunch of research to learn how to make my own PWM motor controller I learned that you need +5V (for logic level) relative to the voltage you are trying to turn on and off. Is this right at all? I would like to use MOSFETS because I might be turning these on and off somewhat fast (maybe every 2 seconds) but I just don't understand it, and every website contradicts another one so I cannot get any solid material to learn from.
I learned that you need +5V (for logic level) relative to the voltage you are trying to turn on and off. Is this right at all?
Depends on if you are talking about N-channel or P-channel mosfets. For standard low side switching, using N-channel ,then a logic level high (+5vdc) is all that is required to turn on the gate and saturate the source/drain path, with no concern about the switched load's voltage source value. Logic level N-channel mosfets used in low side switching is best thing going these days in my opinion.
Lefty:
What do you mean by low side switching? If I were to make a simple half-bridge to replace my relays, what could I use and how would I set it up?
magruder13:
Lefty:
What do you mean by low side switching? If I were to make a simple half-bridge to replace my relays, what could I use and how would I set it up?
Thanks!
"Low side switching" means the semiconductor, n-channel mosfet (or npn transistor), is used with a grounded source lead (or emitter lead) and the drain lead (or collector lead) is wired to the load and the other side of the load is wired to a positive voltage. It's the most common method for using transistors in simple switching applications. The gate lead (or base lead) is wired to the controller output pin (with base resistor for npn), and a common ground wire is required if the load's power supply is not from the same source as the controller.
You have a problem here. Your original design has a reversing facility and a simple low side N channel will not provide that. You are looking to switch both + and - lines and there is now a real danger of a DIY type FET build shortening out your power supply. If you want to go FET and you are not knowledgeable in such matters you might be better simply buying an H bridge which will provide both forward and reverse and will not short circuit the power supply.
jackrae:
You have a problem here. Your original design has a reversing facility and a simple low side N channel will not provide that. You are looking to switch both + and - lines and there is now a real danger of a DIY type FET build shortening out your power supply. If you want to go FET and you are not knowledgeable in such matters you might be better simply buying an H bridge which will provide both forward and reverse and will not short circuit the power supply.
I see no flaw or fatal operation mode in the relays contact side of his drawing. All four possible states result in only forward full speed, reverse full speed, or breaking. His only only flaw was in the relay coil side of his design, not using proper low side switching wiring. There are two relays and two independent contacts, with only four possible 'states'.
Perhaps you could point out the mode that would result in shorting out the +12vdc power supply?
Lefty
If you care to read my earlier posting you will see I was complimenting the relay design as being short-circuit proof. In fact I even went to the bother of giving you a mention in relation to the original emitter follower circuit. My concern was regarding a home-made FET system to perform change-over switching by an individual not yet experienced in the problems of FET circuit design.
My concern was regarding a home-made FET system to perform change-over switching by an individual not yet experienced in the problems of FET circuit design.
Sorry, my mistake then. I was responding to your:
"You have a problem here. Your original design has a reversing facility and a simple low side N channel will not provide that.",
I though we all were suggesting proper low side switching methods for the existing relay coils using either npn or n-channel mosfets, and only saw the one drawing posted in this thread. I agree that direct motor control with mosfets can lead to deadly states without careful design.
However MOSFETS having positive temperature coefficient do lend themselves to being used in parallel without the need of current 'ballast' resistors. This can have the advantage of spreading the heat dissipation across two packages rather then just one, if heat dissipation is a limitation of a specific design.
A pratical example of this is the many very high current radio control ESC modules avalible that control motors running hundreds of watts without needing a large and heavy heatsink (space and weight being important in model airplanes). They use special mosfet arrays drivers that may comprise of dozens of mosfets in parallel.
Whoops, I hadn't noticed the circuit was controlling a single load and was a relay H-bridge.
In that case there needs to be 4 diodes connected across the relay contacts to prevent severe inductive arcing (connected just like any H-bridge). And rated at 12A peak pulse.
A MOSFET H-bridge of that spec would be quite hard to design.