Maker Pro
Maker Pro

transistor switch for Motor shields

amza

May 8, 2017
1
Joined
May 8, 2017
Messages
1
Hey everybody
I'm new here and hope that I can learn new things!

I'm working on a project which I have 2 stepper motors connected to L298N and powered with 12V adapter. I'm trying to control them with Arduino mega and a simple stepper code, since I don't need them to work at the same time in final system and I have a shortage of Arduino pins, I'm trying to make a switch for them. so I can use only 4 pins for both motors (each shield use 4 arduino pins).
I tried to search on web and I found transistor switch with LEDs, I thought it's same Idea and I tried to apply it to my case with considering the 12V adapter as load instead of LED.
I was able to make 1 motor work with this switch, but I cannot adopt the Idea with 2 motors.

any ideas on where to go with this, or any other way that can help me with whole concept?

Thanks
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
You can use the enable inputs of the L298 to enable one driver for motor 1 while the other driver for motor 2 is disabled and vice versa. The enable pins can be controlled in 2 ways:
  1. Use two pins of the arduino, one pin for each driver ic (2 enabler pins per 1 driver ic).
  2. Use one pin of the arduino and an additinal inverter. Connect one driver IC directly to the arduino, the other driver ic via the inverter.
 
Top