Got my arduino coded for cooling fan operation. I didnt get much detail from my online search but one post saying the fans should not come on until coolant temp is 135F. Idea is that this replaces the otterstat switch. This is using VMA320 Temp sensor and VMA406 5V relay. I have no idea if the fans will ever be needed. Im guessing this could work for the PRV as well with the temp set higher. In retrospect, i could probably have just gotten a sensor for the leaf...
Code:
#include <math.h>
int relayPin = 8;// define output pin for relay
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
pinMode(relayPin, OUTPUT);// define pin 8 as output
}
void loop() {
double RawADC = analogRead(A0);
double Temp;
Temp = log(10000.0 / (1024.0 / RawADC - 1)); // for pull-up configuration
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp )) * Temp );
Temp = Temp - 273.15; // Convert Kelvin to Celcius
Temp = (Temp * 9.0) / 5.0 + 32.0; //Convert C to F
int Temp1 = Temp;
if (Temp1 >= 135) digitalWrite(relayPin, LOW); // turn the relay on
else digitalWrite(relayPin, HIGH); // turn the relay off
delay(1000);
}