I've always been interested in arduino, and thought this project at work might be a good place to jump in.
I have a float switch that runs on .17amps (120vac). When the switch activates, I want it to go through arduino, add a 60 second delay, and than switch a relay to turn on my 120vac pump. I dont know what I want to accomplish is even called, so I have no idea what to search for. Any advice is greatly appreciated. Thank you
The safest approach IMO would be disconnect the float switch from the HVAC and use it as a low voltage switch to control an Arduino input. Then use an output from the Arduino to operate a PowerSwitch Tail or similar to control your HVAC load.
The software to turn the output on a defined interval after the switch changes would be trivial.
The float switch just closes to turn the curcuit on or off. a relay would be needed for the pump since its like 1.5amps.
PeterH:
The safest approach IMO would be disconnect the float switch from the HVAC and use it as a low voltage switch to control an Arduino input. Then use an output from the Arduino to operate a PowerSwitch Tail or similar to control your HVAC load.
The software to turn the output on a defined interval after the switch changes would be trivial.
If the float switch operates at 120v, i cant really bring it any lower for an arduino input correct? I could use another relay to bring it down, but since my only power inside the box is 120vac i cant think off of the top of my head how to do it. I would also need the program to turn the pump off when the switch opened back up, but I agree I think both software needs are trivial.
Well you could plug your Arduino into it via a wall-wart. Then it powers up and waits a minute and then turns the pump on. Although I would have thought you could do something similar with a simple circuit.
Well the float switch you linked to at McMaster carr should be able to be treated just like any other switched input for arduino - remove the wires fro the 120V running through it and to the pump. The wire the float up like any other switch to a digital input. then connect up a suitable relay board to switch the 120V hot to the motor. Then write the code - if input -> wait 60 seconds -> turn on output
I tested out the board, with no luck. I ran a jumper from 5v to pin8, and put a volt meter at pin9, and grounded it to the ground. After 10 seconds, nothing happened. My code is below. what did I miss?
const int SwitchPin = 8; // pin that the switch is attached to
const int PumpPin = 9 ; // pin that the pump relay is attached to
void setup() {
pinMode(SwitchPin, INPUT);
pinMode (PumpPin, OUTPUT);
}
void loop() {
if (digitalRead(SwitchPin) == HIGH )
{
delay(10000) ;
digitalWrite(PumpPin, HIGH);
}
else
{
digitalWrite(PumpPin, LOW);
}
}
Well it is doing that 10 second delay every time through the loop. You should really be looking for a transition to turn it on in the first place, and then not have the delay each time through.