Connecting the Micro:bit to a water pump

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Post Reply
User avatar
solitaireMakes
 
Posts: 19
Joined: Sun Sep 10, 2023 1:45 pm

Connecting the Micro:bit to a water pump

Post by solitaireMakes »

Hello there!
I just ordered a few Micro:bits and 3V submersible pumps from your shop for a greenhouse project that I am embarking on with my students. Can I connect the pump directly to the Micro:bit or do I need the Bonsai Buckaroo (https://www.adafruit.com/product/4534#description). Just trying to replicate a simple watering system with nails, the Micro:bit and submersible water pump. I am planning to power the Micro:bit with the 2 AA batteries and will use a breadboard to get all the connections streamlined. Thoughts on this? Any advice would be much appreciated!!

User avatar
adafruit_support_bill
 
Posts: 88172
Joined: Sat Feb 07, 2009 10:11 am

Re: Connecting the Micro:bit to a water pump

Post by adafruit_support_bill »

The Micro:Bit pins cannot power a motor directly. The Bonsai Buckaroo includes a power transistor that can be used to switch power to the motor. The other option for controlling motors from the Micro:Bit would be something like the Crickit. But that is quite a bit more expensive.
https://www.adafruit.com/product/3928

User avatar
solitaireMakes
 
Posts: 19
Joined: Sun Sep 10, 2023 1:45 pm

Re: Connecting the Micro:bit to a water pump

Post by solitaireMakes »

Thank you! Could I use transistor like this :

https://www.amazon.com/dp/B083WMZ5KT/re ... F9kZXRhaWw

Thank you.

User avatar
adafruit_support_bill
 
Posts: 88172
Joined: Sat Feb 07, 2009 10:11 am

Re: Connecting the Micro:bit to a water pump

Post by adafruit_support_bill »

Yes, that would work. But for switching inductive loads like motors, you should add a diode in parallel with the motor to protect your Micro:bit & your MOSFET from the back-EMF of the motor.

This is because when you cut power to the motor, it becomes a generator and generates a reverse voltage until it stops spinning. The diode short-circuits the reverse voltage before it can cause damage to the rest of the circuit.

Image

User avatar
solitaireMakes
 
Posts: 19
Joined: Sun Sep 10, 2023 1:45 pm

Re: Connecting the Micro:bit to a water pump

Post by solitaireMakes »

Thank you as always! Do you have a suggestion or a link to a diode that would work well with the transistor I referenced? I am new to this and learning so much!

User avatar
adafruit_support_bill
 
Posts: 88172
Joined: Sat Feb 07, 2009 10:11 am

Re: Connecting the Micro:bit to a water pump

Post by adafruit_support_bill »

the general rule is that the diode should be rated for at least the maximum current drawn by the motor. These are rated for 1A, so they should work fine for most small hobby motors.

https://www.adafruit.com/product/755

User avatar
solitaireMakes
 
Posts: 19
Joined: Sun Sep 10, 2023 1:45 pm

Re: Connecting the Micro:bit to a water pump

Post by solitaireMakes »

So I connected everything and the pump works without the transistor. The minute I add the transistor it stops working. Not sure what I am doing wrong! Help!
Pictures below.
Attachments
pump circuit2.png
pump circuit2.png (417.73 KiB) Viewed 279 times
pump circuit.png
pump circuit.png (369.45 KiB) Viewed 279 times

User avatar
Timeline
 
Posts: 104
Joined: Sun Feb 18, 2024 7:13 pm

Re: Connecting the Micro:bit to a water pump

Post by Timeline »

Very hard to tell from your photos (can you get better photos?).

In the two pictures is the pump simply connected across the +3 and ground rails? In which case it should simply run. And the transistor is doing nothing.

As to the transistor, it looks like you may have the drain and source pins on the wrong side, but if you switch them and then turn on the gate, it looks like it will short out your power rail to ground. You shouldn't have both the drain and source tied to +3 and GND as the transistor will act as a switch to short them together when you put +3 on your gate. Typically you ties one or the other to 3V or ground and then the other is connected to your load (in this case the pump).

You need to turn the motor connector 90°and plug it on over in the abcde area of the protoboard. Then a wire from your +3V rail on the far right to the row with the red wire for the motor. Then another wire in the row with the motor's black wire that goes to the 2n7000's drain pin (which in the photos looks like it is currently connected to your ground rail). Then your 2n7000 source pin goes to the ground rail (looks like it is currently connected to the 3V rail).
2n7000.PNG
2n7000.PNG (6.17 KiB) Viewed 254 times

User avatar
solitaireMakes
 
Posts: 19
Joined: Sun Sep 10, 2023 1:45 pm

Re: Connecting the Micro:bit to a water pump

Post by solitaireMakes »

Thank you for this advice. I got it to work now. In my prior attempt, I had the Drain of the Transistor connected to Ground of the Micro:bit and the Source connected to the 3V of the Micro:bit. Now I have the Drain connected to the Ground of the pump and the Source connected to the Ground of the Micro:bit.

Also, I did not use a diode and it still seems to be working.

And one more question, I can only get the pump to work when the Micro:bit is connected to the laptop. It doesn't work on the 2AAA battery pack alone. Thoughts on how to address this, as it will be unwieldly for students to have their laptops connected to the pump all the time. Thanks again for all the help!

User avatar
Timeline
 
Posts: 104
Joined: Sun Feb 18, 2024 7:13 pm

Re: Connecting the Micro:bit to a water pump

Post by Timeline »

The diode is a protection device that does not affect the normal functionality of the circuit. However every time the pump shuts off there is a big voltage spike from the motor back into your circuitry that could damage your circuits. So best to have the diode in place to prevent blowing out the diode of the Adafruit board.

As to the batteries, I am not sure what is going on there. AAA batteries should easily be able to provide the roughly 100mA current of those submersible pumps. Are you driving both the pump and your board off these batteries? Are you supplying the battery power through the USB connector? The battery connector? Some other way? Does it not work the same way if you try 2xAA batteries? Do you have a photo of the battery setup and how it is connected to the board?

Post Reply
Please be positive and constructive with your questions and comments.

Return to “For Educators”