I am trying to control some 5v stepper motor driver inputs using GPIO. I found this helpful tutorial and was able to get it working (scroll to the last post where he's got it rigged up to a breadboard with transistors, etc, with pictures):
However-- I don't understand WHY it works. Or at least, I think I might, but my recollection of NPN transistors is that the collector is always set to ground and the switch helps complete the circuit. Like, using an LED on the collector with a 5v supply and using the 3.3v supply on the base, it allow sthe LED to turn on by giving access to ground when turned 'on' by the GPIO.
However, when you connect 5v from the RPi to the + leads on the motor controller, and then use the transistor as a switch to the negative side, I'm having trouble figuring out how that is the same thing-- is the circuit inside the stepper motor basically like an LED in that all we are doing is supplying access to ground to get them to turn on?
edit: to clarify
Is this correct: versus using the 3.3v GPIO pins to control the + inputs of the stepper motor directly and connecting the - inputs to ground, since it has insufficient voltage, instead we are using the constant 5v source from the pi and controlling the switch on the negative side, supplying access to ground to complete the circuit by using GPIO pins as a switch to a transistor?