Hello all,
I'd like a little feedback on a project I'm currently working on if it's possible. I am a Lieutenant at a volunteer fire department and for a couple years now we have had an in-house alerting system to enunciate when we receive calls. This was always achieved with a few relay timers, a couple power supplies, some 24VDC bells and some 12VDC led lights and, of course, an input. Recently, I bought an arduino to add capabilities to the system and allow for future expand-ability.
Let me lay it all out so it's easy to understand.
The Input
What we have as far as a "trigger" is a Motorola series pager base which, upon activation, has a contact in it that closes for ten seconds, and then reopens. This base is about 25 feet from the arduino and is linked to it by a pair of unshielded wires.
The Controller
The arduino uno board with relay shield. The relay shield is connected to another relay panel which I already had in service and allows my bells and lights to be fused and protected.
The Outputs
Basically, I have three outputs. The first is the audiblePin, which activates the relay for the 24VDC bells. The second is the visualPin, which activates the relay for the 12VDC led lights that blink on the walls. The third is bunkroomlightPin which will, in the future, activate 4 white led lights in the sleeping quarters to assist firemen on their way out.
The Problem
Here is my issue. At first, I just had my system set up with a "floating" input and I was getting false triggers all the time. I researched and found out about the pullup resistors and that cured my ailments...at least for a little bit. Within 24 hours I had a single false activation. I then thought to get a different resistor. I disabled my internal pullups and added an external 3.3k resistor hoping my false alarm problem would be solved. Not so. After about 7 hours of that being in service, at 11pm, it went off again - with no input from the pager base.
Attached is a quick wiring diagram. Also see the below code.
// definitions and setup:
// Future Use
// delay(360000); // wait 360000 milliseconds (6 minutes) 360000
// digitalWrite(bunklightPin, LOW);
// Pin Definitions
const int audiblePin = 7; // bell circuit
const int visualPin = 6; // red/blue LED circuit
const int bunklightPin = 5; // bunk room light activation
const int pagerPin = 3; // motorola pager activation
// Variables
int pagerState; // current state of the pager
void setup() {
pinMode(audiblePin, OUTPUT);
pinMode(visualPin, OUTPUT);
pinMode(bunklightPin, OUTPUT);
pinMode(pagerPin, INPUT);
}
void loop() {
pagerState = digitalRead(pagerPin);
if (pagerState == LOW) {
digitalWrite(audiblePin, HIGH);
digitalWrite(visualPin, HIGH);
delay(3000); // wait 4000 milliseconds (4 seconds) 4000
digitalWrite(audiblePin, LOW);
delay(360000); // wait 360000 milliseconds (6 minutes)
digitalWrite(visualPin, LOW);
if (pagerState == LOW) {
// if the current state is HIGH then the button
// went from off to on:
digitalWrite(audiblePin, LOW);
digitalWrite(visualPin, LOW);
}
else {
// Delay a little bit to avoid bouncing
delay(5000);
}
}
else {
digitalWrite(audiblePin, LOW);
digitalWrite(visualPin, LOW);
}
}
I am not sure what my next step should be. Should I try a lower resistor? Am I doing something wrong? I can post the code this evening as an edit to this thread but until then does anyone have any ideas?