I am looking to get this micro pump.
I was wondering what else I would need in order to run this from my raspberry pi? Do I need a relay and/or an additional power source. What all is needed to drive this and pump water on command.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
You need to get a good power supply. Preferably one that can supply you with 5v for the Pi and 6 or 12 for the pump, but that is in an ideal world. In your case your Pi will run off a 5v power supply and your motor MUST run on a separate power supply.
Looking at the biggest motor there 12V @ 5.8Watt you will need at least a 750mA power supply. That is not so bad and you can find 1A ones really easy and cheap or even the one supplied or recommended for that motor.
The image demonstrates the concept of using a transistor to switch the motor on and off. This circuit ONLY works with DC currents!
The nice thing is that you can control the speed of the motor, which is true with model because the specification sheet says the applied voltage (GREY WIRE) controls the speed. While the circuitry is powered by (RED WIRE) its own constant voltage. You can even connect the (YELLOW WIRE) to the GPIO set to INPUT, and this will tell you the RPM of the Motor. 1 Pulse is 1 revelotuion and counter per minute. Again use a Resistor on the INPUT GPIO to make sure that voltage is not less than 3.3v and not more than 5v. (GREEN WIRE) Set the direction of the motor, please refer to the manual.
For calculations on the PWM you will need to ask on Electronics Stack Exchange for the details as there are some calculations based on the all the elements.
Using a relay needs very similar considerations and cannot just be triggered with the GPIO pin because relays use electromagnet coils that also generate back emf that can damage the GPIO pin. Relays also need a transistor, seperate voltage and flyback diode. You can replace the motor here with a Relay if you wish. Then just connect the relays switch PINS to the power source of the motor, preferable inbetween negative. The TIP120 can handle up to 60Volts and 5A current at 60Volts. When dropping to 12volts you get a nice 25A upper limit (OHMS LAW)
Arduino based example for reference.
That sounds interesting! But you will not get along without an additional power supply. Input voltages of 6 or 12V are beyond of what the Raspberry can handle and with powers in the range of 1.2 - 7.1 W you will have currents of 200 to ~500 mA.
I'm not an expert at all, but I'd assume that you will need at least a suitable transistor (with a GPIO pin at the base) to control the pump and probably a clamp diode to protect the circuit.