Shop OBEX P1 Docs P2 Docs Learn Events
Need Wireless programming help — Parallax Forums

Need Wireless programming help

daddyjk44daddyjk44 Posts: 5
edited 2014-04-22 11:01 in General Discussion
I am trying to make a wireless rocket launching system using basic stamp and 2 wireless 433mhz transceivers. The problem I am running into is that I cannot find any reference material to do a simple task like sending a signal to the remote unit to make a pin go high to trip the relay for launch. any programming help would be appreciated.

Comments

  • PublisonPublison Posts: 12,366
    edited 2014-04-21 17:04
    daddyjk44 wrote: »
    I am trying to make a wireless rocket launching system using basic stamp and 2 wireless 433mhz transceivers. The problem I am running into is that I cannot find any reference material to do a simple task like sending a signal to the remote unit to make a pin go high to trip the relay for launch. any programming help would be appreciated.

    Welcome to the forums!

    All the code you need to get started with is on the product page:

    http://www.parallax.com/product/27982

    Click on the downloads section and read all the documents and code.

    http://www.parallax.com/search?search_api_views_fulltext=+433mhz+transceivers

    Please post back if you have specific questions.
  • daddyjk44daddyjk44 Posts: 5
    edited 2014-04-21 18:22
    Thanks for the reply. The problem I have, being a complete novice, is using the code to tell the receiving board to have for instance P5 go high to close a relay to have main battery fire the igniter. I see where this code will send a message but how do I use it to have the remote receiver perform a subroutine.
  • kwinnkwinn Posts: 8,697
    edited 2014-04-21 19:25
    The remote receiver has to have code that receives the message and decode it. For example you could have the transmitter send the characters "S" and "5" and have the receiver compare the first character to "S". Then it would call or jump to a routine that sets pins, and that routine would subtract "0" from the second character to get the pin number. Typically most of this is done with nested if statements or a case statement.
  • daddyjk44daddyjk44 Posts: 5
    edited 2014-04-21 19:54
    is this done with the serout/serin comands?
  • kwinnkwinn Posts: 8,697
    edited 2014-04-21 20:16
    Yep. Serout on the transmit end and serin on the receive end. Once you have received the data you need to analyze it so the program can determine what to so with it.
  • daddyjk44daddyjk44 Posts: 5
    edited 2014-04-21 20:28
    So, if I finish my countdown and @0 the code says to GOTO Launch sequence, That sequence should look something like this?:

    ' Tcvr_TxCode_v1.1.bs2

    '{$STAMP BS2}
    '{$PBASIC 2.5}



    HIGH 1 ' T/R Line

    DO
    PULSOUT 0, 1200 'Sync pulse for the receiver
    SEROUT 0, 16468,
    HIGH5 ' tells P5 to go high
    PAUSE 10000 ' hold high for 10 sec
    LOW5 ' tells P5 to go low
    END
  • MoskogMoskog Posts: 554
    edited 2014-04-21 23:44
    Maybe use something like this on the transmitter:

    ignition = 5
    PULSOUT TX, 1200
    SEROUT TX, Baud, [ "U!"] 'Syncbytes
    SEROUT TX, Baud, [ignition] 'Send the trigger Byte


    And on the receiver side:

    SERIN RX, Baud, [ WAIT("U!")] 'Wait until U! is received,then read the command byte (ignition)
    SERIN RX, Baud, [ignition]
    IF ignition = 5 THEN
    HIGH 5
    PAUSE 10000
    LOW 5
    ENDIF
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2014-04-21 23:59
    The main thing is safety first! Simple 433MHz transceivers do not include any error detection/correction like the XBee modules do. So you have to make certain that the receiver does not respond to errant signals or noise to produce a premature launch. Once all personnel have been removed to a safe distance from the launch site, the brest way to do this is to require the receiver on the rocket to wait for a particular multi-character sequence to arm itself for lift-off and to respond to the host that it's ready. Then liftoff itself can be accomplished at the end of the countdown sequence by a blast of multiple launch commands -- only one of which the receiver will need to ignite the fuel.

    -Phil
  • MoskogMoskog Posts: 554
    edited 2014-04-22 04:43
    The main thing is safety first! Simple 433MHz transceivers do not include any error detection/correction like the XBee modules do. So you have to make certain that the receiver does not respond to errant signals or noise to produce a premature launch. Once all personnel have been removed to a safe distance from the launch site, the brest way to do this is to require the receiver on the rocket to wait for a particular multi-character sequence to arm itself for lift-off and to respond to the host that it's ready. Then liftoff itself can be accomplished at the end of the countdown sequence by a blast of multiple launch commands -- only one of which the receiver will need to ignite the fuel.

    -Phil

    Of course, an ignition sequence should not be trigged by a simple "5" to be received. My code was just meant to show the very basics in a TX-RX system, a simple respond to his last post. Now its up to daddyjk44 and his team to work out a good error handling code and other safety handling routines. I guess the forum members are ready to help!
  • daddyjk44daddyjk44 Posts: 5
    edited 2014-04-22 11:01
    Thanks for the help. No team. Just me. I'm doing this for a school project but would love to build this so my sons can get the interest in both of these great hobbies.At 11 & 9 they think these things are cool and are just bright enough to get a good handle on this and take it to the next level.
Sign In or Register to comment.