Page 1 of 1

Code needed - Reverse dosing pumps

Posted: Tue Jul 20, 2021 9:00 pm
by jeffcourtneydba
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

Re: Code needed - Reverse dosing pumps

Posted: Sat Oct 09, 2021 3:40 pm
by GreenThumb
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