Running 24VAC pump

Dear Community,
I'm trying to run a 24VAC (yes AC) pump with my Mega. I had it working with an NE555 before but for some
reason I would like to run it with the Arduino Mega.

The hardware config is very easy:

Pin 21 goes +5V via 220 ohm to an optocoupler. Pin 20 is set to LOW on the other side.
The coupler switches 5V to the Gate of an IRF3205. There is a 1 Mohm between Gate and Source.
Source, 5V and Arduino have a common minus.
The transistor switches the minus to to one side of the pump.
The other side of the pump is connected to a 24V DC source.
Between those two is a Schottky-diode (CMBR 10100).
The pump is a ULKA EX5 24V~ 50-60hz 48W
I have simulated the process with a LED and everything works fine. When I connect the pump it starts
working but cable start burning and the system gets very hot. Does someone has another idea how to
run this pump.
I need to tune the dosing via the hz.

Many thanks in advance

Martin

Here is the code I use:

int hz = 10;
int ledState = LOW;
long previousMillis = 0;
long interval = hz;


void setup()
{
  pinMode(20, OUTPUT);
  pinMode(21, OUTPUT);
  digitalWrite(20, LOW);
}

void loop()
{
  unsigned long currentMillis = millis();
   
   if(currentMillis - previousMillis > hz) {
     previousMillis = currentMillis;
     
     if (ledState == LOW)
     ledState = HIGH;
     else
     ledState = LOW;
     
     digitalWrite (21, ledState);
   }
}

Do you need to control the motor speed, or turn it on and off a huge number of times? If not, one option would be to switch it on with a relay. That avoids you needing to deal with the AC power at all.

It sounds to me like your circuit will create pulsed 24V DC, not 24VAC. You can't synthesize 24 VAC from DC unless you have a transformer, and even then, you're not going to get a sine wave output from the square wave output from a logic gate.

Neither switched DC nor square wave AC is suitable for driving an AC motor. You want true a 24VAC sine wave.

I would suggest you get a 24VAC power supply, and use an electromechanical relay to turn it on and off. (A 24VDC power supply can be as simple as a 5:1 step-down transformer for a 120V supply.)

You should be able to find a relay that you can control with 5 volts, although you will probably need to run it through a power transistor in order to increase the current enough to drive the coil on a relay. You can also buy solid state relays that can be driven directly with a logic signal, although they are more expensive than electromechanical relays.

martinKr:
Dear Community,
I'm trying to run a 24VAC (yes AC) pump with my Mega. I had it working with an NE555 before but for some
reason I would like to run it with the Arduino Mega.

The hardware config is very easy:

Pin 21 goes +5V via 220 ohm to an optocoupler. Pin 20 is set to LOW on the other side.
The coupler switches 5V to the Gate of an IRF3205. There is a 1 Mohm between Gate and Source.
Source, 5V and Arduino have a common minus.
The transistor switches the minus to to one side of the pump.
The other side of the pump is connected to a 24V DC source.
Between those two is a Schottky-diode (CMBR 10100).
The pump is a ULKA EX5 24V~ 50-60hz 48W
I have simulated the process with a LED and everything works fine. When I connect the pump it starts
working but cable start burning and the system gets very hot. Does someone has another idea how to
run this pump.
I need to tune the dosing via the hz.

Many thanks in advance

Martin

Here is the code I use:

int hz = 10;

int ledState = LOW;
long previousMillis = 0;
long interval = hz;

void setup()
{
  pinMode(20, OUTPUT);
  pinMode(21, OUTPUT);
  digitalWrite(20, LOW);
}

void loop()
{
  unsigned long currentMillis = millis();
   
   if(currentMillis - previousMillis > hz) {
     previousMillis = currentMillis;
     
     if (ledState == LOW)
     ledState = HIGH;
     else
     ledState = LOW;
     
     digitalWrite (21, ledState);
   }
}

Hello,
the pump is not a motor driven pump it is a solenoid dose pump. In the end I have to run several pumps to mix some liquids on a continuous basis. I have realized this with some NE555 before. I was able to tune the pumps over the "hz". This has worked with some heat as well. Now I would like to show the percentage of the fluids on the display and tune it with a click on a button not with potis. The code is just a minor problem. I have it running with LEDs instead of the pumps. Only problem here is that it looks like the loop takes longer than the desired count of millis.

Does anyone has an idea how to build a 1:1 transformer? I can't use mains. The only power source I have is 24VDC. I have read something about the use of two transistors and a center tap coil. But all these convert 12VDC or 24VDC to 120VAC or 240VAC. Where do I find a 1:1 coil?

AC motors and DC motors are not interchangeable.

first you have to know what type of AC motor, there are many types and if you do not use the correct drive, it will not work.

the place to start is with the motor or pump manufacturer.

if you want great control of the pump, buy an AC motor speed controller.
should cost less than $150 per motor.

Find one that can take either 4-20 ma or 0-5 volts.

the you can control it with your control signals.

if the manufacturer of the pump offers a DC motor, it is easier to control. in fact, the circuit you started with might work.

on the other hand.....

you mentioned dosing pump. those are typically peristaltic pumps. one fraction of a revolution is one dose. each dose is a specific volume. if the pump has 2 rollers, then one half revolution is one dose. 3 rollers, then one third of a revolutions.

the pump may have a feedback for location of the rollers. with that, you can count doses and turn the motor on and off to attain one dose. then count doses and control away !

since you mentioned it was an AC pump, your circuit has to control an AC motor. I am not fond of using relays for highly repetitive applications, but in your case, it would be a low cost starting point and should work for a long time.

if the dosing is to mix soap for a washer, then no problem. if it is ANYTHING related to health care, stop, get an engineer, pay the thousands of dollars for a professional. you can get it done very quickly and easily.

the simple mental test is "what is the worst that can happen if the pump runs full speed and the controls think it gave only one dose" or "what is the worst that can happen if the controls think it gave 100 doses buy the machine was stuck and nothing was dispensed"

if it is syrup for a soda machine, the customer walks away unhappy and tells 6 friends.
if it is medical, those 6 friends are needed to carry the body to the grave.