Hi:
First let me make the boilerplate disclaimer that I am new to Arduino and electronics in general...
My issue is that I have a big Danby air-conditioner with a fancy electronic control panel that I want to run 24 hours per day. And run it does...until there is a power outage. When there is a power outage the a/c turns off (of course) but it doesn't turn back on when the power comes back on. At that point, I have to physically push the little power switch to turn the air conditioner back on.
While searching for a solution to my problem, I discovered and bought an Arduino Decimilia with the idea that I would write a simple sketch that does nothing more than wait 30 seconds after power is applied to it, and then it would simply set a pin HIGH - and I would connect a wire from that pin to the air-conditioner switch to ground...I threw in the extra code just because I liked to see the pin 13 LED flashing with increasing urgency:
// declare variables:
int ledPin = 13;
int switchPin = 8; // digital output pin to the A/C switch
int val = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(switchPin, OUTPUT); // set the switch pin to be an output
do //15 * 1000ms = 15 seconds
{
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
val = val + 1;
} while (val < 15);
val = 0;
do //15 * 500ms = 7.5 seconds
{
digitalWrite(ledPin, HIGH);
delay(250);
digitalWrite(ledPin, LOW);
delay(250);
val = val + 1;
} while (val < 15);
val = 0;
do //25 * 200ms = 5 seconds
{
digitalWrite(ledPin, HIGH);
delay(100);
digitalWrite(ledPin, LOW);
delay(100);
val = val + 1;
} while (val < 25);
val = 0;
do //40 * 100ms = 4 seconds
{
digitalWrite(ledPin, HIGH);
delay(50);
digitalWrite(ledPin, LOW);
delay(50);
val = val + 1;
} while (val < 40);
val = 0;
//At this point 15 + 7.5 + 5 + 4 seconds have elapsed (31.5 seconds)
digitalWrite(ledPin, HIGH);
//Set the switch to flick here...
digitalWrite(switchPin, HIGH);
delay(500);
digitalWrite(switchPin, LOW);
delay(2500);
digitalWrite(ledPin, LOW);
}
Only now do I realize my mistake. As soon as I connect the wires up I'm completing the circuit required to switch on the air-conditioner - regardless of whether pin 8 is high or low - regardless of whether it's running 0V or 5V, the very act of joining the wires creates the cicrcuit that turns on the a/c. And the fact that the circuit remains open means the the fancy control panel locks up until I break the circuit...
I think I need a relay? What does one look like? From what device could I scavenge a relay? Am I able to perform a relay (switching) function using just the Arduino?
Thanks in advance.
Steph