Is Pulse Width Modulation possible?

Hello I am doing a home project which includes watering plants as I'm interested in growing my own food (grocery prices, am I right? :grimacing:)

I want to make use of PWM to drive a couple of peristaltic pumps, but am unsure if PWM is possible with the Edge Control using one of the pins meant for a MKR board. My hope was that with PWM I can accurately water my plants by continually adjusting the rate at which the pump runs at, as a moisture sensor continually updates its reading of the moisture level. I am worried that a simple on/off may put my plants at risk of overwatering as some are really sensitive to that.

WHY! What is wrong with using real on and off, high and low, to turn the pump on and off? How does PWM get the power to the actual pump motor? The Arduino CANNOT power the pump, but it can control the power.

Post technical information on the pumps, it sounds like they are AC motors.

@Paul_KD7HB The idea in my mind was that once the soil moisture sensor detects dry enough soil, it'll cause the pump to run and the Edge Control through PWM will slow the motor down as the soil gets more moist. The idea is to have precise control based on the readings from the soil moisture sensor.

@gilshultz
Driver Board:

  • Input Voltage: 5V-6V
  • Maximum Continuous Operating Current: 1.8A
  • Peak Current: 2.5A
  • Quiescent Current: <1mA (No PPM Signal Input)
  • PPM Signal Resolution: 1us
  • Positive Pulse Width of the PPM Signal: 500us-2500us
  • Forward Pulse Width Range: 500us-1400us (500us: max forward speed)
  • Stop Pulse Width Range: 1400us-1600us
  • Inverted Pulse Width Range: 1600us-2500us (2500us: max inverted speed)
  • PPM Frequency: 500Hz (Servo Control Signal)
  • Connector: Gravity PH2.0-3P
  • Size: 27.4 x 28.7 mm/1.08 x 1.13 inches

Peristaltic Pump

  • Motor: DC Motor
  • Rated Voltage: 6V
  • Rated Power: 5W
  • Tube Material: BPT
  • Tube Specifications: inner diameter 3mm, outer diameter 5mm
  • Pump Head Material: Engineering Plastics
  • Pulsation: Three Rollers, Small Pulsation
  • Flow: 85ml/min (Maximum revolution)
  • Working Conditions: ambient temperature 0 ~ 40 ℃, relative humidity <80%

Board Overview

Num Label Description
1 D Control Signal Input(PPM Signal)
2 + Power VCC(5V~6V)
3 - Power GND(0V)
4 M- Motor Negative Pin
5 M Motor Positive Pin

There would be no edge control, simply changing the PWM duty cycle will control the motor. That can be done with an Arduino.

Well, good luck getting that with a DC motor and a peristaltic pump. Remember that motors and water take a lot of energy just to get them started moving.

Maybe I should have been more clear. I will have a separate power circuit, the pumps are only 5V, and diameter of the tubing is on the scale of millimeters. This isn't meant to move much water at any one instant; power won't be an issue. All that matters to me is that I can use PWM to get a variable duty cycle based on soil moisture reading.

Hello brikbear

Have you already started a practical exercise and set up the hardware on your workbench?

I understand that the pump requires PPM and not PWM control signals.

What do you think?

Check the interface specifications of the selected hardware again.

Do you understand there is NO power to the motor with PWM, EXCEPT for the times there is +5 volts in the PWM signal? When the PWM signal is at zero volts, there is no power to the motor and it will try to stop. So power is the fundamental issue. With PWM, the actual power is fluctuating between zero and what ever time there is +5 volts from the Arduino. So if you are going to use PWM, start with 100% positive and 0 at ground level, and then reduce the 100% to a lower value of whatever you want.

There is no need to use PWM to slow the pump.

It takes several minutes for water to soak into the soil and for the moisture level to settle.

Have the Arduino run the pump for maybe 30 seconds and then wait at least 5 minutes before taking another moisture reading. If still too dry, repeat the process.

(You could say that the process I just described is actually PWM. But with a period of 5 minutes rather than 2 milliseconds!)

@paulpaulson I have started a practical exercise previously, but the pump worked as a simple on/off dependent on moisture reading. But that was with a different Arduino model and was some years ago. After brushing up on my understanding of both principles, I believe that PPM may still be ok for my intended use case.

@PaulRB This is brilliant. I suppose I was overthinking this setup. I think I'll be better served with having the system check every so often based on some testing I need to do as part of calibrating the soil moisture sensor anyway. So I can do as suggested and update motor speed once the Arduino "reads" the sensor value.

Thanks for the help, it's been really great!