More Programming Help!

How might I go about altering the default code so that the Pump is set to always on (or as last year, always forward) can someone help me? The pump wont even turn on…

Actually, the relevant code is already in there. Just connect the pump to Relay 8, and the pressure switch to digital input 18.

The line of code that controlls the pump is

relay8_fwd = !rc_dig_in18; /* Power pump only if pressure switch is off. */

Assuming that you use Relay 1 (you can change this depending on the relay that you use) and you put the red lead of the pump to the M+ leg of the relay and the black lead to the M- leg of the relay, issue the following command to turn on the pump all of the time:

relay1_rev = 1;
relay1_fwd = 0;

This must be in your version of the Default_Routine or whatever you use that gets called everytime thru the 26.2 msec loop.

If you want the pressure switch to control the pump, take a pwm cable, cut off the male end, and wire the signal line (white wire) to one side of the switch and the ground line (the black wire) to the other side of the switch. Don’t connect the red wire. Just cut it back and electrical tape the end. Then plug the end with the female connector into a free digital input, say for example digital input 7. Then the following logic will turn the pump off when the switch closes at 115 PSI and turns it on when the switch opens at about 95 PSI:

if (!rc_dig_in07) // don’t forget the exclamation point
relay1_rev = 1;
relay1_fwd = 0;

The exclamation point means the complement (or not). This is because the
pressure switch is normally opened and when the switch closes the value on
rc_dig_in07 will go to ground which is 0 in the code. And !0 = 1, so your pump turns on. When the switch opens, the value goes to 1, and !1 = 0, so
your pump turns off.

Hope this helps.

By the way, your relay light should turn green when the pump is on. Also, make sure that your pressure switch isn’t on the other side of the 60 PSI regulator or your pump will never turn on. Also, be a little careful of switching the leads on the pump because the pump might not like the wrong polarity (it wants +12v on the red wire) which could cause the pressure switch to “stick” inside until you put positive pressure on it.