I want to drive a couple DC motors. Small jobs, from an inkjet printer. I can use analogWrite, but then I realized that the microcontroller itself probably can't drive any sort of useful motor. I need an amp. I'm using a 9v battery.
It seems to me I can hook up a op-amp with infinite gain straight to the PWM pin on the microcontroller. Then when the microcontroller outputs PWM, it will switch on the opamp with the same duty cycle, but giving me +9v at 255 and as much current as my battery can put out, instead of +5v and only the few ma that the Arduino can put out.
Seems like a waste of an opamp though. A transistor would do it, but what kind of transistor do I need? I don't think BJT or Mosfet matters, but I think NPN or PNP matters. And I'm not sure if I should put it between the motor and ground, or between the Arduino and the motor.
Simplest way I feel is to use a logic level N-channel MOSFET switching transistor. Wire source lead to ground, drain lead to motor, gate lead to Arduino PWM output pin. Wire other end of motor to + voltage.
An op-amp is an op-amp, the triangle is just to make it easier to draw a diagram with all the pins. (More often than not, the pins will be switched around in the diagram as well, again just to make it easier)
You should be fine using any of the OP amps you can get at Radioshack. Although, if you don't mind waiting, I highly suggest you order from an online retailer. (Assuming you need more than just the op-amp) They're much cheaper through other vendors, and you can get a bunch of stuff through other vendors that Radioshack doesn't offer.
Best to check out the data sheet for the specific FETS you 'found'. Most N channel MOSFETS require 10vdc to fully turn on, only 'logic level' MOSFETS will fully turn on using TTL level voltages.
I can't get the tranistors to work right now, and I'm wondering if they are going to work with TTL level voltages. According to figure 5, it looks like they are saturated at 5v? Maybe I'm not reading the datasheet right.
No you are interrupting it wrong. It takes 10v to saturate the device to it's max current rating. 4 volts barely turns it on, that's called its threshold voltage, which is where it just starts to conduct. You either need to drive the gate with a npn transistor switch with a 10v or higher collector voltage. Or better yet get a logic level N mosfet, they are great for Arduino projects.