Hi,
I've installed a temporary doorbell button, using Moteino, button from Arduino kit and ~10m utp cable.
When Moteino detects a button press, it sends a "RING" command to other Moteino (doorbell node), so it triggers chime.
Everything works fine, except that sometimes it rings randomly, without button press, which is kinda scary if it rings in the middle of the night
That random event is not that common, it happens every few days or so.
My question is if this is a hardware problem, like occasional short circuit or am I detecting button press wrong.
Here is part of the code that I'm using for reading button state:
#define RING_PIN 14
void setup() {
SERIAL_BEGIN;
pinMode(RING_PIN, INPUT_PULLUP);
}
void loop() {
...
if (digitalRead(RING_PIN) == 0) { //0=button is pressed
ring();
}
}