I am working on a project where I am supposed to control an external pump with an arduino chip. The goal is to completly automate the pump.
For instance I need to pump a fluid in a tank. Using a flow meter the arduino should recognize the flow and decide whether to speed the pumps RPMs of slow it down. The pumps input is connected to the voltage control. So the speed is now controlled by a voltage output from an external source. The more voltage the more RPMs.
What I am trying to figure is how to let the arduino read the current voltage and act based on that. So far I get a good read on the flow, but I miss the connection between the flow meter and pump.
Could anyone provide some help to achieve my goal?
Use a potentiometer on an analogue input to set the flow rate.
Use the pulses from the flow meter to measure the flow rate.
Use PWM to control the RPM of the pump.
I already tested the pump speed with a potentiometer but this still remains a manual input (the user adjusts the speed op the pump using the potentiometer).
What I want to do it while the pump is running the script reads the current speeds and current flow and compares both to the desired speed and flow. If the flow exceeds the desired value the pump slows down till the value is reached and vice versa.
I can change the speed in my pump using a couple of outputs:
Voltage Signal (V)
Current Signal (mA)
Tachometer output
Remote potentiometer
But which of the options above could be read in a script.
Connect a potentiometer to the remote potentiometer ports on the back of my pump. The potentiometer varies the speed and from that the code measures a speed and flow from the flow meter. That will then bring a signal back to the potentiometer to vary the rate of the pump. Did I understand you right.
As soon as I get the digital read I will work on making a PID control so every thing works digitally.
Waiting for your reply and thank you so much for your help.
I have seen section 6 and I have looked into it. My problem is how do I get the Arduino to read the different voltage signals. In section 6 it describes that I need a connected pin between pin 6 and pin 16 (this in case of using a current source). Otherwise no connection is needed.
But the questions how to I translate that signal into code so that the Arduino could output the speed on for instance the Serial Monitor or an external LCD?
You don't translate the signal, you generate it to control the pump - have you tried
following the instructions in section 6 using, for instance, a 5V supply as the test voltage input?
Yes I have tried an external voltage supply. It worked properly I could control the speed without using the main control on the pump. The pump and external power supply are pinned into the board using a MOSFET in between.
So far everything works properly. But I can't figure a way to read the voltages in my script.
This pump goes as far as 255 steps so in my code I need to identify a variable between 0-255 and using an if function I could control the pump. I set a value for SETPOINT = 20 (desired speed)
if(SETPOINT < 20){
analogWrite(PUMPpin, SETPOINT);
}
But what is the equivalent of the 0-255 steps in my case?
There are two ways to generate the control voltage for the pump. You can use a PWM output from the arduino with an RC filter to generate an analog voltage, or use a digital to analog converter(DAC) like this MCP4725 breakout one from Adafruit. to provide a 0-5v control signal.
So if I understand it correctly I need a DAC to provide a 0-5v control signal? Then I use the analogwrite function and control the pump speed with the 0-255 scale?
I will read the thread and in case of questions I will get back to you!
As it turned out, I didn't need to create a low-pass filter to read the pumps output. All I needed to do was to connect port 4 to a digital port on my Arduino and port 17 to the GND.
I was also able to control the pump speed using the code below.
I can read the flow in L/min which is what is supposed to be displayed to the using at the end. Now I am trying to figure a way to convert the value from the flow meter to a value between 0-255 so that I can let the flow send the current speed is measured and compared to the desirable value.
For instance:
The flow sensor measures: 200
The desired value: 225
The pump calculated what the current speed is and decides that it needs to increase the speed so that the flow sensor reaches the desired value.
As it turned out, I didn't need to create a low-pass filter to read the pumps output. All I needed to do was to connect port 4 to a digital port on my Arduino and port 17 to the GND.
I was also able to control the pump speed using the code below.
I can read the flow in L/min which is what is supposed to be displayed to the using at the end. Now I am trying to figure a way to convert the value from the flow meter to a value between 0-255 so that I can let the flow send the current speed is measured and compared to the desirable value.
For instance:
The flow sensor measures: 200
The desired value: 225
The pump calculated what the current speed is and decides that it needs to increase the speed so that the flow sensor reaches the desired value.