Zuntara / Arduino.Pentair

Arduino code for Pentair Intelliflo Wisperflo VS(D)
MIT License
22 stars 0 forks source link
arduino intelliflo pentair pool pump whisperflo

Arduino.Pentair

Arduino code for Pentair Intelliflo Wisperflo VS(D)

How to install

Notes

I still need to test this on a real system, my own pentair pump sends nothing over the RS485 wire, can someone confirm me how to connect it directly to the pump?

Found that the RS-485 pins are pin 6 and 7 of the pump connector. Which is the most-bottom pin of the connector and the most-bottom-left one.

This library is simplified to just control the pump(s) - no chlorinator etc.

Through the callback function you can submit the pump data to where-ever you want.

// set a callback method for when a pump status changes
pentair.SetCallback(OnPumpChanged);

// Gets called when there is a change in attributes on the given pump
void OnPumpChanged(Pump myPump) {

    Serial.print("Pump "); Serial.print(myPump.pump); Serial.println(" has been changed.");
    Serial.print("RPM: "); Serial.print(myPump.rpm); Serial.println(" is reported.");

    // Call a HTTP client or send it over TCP/UDP to somewhere if you like....

}

Contribute

Feel free to contribute to this library.

You may create pull requests for other commands to the pump (if I've missed some), I also need to create an interface to communicate with a phone or app on the desktop over bluetooth or a network.

Usage

Initialize the Pentair class and give the RX and TX pin numbers of your RS485 module (I have the RS-485 Shield from linksprite).

// Create our pentair instance with SoftwareSerial
Pentair pentair(6, 7);      // RX, TX pins for RS-485 (shield)

// Create our pentair instance with a HardwareSerial
Serial1 _serial1;
Pentair pentair(&_serial1);     // pass the address of the hardware serial

Call ProcessIncommingSerialMessages() in the loop() function to retrieve the bytes from the RS485 interface, the library will then parse it and call the defined callback function (through 'SetCallback(PumpChanged)' for example) which will hold all pump information.

void loop() {
    // Inspect the bus for incomming messages and process them
    pentair.ProcessIncommingSerialMessages();

    // Wait a little bit (this can be removed i guess)
    delay(20);
}

Commands that are available:

// Request the pump status
void PumpStatusCheck(int index) 

##

// Turn the pump on/off
bool PumpCommandSetPower(int index, bool power) 

// Save the program & speed
bool PumpCommandSaveSpeed(int index, int program, int speed)

// Rrun a fixed preset program
bool PumpCommandRunProgram(int index, int program)

// Run a program for a specified duration
bool PumpCommandRunProgramForDuration(int index, int program, int duration)

// Save and run a program with speed for a duration
bool PumpSaveAndRunProgramWithSpeedForDuration(int index, int  program, int speed, int duration) 

// callback when a pump status has been changed.
void SetCallback(pump_callback callback) 

Credits

Credits to :

for giving my enough information to figure out what the pump needs.

Roadmap