Firehouse Alerting System

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?

Are the grounds on the pager and arduino the same?

As far as from a power standpoint, no. They are powered using different supplies. As far as the circuit's concerned, the ground goes from the arduino, stops at the pager until the relay is closed, and then travels back to the arduino's input pin.

Are you able to put the pager next to the Arduino and hence remove the long wire that can pick up noise? Otherwise put a capacitor 0.1uF across the input to the Arduino.

Weedpharma

weedpharma: Are you able to put the pager next to the Arduino and hence remove the long wire that can pick up noise? Otherwise put a capacitor 0.1uF across the input to the Arduino.

Weedpharma

I would prefer not to move it, but if necessary I can. As far as putting the capacitor across, are you referring to putting one leg of the capacitor in the input pin and one in ground on top of my current setup? Or should I ditch the pull-up resistor.

Also, a little add. It seems as though the false alarms have gone down, it's only done it twice in the last 2 days - but both times have been a little after 11:30 PM

You still need the pull-up. Put the C from input to ground.

Weedpharma

weedpharma: You still need the pull-up. Put the C from input to ground.

Weedpharma

Okay, thank you. I'll try that tonight. I believe I have that type of capacitor. If you would, could you quickly explain the technical reason for this just so I know?

I would suggest that you create a simple wiring diagram. a hand sketch is good enough.

I would offer that if you do not want to tie all the grounds together, you can couple the different devices with an optocoupler. these are super simple. one side is an LED, you use a resistor on it just like any LED. there other side is a transistor. this is the Arduino side. you feed it with a resistor and tie the input to your pin on your arduino.

when the other circuit turns on, the LED inside lights, the transformer changes state and the power to your pin goes to ground indicating a change. the logic is reversed, it is high with no signal, low with a signal.

The C acts as a short circuit to the electrical noise picked up by the wires.

Weedpharma

weedpharma: The C acts as a short circuit to the electrical noise picked up by the wires.

Weedpharma

Okay. My goal is to make the system tolerate any electrical noise. I only want the activation to happen when the system is truly reading a confirmed LOW on Pin 3 and never any time else. With the pull up resistor on the pin and the capacitor in place, that should solve the unexpected activations?

It seems very odd that these false trips happened at the exact same time two nights in a row....

mpaine: It seems very odd that these false trips happened at the exact same time two nights in a row....

This would be a good clue as to what is happening. What switches at that time? Is the wire nearby?

Weedpharma

weedpharma: This would be a good clue as to what is happening. What switches at that time? Is the wire nearby?

Weedpharma

That's the puzzling part. I will have to investigate that more. Right now I just need to find a way to shield my system from that type of interference.

All - I have attached a quick wiring diagram to my original post.

I have also now added my code.

It is preferred that any major changes and additions are made in sequence rather than in the OP. It is then easier to follow.

Weedpharma

weedpharma: It is preferred that any major changes and additions are made in sequence rather than in the OP. It is then easier to follow.

Weedpharma

My apologies. Totally didn't know that. Here it is below for ease of use:

// 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);
 }

}

Are the Bells inductive?

LarryD: Are the Bells inductive?

To be honest, I'm not sure. They are standard fire alarm bells that you would see attached to a fire system. They operate under the principle of a vibrating plunger that strikes the bell repeatedly until the current is disconnected. As far as if they use a magnetic coil or not, I am not sure.

These can be very very noisy ( electrically speaking ;) ) Better make sure you use spike suppression as they may cause intermittent hardware problems.

https://en.m.wikipedia.org/wiki/Transient-voltage-suppression_diode Also Google MOV .

Two suggestions that you might want to try:

1) Long runs of wire can pick up electrical noise as they are effectively antennas. If you twist the signal and return wires together, say put on end in a power drill and twist it to get nominally one turn per inch or so, that will cancel most of the noise pickup. This is common practice in long signal wires, ethernet cable, for instance is multiple sets of "twisted pair" signal and return wires.

2) On the chance that the alarm bell is inductive, and I'm guessing it is, you should have a a reverse biased rectifier diode (e.g. 1N4001) in parallel with the alarm bell. An inductor resists changes in current flow through it and when an inductive circuit is opened this results in a large voltage spike across it's terminals with reverse polarity to the applied voltage. The diode gives the "fly back" current a place to go, thus suppressing the voltage spike. Without this, the voltage spike will appear across your relay, potentially causing damaging sparking across the contacts.