I'm looking to develop a standalone unit to dispense oil. I'm in the testing phase and I have a DC peristaltic pump that seems like it will work perfectly. Now my next step is trying to figure out how to dispense a specific amount of oil.
This is where I need some help since I don't have any experience. Id like to use a potentiometer dial to control how much fluid is dispensed (1-40oz), a display to show the amount selected, and then a button to "start" the pump for the required amount.
This is where I need some recommendations as I'm in experienced and not sure which method makes the most sense. From my limited research it seems like I could do a few options:
1: use the DC peristaltic pump with a pwm to control how long the pump is on
2: switch to a stepper peristaltic pump and dispense by calibrating how many steps it takes to pump 1oz and multiply by increments
3: use a hall effect flow sensor
Which of these would be the easiest, most reliable and most accurate? Please let me know if I have a misunderstanding of anything I've posted as I'm still trying to wrap my head around this. I'm trying to settle on which method makes the most sense so I can start looking into getting the components and dive into learning coding.
It's going to depend on how accurately you need the volumes to be measured, but most likely, you will get sufficient accuracy with open-loop control (no sensors required, just do some initial tests to determine how long the pump must be on for dispensing a specific volume).
You won't need PWM unless you wish to control the pump speed (e.g., you may get better volume accuracy if pumping at slower speeds) — simply turning the pump ON for a specific amount of time should be sufficient.
How much accuracy do you need? Nothing is perfect in the analog world... i.e. A gallon of milk may contain an extra drop. ...Eggs are digital and you a dozen eggs is always exactly 12. Of course size and the total weight can vary but they are sold "digitally".
You'll have to experiment to determine the consistency of one-step of the motor.
The standard for stepper motors is 200 steps per revolution (1.8 degrees per step). That should give you an approximation of what you can get, ignoring any "fluid variations".
With digital input instead of a pot, or at-least a digital display controlled with the pot, you can set the exact number of steps (or you can display ounces with the precision of one-step).
Unless you have a used or a very cheap pump, the documentation will tell you the volume moved each time the rotor moves one cycle. How many segments does the rotor have and what is the rated life of the pump?
edit!
I see I was thinking of a different type of pump. The peristaltic type relies on atmospheric pressure to put the fluid into the pump on the intake stroke. Not a very reliable volume of fluid.
Disadvantage of option 1 is that the speed of the motor will vary depending on load. With oil, the viscosity will likely change with temperature, so getting repeatable results could be difficult.
Option 2 is going to be fairly repeatable, provided the pump is not so difficult to turn that the motor skips steps.
I was going to recommend a rotary encoder, but up/down buttons are also an option and may be easier to work with. A single-turn potentiometer has maybe 300 degrees of rotation, that would give 7.5 degrees per ounce, minus some dead-zone at each size to allow for noise.
1 and 2 are both valid options. You have to calibrate them for every liquid and temperature. Stepper approach is more forgiving though, especially if liquid is not perfectly homogenous or temperature varies during dispensing. For example top layer of container might have higher temp and bottom layer more insoluble solids.
3. option : don't bother to try cheap flow sensors. If budget is not a problem, some valid sensors are available.
I would use a linear pot and if it wasn't too spendy one that claimed 1%.
But. The pot is wired as a voltage divider, is read by analogRead() and some number based on the range 0 .. 1023 is developed, which number is both displayed and used in the dispensing process.
So it wouldn't matter, as long as the pot isn't entirely crap, as some position would result in some number and inform the dispensing over the desired range by design.
Youre absolutely correct, I just need it to be relatively accurate, currently its being measured by eye using a bottle with graduations. Can you elaborate on what kind of digital input you would suggest?
Do. They are easy to use and one would work well here.
You might start with a potentiometer, though, just to rapidly complete one part of the project. The rest of the code will just use some number to dispense a quantity; if the pot works well you done, or you can always plan to swap out the potentiometer orientated code for rotary encoder stuff that controls that same number.
In any case, it is advised to keep the things that can be separate separated, and keep entanglement to a minimum. This also facilitates development as you can always test the parts independently.
You may enjoy doing most of the software in the simulator. I can usually get most of the code mostly perfect before introducing real components and the additional challenge they present.
You can use it anonymously, or sign up for a certain level of free use. I'm not sure what paying means in terms of stuff you don't get otherwise, it looks like free might just mean slow service for compiling at certain times of the global daily rhythm.
Have worked with a specific peristaltic pump in the past. Most important lesson learned was that controlling it with PWM gives hysteresis. The pump started only at approx. 50..60% PWM depending on the voltage supplied. So there are several parameters you need to control simultaneously to calibrate such device.
Wrapped the core code in an experimental library, which might help (or not).