I have a small dc motor I wish to control variable speed to bidirectionally. Unfortunately, all of the examples or tutorials I can find for accomplishing this either require an IC I don't have, a shield, or are powered off the Arduino itself. I have an external battery pack that is used to power the motor, and I see examples of how to control the speed of the motor using a potentiometer, but I would like to instead have this controlled by the Arduino, preferably without a digital pot, since I don't have any of those lying around right now.
I've tried searching for information on this, but my Google-Fu has failed me.
I'm wondering if I can do this via PWM to the base of an NPN transistor, if that would apply PWM also to the current running through the collector and emitter, or if I'm not understanding something properly.
But you'll have to read up on the circuit and afaik, you'll need 2 PNP and 2 NPN transistors for the bridge, as well as a bunch of other odds and ends. If you don't have that stuff lying around, and have to order parts, your life will be much simpler just buying a chip.
I did indeed have the parts for an H bridge, and I've prototyped it out on my breadboard, and this is doing exactly what I needed. Much thanks to everyone. Now to move it to to some handy perfboard, so I can keep it around.
Edit: Transition to perfboard went fine, and I can control my motors very well. Thanks again!