Code needed - Reverse dosing pumps

Discuss garden automation systems and software here, including commercial products or Raspberry Pi and Arduino DIY setups.
Post Reply
jeffcourtneydba
LED-Curious
LED-Curious
Reactions:
Posts: 20
Joined: Mon Jan 18, 2021 11:29 pm

Im trying to get pump to run backwards for specific time (10 seconds) to purge line then pump out solution. Ive basically copied LEDG code from Github and got the pump to run normally as intended. Ive hit a wall trying to throw together IDE code trying to add the reverse component. I dont have the PIN real-estate to add a enable pin wire to all pumps so I had the idea that maybe I could run all 6 to 8 pumps off one pin, and just have them all spin backwards for that specific time.

I thought it would be as simple as adding a digitalWrite(reversePin, HIGH); then a delay(pumptime) then digitalWrite(reversePin, LOW); to the callback function of the code when it looks to HomeAssistant.

Does anyone have any code they can share? or anyone willing to look at mine and see if they have some insight?


Jeff
GreenThumb
LED-Curious
LED-Curious
Reactions:
Posts: 13
Joined: Mon Oct 04, 2021 8:51 pm

From what I know you need some circuitry to reverse polarity of the circuit. I am not an expert but there are chips called HBridges that are designed for controlling motors forward, backward, speed and stepper motors.

You can search Amazon for HBridge and you’ll find modules with different hbridge chips. You can also search the names of the chips:
L293D
L298N
TB6612FNG

Check the arduino library for l298n example code for examples - I think it is as easy as writing something like “forward” or “backward” in the code
Post Reply