Fire Department alerting system code question.

Hi all,

I'm trying to create an alert system for a Fire Department using arduino. This is the project:

A Fire department has multiple alert tones (paging tones for pagers) for first responders, EMS and rescue teams. We have managed to create an alert system that will turn on a buzzer, activate strobe lights and pass audio to station speakers using a Kenwood radio and several $120.00 timer relays for each desired output (strobes, buzzer, door opener ect). We have tried to cut cost because some of the fire depts are volunteer and dont have the money for expensive setups plus we are limited to what Kenwood supports.

So we have tried CONTROLBYWEB device and some other products with no success. This is what we are trying to accomplish:

When the 911 center send a pager tone to the Fire department we need to be able to discern between a tone for first responders or EMS or Rescue. Then once we are able to discern between tones then we need to make the output for each different tone act differently, for example: For first responders, the buzzer will have a wavering tone( one second on, one second off for 15 second total time) and strobe will flash every 3 seconds. That way the department crew will know is a FIRST RESPONDER call. For EMS and Rescue each tone will have a different output alerting pattern so the crew know who's call it is. We are using a G5 Unication pager and base with one output to listen to the tones being send out by the 911 dispatchers. We managed to change the output timing for each specific tone on the G5 output ( First responders, EMS, and Rescue) 1 second output HIGH for First responder tones, 2 seconds output HIGH for EMS and 3 seconds output HIGH for Rescue on the G5 pager output. We are stuck on the code part of this project, specially on how to tell the Arduino to discern between a one second, a 2 second and a 3 second HIGH pulse on the input to do a specific output for each one of the pulses. Any guidance will be appreciated!

Bryan

Bryan_Burgos:
specially on how to tell the Arduino to discern between a one second, a 2 second and a 3 second HIGH pulse on the input to do a specific output for each one of the pulses.

It would make things a lot clearer if you can post a diagram showing the different types of pulses you want to detect.

And post your Arduino program and a diagram showing all the connections.

If you want to detect a single pulse and check its duration then you need to save the value of micros() when the pulse starts and again when it ends. Subtracting the values will give the duration.

...R

My son has a Raspberry Pi running some code that does just what you are looking for. I'll ask him, tonight, for a list of the programs involved, and the additional hardware that needed to be connected to the Pi. I know the whole thing cost less than $100, including a 5" x 8" display device.

I wrote the last bit of code, that parsed the data that the other programs output, to extract relevant data to show on the display.

Connecting an Arduino to the Pi, and having the Pi tell the Arduino to turn some pins on or off to turn some quite inexpensive relays on or off would still let you construct a pretty complete plug-and-play device for well under $100, if you didn't need the fancy display he has.

This is a very basic diagram of what we are trying to do. the arduino input could be any of the 3 different pulses in the pics. We are new to arduino and to the code writing stuff so we don't have anything started yet. We are just evaluating if Arduino can deliver a solution to our customer. If arduino receive any of the 3 pulses above it should produce an output that will be preprogrammed for each of the input pulses. Can that be done with code?

Are the "tones" single frequency or multiple frequency?

Paul

Paul, the tones are sent from the 911 center at the county level on a VHF frequency using a A/B tone format for pagers like Motorola. We use a pager (G5) programmed to look for those 3 specific tones that receive the VHF signal with the A/B tones and decode it. From that pager, we are able to get a digital output (HIGH) every time the programmed A/B tones are received. Since is just one output on the pager, we programmed the pager output to be a 1 second HIGH for the First responder tones, a 2 second HIGH for EMS and 3 second HIGH for the Rescue tones. So all the arduino will see is a 1 second HIGH, 2 second HIGH or a 3 second HIGH pulse on the input.

We then need the arduino to react to each pulse with a different output. If it receives a 1 second pulse then the output should do "X" if it receives a 2 second pulse it should do "Y" or if it receives a 3 second pulse it should do "Z". Hopefully :o

Bryan_Burgos:
Paul, the tones are sent from the 911 center at the county level on a VHF frequency using a A/B tone format for pagers like Motorola. We use a pager (G5) programmed to look for those 3 specific tones that receive the VHF signal with the A/B tones and decode it. From that pager, we are able to get a digital output (HIGH) every time the programmed A/B tones are received. Since is just one output on the pager, we programmed the pager output to be a 1 second HIGH for the First responder tones, a 2 second HIGH for EMS and 3 second HIGH for the Rescue tones. So all the arduino will see is a 1 second HIGH, 2 second HIGH or a 3 second HIGH pulse on the input.

We then need the arduino to react to each pulse with a different output. If it receives a 1 second pulse then the output should do “X” if it receives a 2 second pulse it should do “Y” or if it receives a 3 second pulse it should do “Z”. Hopefully :o

Ok, that makes sense. No tone is involved, Just determining the length of time for a “high” signal from the receiver.

The important Arduino features for you to learn, then, are: how to use the millisecond counting feature and how to program a state machine. Both are well described with examples in the tutorials.

Should be an easy program to write, but harder to test without getting the dispatcher involved.

Paul

Thanks Paul!, now we have a lead to follow!

Paul_KD7HB:
Should be an easy program to write, but harder to test without getting the dispatcher involved.

It may be worthwhile using a second Arduino to generate test pulses.

...R

I have the test equipment to generate the VHF radio signal with the necessary tones and I have the G5 pager to generate the pulses to the input of the arduino. What we are looking for is guidance on how we can write a code so the arduino can scan the input ( digitalRead) and if:

input pulse detected is >0 but <1 second then output pin 2 = HIGH

if

input pulse is >2 but <3 seconds then output pin 3 = HIGH

if

input pulse is > 3 seconds then output pin 4 = HIGH

As you can see I’m trying to get the logic worked out, specially without any code writing experience. If any of you knows of a good tutorial on something like this it will be appreciated!

Bryan

Bryan_Burgos:
I have the test equipment to generate the VHF radio signal with the necessary tones and I have the G5 pager to generate the pulses to the input of the arduino. What we are looking for is guidance on how we can write a code so the arduino can scan the input ( digitalRead) and if:

input pulse detected is >0 but <1 second then output pin 2 = HIGH

if

input pulse is >2 but <3 seconds then output pin 3 = HIGH

if

input pulse is > 3 seconds then output pin 4 = HIGH

As you can see I’m trying to get the logic worked out, specially without any code writing experience. If any of you knows of a good tutorial on something like this it will be appreciated!

Bryan

Right track, but you only need to detect when the pulse goes high and when it goes low. And count the time since it went high. Then determine which of the three categories the time falls into.

Paul

Paul,

No better way to learn that digging it for yourself! you got me looking pretty good around but I will figure it out

Bryan_Burgos:
Paul,

No better way to learn that digging it for yourself! you got me looking pretty good around but I will figure it out

Great attitude! Remember to have a 4th condition for when "time" doesn't fit the three possible parameters. Turn on an error LED, or something.

Paul

Bryan_Burgos:
I'm trying to create an alert system for a Fire Department using arduino. This is the project:

I hope no lives are going to depend on your handiwork.

And your photobucket link is broken. Please attach images to posts in this forum - then at least the thread still makes sense after such a third party decides to break all their existing links.