Hello Guys.I'm working on a home security project, having a text sent to me if certain events occur. One of those events is the detection of smoke. I purchased a Kidde wireless (433Mhz) smoke alarm and am currently able to receive it's signal via a cheap receiver and was successful is using the Arduino's Pulsein(negative transition) to collect pulse data from the alarm. Below are 3 groups. Each group shows pulse width data for different user switch settings on the alarm.
I'm seeking advice on how to compare the incoming data to fixed data in a constant variable. The first number in each row below is the pause between signals sent by the alarm. I suppose that detecting the length of that first number would be the start of collecting data. I'm imagining that any pulse width between a range of say, 360-420 could be assigned a 0 and any pulse width of a range of 780-820 be considered a 1. When determined to be 0 or 1, could those bits somehow be arranged into a binary number? How would that be done? Afterward I could compare it to a binary number stored in the previously mentioned variable. I'm seeking a direction to go with the programming. Please suggest a good way to go about this. Thanks - Scotty
You need to understand how this data is encoded i.e. when an event of interest occurs, how is this represented in the data? Looking at those numbers, it's not obvious what the corresponding signal represents and I have no idea how to derive the data that you're interested in.
What would normally receive the data and what would it do with it? Could you interface to that device?
Can you get a specification for the data? Is it, perhaps, a fire protection industry standard system?
The data you posted seems to fall into 4 categories - a very large number, a number of about 1500, a number of about 800 and a number of about 400. If you think of the data in those terms can you reliably identify which type of signal is being sent?
Even if you can, will your insurance company be happy?
From your data, it looks like 3 events are in fact occurring and the repeatability is very good. The numbers 400, 800 and 1575 seem to jump out (within +-2%) without any anomalies.
When determined to be 0 or 1, could those bits somehow be arranged into a binary number? How would that be done?
Sure - you could use Arduino's bitwise operators and functions.
Thanks for responding, Gentlemen. Perhaps I've not been clear enough. My post is concerning only one event, a smoke detector going off, sounding an alarm. The smoke detector is a type that, when it goes off, transmits an RF signal to other smoke detectors and they will also sound an alarm. The data shown represents the output of an RF receiver that has captured the RF signal when the smoke detector goes off. The RF signal, as viewed on a scope, looks like this:
The Pulsein function sees the low, short pulses as approximately 390usec and the longer low pulses as approximately 800usec.
The output of the receiver is fed to an input pin (7) of an Arduino. The code is below. One line of the data shown in the original post is what is seen, over and over, in the serial monitor.
/*
PulseIn sketch
*/
const int inputPin = 7; // analog output pin to monitor
unsigned long val; // this will hold the value from pulseIn
void setup()
{
Serial.begin(115200);
}
void loop()
{
val = pulseIn(inputPin, LOW);
Serial.println(val);
Are you saying that when there is no smoke detection there is no signal, and when there is smoke detection there is the signal you displayed above?
Yes.
Does the device also put put any other signals that you need to identify as NOT being a smoke detection signal?
No.
Then all you need to do is to characterize enough of the pulse train to make sure that detection would be unique. A few sequential on/off times should suffice.