Help! How to Control speed of a water pump AC 220V with C code

I have no idea where to start. I just need code that can control the speed of the water pump with board.Need help!

Please read and use the sticky topic "How to get the best out of this forum".
Forum is not a free design and code writing services. We help new members to learn and grow in programming.
Show what You've done so far.

@hirosumshinbe ,

Why did you flag your own topic to the moderators?

Welcome to the forum, if you want help then please start by reading the forum guide:

You are unlikely to get help based on the minimal information you have supplied.

1 Like

What kind of AC motor? Is it a speed controllable kind?

1 Like

There are many types of AC motors.
Your first challenge is to find out what type of motor it is.
Does it have brushes or not?
Many power tools like drills will have brushes. I'm not so sure about water pumps.
If it has brushes, it's likely to be a universal motor, and these run on AC or DC.
The type plate will sometimes say 240-V AC/DC.
If that's the case, then speed control is fairly easy. Triac for AC, Pulse Width Modulation (PWM) and a MOSFET for DC. An old style, resistive, lamp dimmer will control this type of motor.
You can run a universal motor interchangeably on say 240-V AC or as I do, on 180-V DC.
I have an old sewing machine that runs on 180-V DC, and the Arduino Nano takes care of of the speed control via a 0 to 5 volt potentiometer.
I suspect it won't be so straightforward.
My garden water pump is capacitor start and possibly run.
It's definitely not something to tinker with if you aren't sure.

1 Like

You actually begin with plumbing to control water pressure, NOT pump speed control! What are you actually trying to accomplish?

1 Like

Code can be used to send appropriate commands to a controller.

1 Like

The best and easiest way to do this is to acquire a VFD. Not every motor can be controlled by a VFD.

A VFD, or Variable Frequency Drive, is an electrical device that controls the speed and torque of an electric motor by varying the frequency and voltage of the electrical power supplied to it. It's also known as an AC drive, adjustable frequency drive, or variable speed drive. VFDs are widely used in industrial and commercial settings to improve energy efficiency, optimize performance, and extend the lifespan of equipment.

They accept many inputs that control the output frequency and current to the AC motor. Then with your micro device you send either a 1 to 10vdc or a 4 to 20ma signal to the device and it send the appropriate frequency and current to the motor.

It is much simpler and safer.

1 Like

What type of pump is it, what are its ratings? What pressures are involved, as asked previous what are the details of the motor. This is all basic information needed before a guess can be made. Assuming these parameters will give you a bad answer.

While we are waiting for more information, I'm going to guess that it will turn out that you don't need to control the speed after all.

2 Likes