2

I am attempting to run a PWM on a pump using rpi.GPIO using the following code:

def run_PWM_on_pump():
    gpio.setmode(gpio.BOARD)
    gpio.setup(8, gpio.OUT)
    p = gpio.PWM(8, 0.5) #also works at 5000 frequency, 100 duty cycle
    p.start(15)
    time.sleep(2)
    p.stop()

However, the only time this PWM results in the pump running, is by that configuration (0.5 frequency, 15 duty cycle) or any frequency at 100 duty cycle. We have tried lowering the voltage manually, and the pump does indeed run at lower voltages, but for some reason the PWM is not working as expected.

EDIT: the pump is rated for 24 volts, but we were able to get the pump to run by providing 12 volts.

EDIT2: Pump is connected to the PI via GPIO, turning the gpio pin on causes the pump to stay on until the pin is turned off. To do this, I am using rpi.GPIO's built in PWM functions/GPIO functions. No hardware PWM as far as I know is built into the board.

EDIT3: Link to the pump can be found here: https://www.usplastic.com/catalog/item.aspx?itemid=117560

Pump normally operates at 24V with <2.2A of current.

  • Please edit your question and explain how you are driving the pump and show a full software listing. – joan Oct 31 '19 at 17:37
  • @joan edited, is there anything else I should add? – Tmello225 Oct 31 '19 at 17:40
  • A link to the pump specs would be useful. The board has fully hardware PWM available from GPIO 12/13/18/19. – joan Oct 31 '19 at 17:44
  • @joan The pump can be found here, although there isn't much there in terms of specs for the pump itself usplastic.com/catalog/item.aspx?itemid=117560 From what I gathered, it operates at 24V, with a current of <2.2A – Tmello225 Oct 31 '19 at 17:46
  • 1
    @Ingo Sorry about that, edited the question to add the information. – Tmello225 Oct 31 '19 at 17:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.