Arduino POE Ethernet (doorbell>iPhone)

Hi my first post and total newbie so please be gentle.

I've searched and can't find exactly my answer so I'm asking. I've got a Arduino Ethernet POE (powered by POE) setup in my garage Wired up to my door bell push via 6m of cat6 (unshielded). The door bell push is N/O and one wire runs back to 5v and the other to Pin7, I also have a pull down resistor between pin7 and Ground. I'm using the sketch provided by pushingbox as a go between server to get the signal out of my arduino in to prowl for notifications. the only mod I made to the sketch was to change from the standard Pin3 to Pin7.

Now I tested it before I ripped out our normal doorbell and it worked perfectly. Installed it and it still seemed to work as expected, but after a while we started to get lots of random notifications of door bell pushes at totally random times of the day (3am was a great one yesterday)

I'm assuming the arduino is picking up random noise, maybe in the long wire from the arduino to the push (it's not near any other cables anywhere in its length). I tried disconnecting the cat6 that runs off to the doorbell and left it and the randomness stopped plugged them back in and it started. I've also removed the quick push in connectors on the arduino and soldered the wires and resistor directly to the contacts to remove loose connections from the equation.

Would something like hardware/software debounce stop the random noise or am I looking in totally the wrong direction?

Any help would be appreciated

Hi Lee, and welcome to this excellent forum. :slight_smile:

My first thought would be to check the pull-down resistor. What value do you use?

Also; When you use an arduino pin as a digital input, it is possible to make use of the internal pull-up resistors in the chip.
-So when you use an external pull-down resistor, you should verify that the internal pull-up is disabled.

Here is the reference link, describing the internal pull-up resistors:

If you have a multimeter, try to measure the input pin on the arduino (pin 7 in your project):

  • when the doorbell is pressed
  • when the doorbell is not pressed

What are the voltages?

This sounds like a classic debounce problem. You're likely to be getting a short duration transient spike from something in the house that is being picked up by the wire to the doorbell button acting as an antenna. Try one of the many debounce techniques that are posted on the web. Hardware (capacitors and smaller value resistors, etc) or software, this will probably fix it.

Hi thanks for the replays.

The pull down resistor is a 10k and I tested it and it came out at 9.99k so not too bad I guess.

The voltage un-pressed is 1.2v between Ground and Pin7
The voltage pressed is 5v as above^

Tried changing the pin from 7 to 3 which is standard for the sketch and tested. Same voltages as above and left it running all day today. Same randomness gone off 3 times with no button presses in about 10h.

Are these voltages normal?

I'm now looking in to the hardware debouncing. Looks relatively simple to implement. Is this the way I should proceed?

Thanks

I generally try to use a pull UP resistor; not because it's better, but just personal preference. I prefer it because with a pull up resistor you have source voltage at the switch and that gets shorted directly to ground. Makes it easier to measure. YMMV. It's easy to change this in the code if you want to pursue it.

I also prefer software debounce, not because it's better, just because I have more control of it by changing some values in code and reloading the board. I would, however, put a small value capacitor on the leads coming back from the switch to short circuit any RF that may be getting in there from some appliance somewhere. I think I've been using .01 uf for this kind of thing. The reason I can't remember is that I picked up a bag of them and lost the label. It's too much trouble to look it up as lazy as I am.

I've searched and can't find exactly my answer so I'm asking.

You don't show your code, so no telling what is going on there. You may want to test the below approach for button pushes where the pin is made high, then pulled low to ground thru the button.

#include <Servo.h>
int button1 = 4; //button pin, connect to ground thru button 
int press1 = 0;
int button2 = 5; //button pin, connect to ground thru button 
int press2 = 0;
Servo servo1;

void setup()
{
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  servo1.attach(7);
  digitalWrite(4, HIGH); //enable pullups to make pin high
  digitalWrite(5, HIGH); //enable pullups to make pin high
}

Hi here is the code code that im using copied from the pushingbox.com website.

////
//
// General code from http://www.pushingbox.com for Arduino + Ethernet Shield (official)
//
////

#include <SPI.h>
#include <Ethernet.h>

