I'm making a project for my homework, it's a soil moisture sensor and a mini dc water pump. The problem is the water pump, I see many people on internet that says it needs relay , but I also see some youtube videos that doesn't use relay, they connect the pump directly to the arduino. I'm confused now.
I welcome any advice , thanks so much.
edit : and I'm grateful if someone can teach me how to write the arduino code for the pump thanks !
Choose the MOSFET based on the stall current of the motor and the motor supply voltage. The stall current can be several times the running current. The stall current will be drawn, briefly, every time that the motor is started. The stall current should be listed in the motor data sheet. In the absence of a data sheet, the stall current can be estimated. To estimate the stall current, measure the motor winding resistance. Take several measurements rotating the motor a bit between readings. Use the lowest reading in the calculation. The estimated stall current is the motor supply voltage divided by the measured resistance.