# turn on 12v from 2n2222a 5v source

simulate this circuit – Schematic created using CircuitLab

I am trying to be able to switch off the motor, then energize or de-energize the relay coil for a motor direction change. I can't get this to work. I am just a very beginner and am trying to learn.

simulate this circuit

But if I delete the two lines and put a "GND" it works. Is GND not the negative terminal of the 12V battery? How can I get this to work? I would like to understand and also know what kind of diode or protection for my gpio pin would be suitable for this circuit.

Thanks

• Are those your relays or can you choose DPDT? – winny May 31 '18 at 21:25
• Those are what I have on hand, they are G5LE-14 12VDC. I do have some G5V-2-H (DPDT), but I think I had too much current going through them because I've already messed up three of them. Once I understand how to read datasheets maybe I can continue to use those. – mScientist May 31 '18 at 21:30
• Your diagram is so confused, it's hard to know where to begin. First, start by reading Rules and guidelines for drawing good schematics. Second, your use of NPN transistors is completely wrong. You need to find some basic tutorials on driving loads with transistors -- there are thousands of them out there. – Dave Tweed May 31 '18 at 21:39
• As I said, I am a beginner Mr Tweed. In essence, I am trying to use a transistor to turn on the power to the motor and another one to energize or de-energize the coil in the relay. What I have found is what lead me to the current schematic, therefore I am here asking for help because undoubtedly what I have found does not work. – mScientist May 31 '18 at 21:44
• This article might help: playwithrobots.com/dc-motor-driver-circuits – Avid Pro Tool May 31 '18 at 22:11

wire up something like this

RLY1   RLY2  MOTOR
off    off   stopped
off    on    spins one way
on     off   spins other way
on     on    stopped


simulate this circuit – Schematic created using CircuitLab

• Beautiful! 1234 – winny Jun 1 '18 at 6:06
• @jsotola, If I was to change the +5v at the top of each relay to run off of 12V, would I still be able to use the same Q1 and Q2 the same way in the schematic? The coils on the relay i'm using requires at least 33ma which my GPIO can't supply. – mScientist Jun 4 '18 at 15:01
• yes, the 2n2222 should be able to handle up to 500mA – jsotola Jun 4 '18 at 22:28