Go Down

Topic: Noob here: Mosfet question and feasibilty (Read 1 time) previous topic - next topic

bigdonk

Just thought I would post an update.

I was able to get it working from all the advise above. I only have it on the breadboard with short wires. I will test out again with long wires when I get a chance. I was also able to find an old copy of Gobetwino and trigger a batch file on a windows pc for data logging as well as SMS and Email notifications. I don't know Python to make my own program, so I went with good ole batch file  :) Please don't laugh!

My code below if anyone wants to use or tell me a better way to do it. I only wanted a single notification for each up and down, so I got as creative as a novice can get...

Code: [Select]
int NorthSump = 7;
int SouthSump = 6;
int HotWaterTank = 5;


void setup() {
pinMode(NorthSump,INPUT_PULLUP);
pinMode(SouthSump,INPUT_PULLUP);
pinMode(HotWaterTank,INPUT_PULLUP);
Serial.begin(9600);
}

void loop() {
 WaterSensors();
}

void WaterSensors() {
 static int ns1 = 0;
 static int ss1 = 0;
 static int hwt1 = 0;
 char buffer[3];
 int ns = digitalRead(NorthSump);
 int ss = digitalRead(SouthSump);
 int hwt = digitalRead(HotWaterTank);
 if ((ns == 1) && (ns1 == 0)) { Serial.println("#S|NSUP|[]#"); ns1 = 1; } // Float is up
 if ((ns == 0) && (ns1 == 1)) { Serial.println("#S|NSDWN|[]#"); ns1 = 0; } // Float is down
 if ((ss == 1) && (ss1 == 0)) { Serial.println("#S|SSUP|[]#"); ss1 = 1; } // Float is up
 if ((ss == 0) && (ss1 == 1)) { Serial.println("#S|SSDWN|[]#"); ss1 = 0; } // Float is down
 if ((hwt == 1) && (hwt1 == 0)) { Serial.println("#S|HWTWET|[]#"); hwt1 = 1; } // Sensor is wet
 if ((hwt == 0) && (hwt1 == 1)) { Serial.println("#S|HWTDRY|[]#"); hwt1 = 0; } // Sensor is dry
}


Since the package of float sensors contained (6) sensors I am going to put 2 floats in each sump. (1) will monitor the on/off cycles of the sump pumps and (1) will be the alarm for High water in the sump. I won't add those until the single float setup is installed and tested.

Thx,
Don

Go Up