Page 1 of 1

Cant turn on DC water pump

Posted: Sat Aug 14, 2021 2:05 pm
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?

Re: Cant turn on DC water pump

Posted: Sat Aug 14, 2021 3:41 pm
by fpiSTM
I guess it requires too much current. I would use a relay.

Re: Cant turn on DC water pump

Posted: Sat Aug 14, 2021 4:00 pm
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