Firstly, here is the final Arduino code that I am using, its as best to perfect as I can get at present with only one real hiccup.
int ledPin = 13; // LED connected to digital pin 13
int potPin = 0; // white doorbell wire to analog pin 0
int val = 0;
long time = 0;
long debounce = 1000;
void setup() {
pinMode(ledPin, OUTPUT); // sets the digital pin as output
Serial.begin(9600); // open serial port at 9600 baud
digitalWrite(14 + potPin, HIGH); // set pullup on the analog pin
// (analog 0 = digital 14, a1 = d15, etc)
}
void loop() {
val = analogRead(potPin);
if (val < 200) { // if the circuit is completed
// (for me, it generally drops from 1023 to ~ 15 when 'ringing')
if (millis()-time > debounce) {
Serial.println("ON");
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // ...wait for 2 seconds
digitalWrite(ledPin, LOW); // and turns the LED off
time = millis();
}
}
}
I cannot take credit for this code please see this post http://rooreynolds.com/2008/05/14/hacking-the-doorbell/ for the original code, I have just modified aspects to suit my needs.
What this will do is when the button is pushed, it will light the test LED and send the "ON" text via the arduino to your pc's com port.