I am having trouble having getting a motor that can move in two directions to work with my Arduino Uno. I am having trouble choosing the right transistor or mosfet combo. I could get it to work easily with a relay; however, I need this device to have low power consumption. I have spent some time on this and would appreciate any help:
Background
The motor has three wires, black for ground, red(+) for one direction, green(+)for the other direction. When 5V power is placed on the red and ground on black it moves in one direction (placing 5v on green- motor turns other way). It uses upto 1A (seems like motor uses 1 A on start and 500ma while running; 5V).
What I tried
I tried a regular NPN (2N2222) transistor, but when the ground side was activated, it didn't start as it couldn't move in two directions at one time. In other words, the green and red (each direction) had 5V. The NPN transistor was activated by the arduino, placing ground on the motor.
Tried MOSFET, but didn't know how to turn off with complementary transistor.
Tried regular PNP transistor, but didn't have enough amp capability
Question
Could anyone find me or please provide me an example of using an PNP transistor that doesn't require a NPN transistor to turn off that can be run a 1 or 2 amps? I would need to know which resistors are needed with it. If there is no such thing as this, then maybe a schematic of complementary PNP transistor (or switches with positive MOSFET)and NPN to turn off at 1 or 2 amp minimum?
Use pullup resistors on gates of p-channel and pulldown resistors on gates of n-channel to make sure they are off while '328P resets and IO pins are inputs.
Once the sketch starts up, drive the output to Off levels (high for P-channek, low for N-channel) until its time to move the motor.
Thanks for recommending the components. I am somewhat new to this. I don't know how to wire complementary transistors. Could you please email me a schematic example? About the second post, I am not sure what you mean by all the terms.
I can read and follow schematics- any examples would be great. Thx
The schematic is a little too complicated. I prefer just a single one transistor for each direction of the motor (two total). Even if it's a little more consumption to use a regular PNP transitor, that's preferred. Do you know of a regular PNP transistor that fits these requirements?
Wire as the top half of the schematic, with red & green as the two motor leads, and black to power supply gnd. Must also connect to Arduino gnd. Only pull one gate low at a time.
The pullup resistors to Vdd (+5 for you) turn them off when the Arduino is not yet driving the IO lines.
The resistor from Arduino to Gate is not critical, 220 ohm, 270, 330, something in that range.
Not sure if I follow you. You are saying that I connect the P channel Mosfet on the gate to the VDD port (labeled as 5V on the Arduino Uno) to ensure no power goes through to the motor. Is that right?
This motor will have to work very infrequently- like a few times a year. I apologize for leaving this info out; I just didn't want the initial question to be too long. Would it be better for power consumption to just use a relay (that uses 30 mah while off)?
The most ideal thing would be to have a component that takes turns on with positive voltage and then allows positive voltage to flow- like a PPP transistor. I just wanted to save power consumption. Does anything like this exist other than a relay?
Question 2. Just use 2 relays then. Relays have Normally Open and Normally Closed sets of contacts.
Connect Power to Common, and Red lead to Normally Open on one relay.
Connect Power to Common, and Green lead to Normally Open on the other relay.
When you want the motor to move, energize the relay.
The circtuit can be in power down sleep mode most of the time, wake up with an interrupt when it needs to move the motor.
There's tons of relay choices. Find one with the form factor you are after, then search within that body type a for a 5V coil with low current that the Arduino can drive directly, and the contact voltage/current rating needed. If you can't find a low coil current, add a transistor to drive the coil current. The relay only needs coil current when you want the contacts to close. Not sure what you are concerned about with lower power drain.