I'm having a little trouble
Everything works and pump system will shut down as its supposed to but there is a delay from when the pressure switch (pressure) opens and shuts the pump down. is there any way to make this instant?
What I have noticed with the pressure switch is that it chatters a bit (opens and closes rapidly as the pressure drops in the pipe. there is nothing I can do about this. so id like to find a way to shut power off to relays as soon as the switch opens and voltage is dropped to LOW on the pressure pin.
I tried to make the Arduino reset if vltage drops on pressure pin by digitalwrite 27,LOW I got no errors in the code so I left it but the Arduino dosnt seem to reset
Im using an
UNO R3
NO pressure switch
2 ssr relays to switch 24VAC to activate 220VAC Motor Contactors
push button
is there another way of doing it
/* ------REVERSE OSMOSIS CONTROL -----------------
1. momentary button is pushed to energize low pressure
relay coil
2. when pressure switch detects that proper pressure
is reached the switch will close, sending voltage to arduino.
3. when voltage is detected from pressure switch the high pressure
relay waits 5 seconds and then energizes high pressure relay
4. if at any moment the pressure switch becomes normally open the
system shuts down waits 30seconds and resets the arduino and
awaits a button push to start system all over again
*/
const int lowbutton=A1; //Push button to start low pressure feed pump
const int lowRelay=12; //Relay that sends 220 VAC to pump
const int pressure=A0; // Pressure switch at rest is N/0 when pressure its N/C
const int highRelay=11; //Relay that sends 220VAC to High Pressure pum
void setup()
{
digitalWrite(27, HIGH); //make RESET pin #27 HIGH to keep it from resetting
pinMode(lowbutton,INPUT); //Start button starts low pressure pump
pinMode(lowRelay,OUTPUT);//relay for low pressure pump
pinMode(pressure,INPUT);//pressure switch
pinMode(highRelay,OUTPUT);// high pressure pump relay
}
void loop()
{
if
(digitalRead(lowbutton)==HIGH)//when button pushed, if it reads 5v
{
digitalWrite(lowRelay,HIGH); //turn on low pressure pump
delay(2000);// delay 2 seconds to let pressure build up
}
if
(digitalRead(pressure)==HIGH)//if pressure switch senses pressure
{
delay(3000);//delay 3 seconds
digitalWrite(highRelay,HIGH);//5v to high pressure relay
digitalWrite(lowRelay,HIGH);//5v to low pressure relay
}
if
(digitalRead(pressure)==LOW)// if pressure switch opens
{
digitalWrite(highRelay,LOW);//turn off high pressure relay
digitalWrite(lowRelay,LOW);//turn off low pressure relay
delay(1000);//wait 1 second
}
}