Cant turn on DC water pump

Post here first, or if you can't find a relevant section!
Post Reply
thejukic
Posts: 2
Joined: Mon Aug 02, 2021 1:24 pm

Cant turn on DC water pump

Post by thejukic »

Hi, I'm new to STM32, I'm trying to start this DC water pump in my project (https://e-radionica.com/hr/mini-pumpa-za-vodu.html) I use STM32F103C8T6, I connected black wire of the pump to the GND of the STM and red one to pin A15. I tried this simple code to turn pump on (pump works fine when not connected to STM).

Code: Select all

void setup() {
  // put your setup code here, to run once:
  pinMode(PA15,OUTPUT);
  digitalWrite(PA15,LOW);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(PA15,HIGH);
}
Can someone help and explain what am I doing wrong?
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Cant turn on DC water pump

Post by fpiSTM »

I guess it requires too much current. I would use a relay.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Cant turn on DC water pump

Post by ag123 »

you need to use at least a transistor say tip110
https://www.onsemi.com/pdf/datasheet/tip110-d.pdf
and stm32 can drive the base of that transistor.
for tip110, you could lose as much as 2.5v across the transistor and say you are trying to drive with 5v, you have lost close to 1/2 of it.
there are also lower power ones like 2n2222
https://www.onsemi.com/pdf/datasheet/p2n2222a-d.pdf
these don't drive as much currents but it has a lower saturation voltage and only needs much lower turn on voltage
stm32 can drive them at the base
or you can use a mosfet like ao3400
http://www.aosmd.com/pdfs/datasheet/ao3400.pdf
stm32 can drive the gate of that mosfet


plenty of tutorials out there
https://learn.sparkfun.com/tutorials/transistors/all
https://www.allaboutcircuits.com/textbo ... witch-bjt/
https://electronicsclub.info/transistorcircuits.htm

some of the transistors are pretty low cost you could try searching for them on octoparts, ebay, aliexpress, amazon etc
Post Reply

Return to “General discussion”