/////////////////
// MODIFY HERE //
/////////////////
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x19 }; // Be sure this address is unique in your network

//Your secret DevID from PushingBox.com. You can use multiple DevID on multiple Pin if you want
#define DEVID1 "Your_DevID_Here" //Scenario : "The mailbox is open"

//Numeric Pin where you connect your switch
#define pinDevid1 3 // Example : the mailbox switch is connect to the Pin 3

// Debug mode
#define DEBUG true
///////
//End//
///////

char serverName[] = "api.pushingbox.com";
boolean pinDevid1State = false;

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
Serial.begin(9600);
pinMode(pinDevid1, INPUT);

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
else{
Serial.println("Ethernet ready");
}
// give the Ethernet shield a second to initialize:
delay(1000);
}

void loop()
{
////
// Listening for the pinDevid1 state
////
if (digitalRead(pinDevid1) == HIGH && pinDevid1State == false) // switch on pinDevid1 is ON
{
if(DEBUG){Serial.println("pinDevid1 is HIGH");}
pinDevid1State = true;
//Sending request to PushingBox when the pin is HIGHT
sendToPushingBox(DEVID1);
}
if (digitalRead(pinDevid1) == LOW && pinDevid1State == true) // switch on pinDevid1 is OFF
{
if(DEBUG){Serial.println("pinDevid1 is LOW");}
pinDevid1State = false;
//Sending request to PushingBox when the pin is LOW
//sendToPushingBox(DEVID1);
}
}

//Function for sending the request to PushingBox
void sendToPushingBox(String devid){
if(DEBUG){Serial.println("connecting...");}

if (client.connect(serverName, 80)) {
if(DEBUG){Serial.println("connected");}

if(DEBUG){Serial.println("sendind request");}
client.print("GET /pushingbox?devid=");
client.print(devid);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(serverName);
client.println("User-Agent: Arduino");
client.println();
}
else {
if(DEBUG){Serial.println("connection failed");}
}

// if there are incoming bytes available
// from the server, read them and print them:
if(DEBUG){
if (client.available()) {
char c = client.read();
Serial.print(c);
}
}

if(DEBUG){Serial.println();}
if(DEBUG){Serial.println("disconnecting.");}
client.stop();
}

PushingBox_Arduino_V1_0_Ethernet_Official.ino (2.8 KB)

Yep, this looks like a classic case of needing debounce. If it were me I would reverse the logic to use a pull up resistor, add a cap to remove any residual RF that may be getting to the wire, and add some debounce logic to the code. A lot of this can be done easily by using the button library from the playground. It will turn on the pullup resistor in the chip and handle the debounce for you. There are a hundred other methods that will work, but I'm familiar with this one.

Hi I've just managed to get round to sorting this out thanks to your suggestions. Used a 10k resistor to pull up. Switch going to ground with a 10uF cap across it. Reversed the logic in the sketch. Been running for a hour and no false triggers so far (Fingers Crossed). Can't see how it could false trigger now though as pin 3 is high already so any induced voltage in the wires couldn't make it go low surely.

Thanks for all the help

Much appreciated.

I just did something that might help you out.

Check it out. Didn't need any pull up or pull down resistor. Instead I used a voltage sensor.

Take a look here:

Hi yea that looks great. I'm starting to realise the power the arduino could have for home automation for sensing and controlling. Your setup would be ideal for me to notify of audio output on pretty much any av equipment. This was only my first project but I'm thinking I could be hooked on this. It's great fun to play with. Lee

does anyone know how to mode the code for more than one switch or doorbell and send it out to pushing box? i would like to know which door is being rung say the front or back. but i need it to have more than one switch.

Hi All,

I'm totally new in this Arduino and pushing box. Managed to find the officiall code from pushingbox.com via Make: Projects

and try our step by step of hardware/software set up, but still could not get notified sms when pressed the doorbell. Can you all help me with it?

Follow the instruction, i changed the mac address which found at the sticker of ethernet shield, and copy/paste the devid code from senarios, please guide me beside these 2, whereelse i need to change?

Thanks for your help, and any guides/suggestion will be much appreciated.