0

schematic

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.

schematic

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

mScientist
  • 125
  • 8
  • 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
  • 2
    Your diagram is so confused, it's hard to know where to begin. First, start by reading [Rules and guidelines for drawing good schematics](http://electronics.stackexchange.com/a/28255/11683). 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: http://playwithrobots.com/dc-motor-driver-circuits/ – Avid Pro Tool May 31 '18 at 22:11
  • The transistor emitters (the pin with the arrowhead) must be connected to your microcontroller Ground. You have no power connection shown in the circuit with Q2 and the relay coils, so that part can't work. – Peter Bennett May 31 '18 at 22:54
  • Thanks Peter, I will give that a shot. Thanks for the link Avid Pro Tool. I have the motor stuff working without the transistors, it is just the microcontroller controlling the transistors that is the problem (of course, along with all the microcontroller protection that needs to be added) – mScientist May 31 '18 at 23:27
  • It almost looks like you're trying to enter the konami code with your grounds there! The convention is that the ground symbol should always point downward. – Hearth May 31 '18 at 23:38
  • My bad peter, the coils on the relay is a 12v loop, I just forgot to add the 12v supply in the schematic. I was hoping to use the same 12v supply for the relays that I was going to use for the motor. – mScientist May 31 '18 at 23:39
  • Yeah Felthry, I was running out of room and that was the first time I have used the schematic builder. I was hired for one job (programming) and ended up being thrown into their electronics stuff which I have having to get a crash course in. I'm currently looking for a good free online course I could jump into. – mScientist May 31 '18 at 23:42
  • You can use the mousewheel to zoom in the schematic editor on here. – Hearth May 31 '18 at 23:44
  • you should google "mosfet as a switch" if you want to control DC with a lower voltage. – dandavis Jun 01 '18 at 09:06

1 Answers1

2

wire up something like this

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

schematic

simulate this circuit – Schematic created using CircuitLab

jsotola
  • 2,497
  • 2
  • 12
  • 21
  • Beautiful! 1234 – winny Jun 01 '18 at 06: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 04 '18 at 15:01
  • yes, the 2n2222 should be able to handle up to 500mA – jsotola Jun 04 '18 at 22:28