Shop OBEX P1 Docs P2 Docs Learn Events
Alarm Using the SX28 and Parallax 433.92 MHz RF modules — Parallax Forums

Alarm Using the SX28 and Parallax 433.92 MHz RF modules

dbjdbj Posts: 75
edited 2007-06-22 06:39 in General Discussion
Want to make three transmitters and one receiver connected to a sensaphone for alarm system for construction site, transmitters will be powered by batteries and have a simple normally closed contact on craw space door or any other doors. Would like to run several transmitters and one base receiver connected to a sensaphone. If transmitter one is activated it·sends a·coded signal to to a base that triggers the #1 contacts on the sensaphone, calling and identifying the site·of·the break in. We are battling the copper theft's that have stripped the wires out of buildings not just once but twice, this is a nationwide epidemic any suggestions would be much appreciated. Have found·construction sentry's online costing from $5000·and up.

Comments

  • Kevin WoodKevin Wood Posts: 1,266
    edited 2007-06-04 07:55
    You might want to take a look at these: www.selmaware.com/appbee/home.htm.

    Also, protoboard prices being what they are, you might consider using an SX48 or Propeller. You would have more design flexibility at about the same cost.
  • dbjdbj Posts: 75
    edited 2007-06-10 06:28
    I have·4 transmitters and one receiver Parallax 433.92 MHz. Would it be ok to have the receiver waiting for a signal to come in from the transmitters with a sync PULSOUT and then a identifier of some sort that would make a specific Pin go High. Should this identifier be binary or Hex? I am planning on using·the SX 28 to run each·transmitter·which will be in·4 different locations within range of the receiver·that will be ran by a BS2 Stamp.The·BS2 will be connected to a sensaphone dialer with 4 different alarm inputs for 4 locations , Is it best to have the transmitter powered off·so that all are not transmitting·at the same·time or could I use the PDN pin on TX to start transmission of the signal? ·I have tried to write some code for the SX 28 to send out serial data it·seams to be working but I am confused about how·to match the baud rates of the BS2 and the SX 28. Thanks David

    Post Edited (dbj) : 6/10/2007 6:32:56 AM GMT
  • dbjdbj Posts: 75
    edited 2007-06-10 18:18
    ·· Would it be ok to use the SX28 and enable the sleep mode and have the alarm event wake up the SX and then enable the transmitter by pulling the power down pin high, then send sync pulse followed by a loop containing the identifier·data string·that tells the BS2 which transmitter is active so that it can activate the proper alarm input on the sensaphone. Also should there be a reset based on time so that the alarm if triggered it will reset its self and return to sleep mode. I have been trying to find some examples of appropriate sync pulse code for the SX28.·Also should the internal clock be used or a external oscillator? Thanks David
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-06-13 01:15
    dbj said...

    Would it be ok to use the SX28 and enable the sleep mode and have the alarm event wake up the SX and then enable the transmitter by pulling the power down pin high, then send sync pulse followed by a loop containing the identifier data string that tells the BS2 which transmitter is active so that it can activate the proper alarm input on the sensaphone?
    This sounds like a good plan to me!
    dbj said...
    Also should there be a reset based on time so that the alarm if triggered it will reset its self and return to sleep mode.
    You could do that to save battery power. Whatever state change triggers your alarm, say High-to-Low, just finish transmitting then go to sleep and wait for the opposite condition to occur. This will indicate that the alarm condition has been cleared. So just have the SX go back to sleep yet again, this time waiting for another High-to-Low event signaling a new alarm condition.
    dbj said...
    Also should the internal clock be used or a external oscillator?
    Definitely go with an external oscillator or resonator. You will want stable timing for sending serial data over the temperature range your construction site will see.

    I hope this helps.

    - Sparks
  • dbjdbj Posts: 75
    edited 2007-06-13 02:41
    Thanks Sparks I have code to wake up SX28 and power up the transmitter, have sent the sync pulse to the transmitter and verified the output, I can't get the baud rates to match the SX28 running at 4_000_000 MHZ , it is paired with the transmitter and the recever is paired with a BS2, should I use a BS24 insted ?
    The data packet that I send as the Identifyer for witch transmitter is sending a alarm, what would be most efficent data type to send to the recever?
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-06-13 03:08
    I am not sure what you mean about having trouble matching the baud rates. If you match them they should both be the same. Pick something SLOW… like maybe 2400 baud. The radio links might have a minimum data rate setting so do not go below that. Otherwise, since you are not sending much data but you want it to arrive without errors I recommend transmitting at a relatively slow rate.

    You could transmit a full-fledged packet with header, payload and checksum values or just send a single identifier byte. Whatever you send I would send it several times to help ensure that it is actually received. To further reduce errors you may want to select identifiers that differ by than more than a single bit.

    For testing the serial settings you can set the radios aside and just connect the serial signal from the SX to the BS2 along with a ground line provided that both are running at five-volt levels.

    - Sparks
  • dbjdbj Posts: 75
    edited 2007-06-13 23:13
    Well here is snapshots of optiscope same settings on both, the first one is data coming out of receiver with Battery power and 5 V regulator and the second one is of the data input pin coming from RB.0 of the SX28, with the PULSOUT RB.0, 1200. Is it the SX Possessor Speed that is doing this? You would thank that the data going in the transmitter would come out the same, I have heard that the max that baud that the· Parallax 433.92 MHz transmitter and receiver will do is 9600 but the specs say 1200~19.2k Thanks David

    Post Edited (dbj) : 6/13/2007 11:34:10 PM GMT
  • dbjdbj Posts: 75
    edited 2007-06-16 04:03
    Well has to be noise that the recever is getting, I think my neighbor has a wireless network conection, also have cell tower nearby.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-06-18 22:32
    dbj,

    I will try to break this to you gently. Your present TX1.SXB code is not well written. (I understand SX/B may be new to you. Many of us have made similar mistakes while we were learning.)

    Here are some of the problems.
    • 1.) The program as written will make only one check of the alarm trigger before ending. To check continuously add something like “GOTO Main” at the end of your program.
    • 2.) The PUSLEOUT command is expecting a Duration value not a quoted string. In my opinion the compiler should report an error in this case. Replace your "OT9600" entry with a number representing how many 10ms durations you want the pulse to last.
    • 3.) The SEROUT command expects to send a single byte serially. You are attempting to use it to try to send an entire string. This is a common misunderstanding of how the command works under SX/B. Again, I think the SX/B compiler should generate an error under this condition but it does not seem to do so at this time.

      To send an entire string check out the LCD_OUT subroutine of the RFID Reader Interface example in the SX/B Help file. It demonstrates the passing of string data to a subroutine, which in turn uses the SEROUT command to send the data serially one byte at a time.
    • 4.) While technically not a problem, the ELSE statement and the NOP command are not necessary and can be omitted.
    Other than that, you appear to be on the right track. Let us know how it goes.

    - Sparks
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-06-18 23:50
    You should probably work out the communications issues before worrying about power saving. I've attached a couple demo programs that will get you going in the right direction. Once you get the communications working, then you can adjust the transmitter program for power savings on that end. Deal with one aspect of your project at a time -- this will help you get to the desired end result faster.

    Post Edited (JonnyMac) : 6/19/2007 12:01:14 AM GMT
  • dbjdbj Posts: 75
    edited 2007-06-20 02:02
    ·· Thanks JonnyMac this is why your a Star!! thanks Sparks! Does any one have any sugestions for learning serial data? I have a optiscope and would like to understand what I am looking at. Thanks Davidroll.gif
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-06-20 02:22
    You're welcome.

    This article may help you understand the nature of transmitting serial data: http://www.parallax.com/dl/docs/cols/nv/vol6/col/nv117.pdf
  • bennettdanbennettdan Posts: 614
    edited 2007-06-22 06:39
    dbj,
    The book "Serial Port Complete" is a great start.
    http://www.amazon.com/Serial-Port-Complete-Jan-Axelson/dp/0965081923
Sign In or Register to comment.