Shop OBEX P1 Docs P2 Docs Learn Events
transmitted temperature data by 912mhz parallax module to 912mhz reciever the v — Parallax Forums

transmitted temperature data by 912mhz parallax module to 912mhz reciever the v

TomvnTomvn Posts: 103
edited 2009-10-23 05:22 in BASIC Stamp
hI all , I transmitt temperature from bs2 to other bs2 via 912mhz module but the reciever show the value not correct ,anybody know how?

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-03 17:17
    Tomvn,

    Please post the code that you are using for your project.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-03 18:33
    Hi Beau.
    · here transmitter
    main:

    DO
    GOSUB SHT_Measure_Temp
    DEBUG CRSRXY, 0, 3,
    "soT...... ", DEC soT, CR,
    "tC....... ", DEC (tC / 10), ".", DEC1 tC, DegSym, " ", CR,
    "tF....... ", DEC (tF / 10), ".", DEC1 tF, DegSym, " "
    SEROUT Tx,84,[noparse][[/noparse]tC]
    SEROUT Tx,84,[noparse][[/noparse]soT]
    SEROUT Tx,84,[noparse][[/noparse]tF]
    GOSUB SHT_Measure_Humidity
    DEBUG CRSRXY, 0, 7,
    "soRH..... ", DEC soRH, CR,
    "rhLin.... ", DEC (rhLin / 10), ".", DEC1 rhLin, "% ", CR,
    "rhTrue... ", DEC (rhTrue / 10), ".", DEC1 rhTrue, "% "
    PAUSE 1000
    LOOP
    END
    RETURN


    Here reciever.

    receiver_temp_data:
    SERIN rx, 84, [noparse][[/noparse]soT]
    SERIN rx, 84, [noparse][[/noparse]tC]
    SERIN rx, 84, [noparse][[/noparse]tF]
    DEBUG CRSRXY, 0, 3,
    "soT...... ", DEC soT, CR,
    "tC....... ", DEC (tC / 10), ".", DEC1 tC, DegSym, " ", CR,
    "tF....... ", DEC (tF / 10), ".", DEC1 tF, DegSym, " "
    ·SEROUT 1,84,[noparse][[/noparse]HOME,"tC....... ", DEC (tC / 10 + 4), ".", DEC1 tC, DegSym, " ",CR]
    GOTO receiver_temp_data


    i use two BS2 one send and one reciever via 912mhz the· one reciever use the bluetooth eb500 module to send to PC but the value to PC is not correct ?

    Post Edited (Tomvn) : 10/3/2009 6:49:10 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-03 18:58
    Tomvn,

    What happens if you omit the transmitter and receiver, and wire the two BS2's directly? <-- Make sure that you share the same ground connection.

    My first thought is that the data might be inverted, or get inverted through the transmitter or receiver.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-03 19:38
    I use it because i send temperature data from one my house to other house , and you say inverted ...?
    i read the document 912mhz module use 9600 to send and reciever and eb500 the same , and i ground eb500 and 912mhz same ground connection.



    Post Edited (Tomvn) : 10/3/2009 7:48:26 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-03 22:40
    Tomvn,

    The only obvious thing that I can see is that you are sending the data in a different order than you are receiving it. The 'soT' and 'tC' are swapped.


    TX code
    SEROUT Tx,84,[noparse][[/noparse]tC]
    SEROUT Tx,84,[noparse][[/noparse]soT]
    SEROUT Tx,84,[noparse][[/noparse]tF]
    
    




    TX code
    SERIN rx, 84, [noparse][[/noparse]soT]
    SERIN rx, 84, [noparse][[/noparse]tC]
    SERIN rx, 84, [noparse][[/noparse]tF]
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-04 07:08
    Beau,

    the preview code i alraedy fix it but the problem still , let me try to make the same ground connection
    and let you know what happen.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-04 07:13
    What kind of data are you getting that is not correct? This hasn't been made clear to me.

    My suggestion as far as making the same ground connection also involves you eliminating the RF transmitter and receiver and going with a direct connection. This is more of a sanity check to make sure that the code is actually functioning properly before we try to look for other problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-04 16:57
    the problem is the same , i send and rx temprature data, i make same ground connection but dont do anything change
  • FranklinFranklin Posts: 4,747
    edited 2009-10-05 02:55
    Could you attach your corrected code and also tell us what you are sending and what you get on the receive end?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • TomvnTomvn Posts: 103
    edited 2009-10-05 14:56
    the Tx code and i debug the value is correct but when i send to rx then debug the value on RX it lower than 4 or 5 degree.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-05 16:08
    Tomvn,

    You need to have some sort of synchronization between the TX data and the RX data or else the order of which the bytes are received can become misaligned.

    transmitter example:
    SEROUT Tx,N9600,[noparse][[/noparse]"!T"]    '  <---Sync characters can be anything as long as they match on the receiver 
    SEROUT Tx,N9600,[noparse][[/noparse]soT]
    SEROUT Tx,N9600,[noparse][[/noparse]tC]
    SEROUT Tx,N9600,[noparse][[/noparse]tF]
    
    



    receiver example:
    SERIN Rx, N9600, [noparse][[/noparse]WAIT("!T")]    '  <---Sync characters can be anything as long as they match on the transmitter
    SERIN Rx, N9600, [noparse][[/noparse]soT]
    SERIN Rx, N9600, [noparse][[/noparse]tC]
    SERIN Rx, N9600, [noparse][[/noparse]tF]
    
    




    Please reference the Basic Stamp Manual for SERIN, SEROUT, and the WAIT command...
    www.parallax.com/Portals/0/Downloads/docs/prod/stamps/web-BSM-v2.2.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/6/2009 4:32:46 PM GMT
  • TomvnTomvn Posts: 103
    edited 2009-10-06 14:37
    Beau your code not work.

    let my try different Pin .
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-06 17:22
    Tomvn,

    For basic Transmit and receive between two BS2's I have tested this code and setup in a direct connection configuration. For both the Transmitter(TX) and Receiver(RX), P0 is used in this example, but you can change it to whatever is applicable. When connected to your RF modules, if you are using the Parallax Transceivers(TRX) you will need to make sure that one TRX is setup as a transmitter and the other TRX is setup as a receiver. Otherwise, connect the appropriate TX or RX to the BS2 and make sure that you share a common ground connection between the RX or TX module connected to each BS2.


    Transmitter
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    Tx    CON 0
    N9600 CON 84
    
    soT VAR B0
    tC  VAR B1
    tF  VAR B2
    
    soT = 50
    tC  = 100
    tF  = 150
    
    MainLoop:
    
    SEROUT Tx,N9600,[noparse][[/noparse]"!T"]  '  <---Sync characters can be anything as long as they match On the receiver
    SEROUT Tx,N9600,[noparse][[/noparse]soT]
    SEROUT Tx,N9600,[noparse][[/noparse]tC]
    SEROUT Tx,N9600,[noparse][[/noparse]tF]
    
    GOTO MainLoop
    
    




    Receiver
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    Rx    CON 0
    N9600 CON 84
    
    soT VAR B0
    tC  VAR B1
    tF  VAR B2
    
    MainLoop:
    
    SERIN Rx, N9600, [noparse][[/noparse]WAIT("!T")]    '  <---Sync characters can be anything as long as they match on the transmitter
    SERIN Rx, N9600, [noparse][[/noparse]soT]
    SERIN Rx, N9600, [noparse][[/noparse]tC]
    SERIN Rx, N9600, [noparse][[/noparse]tF]
    
    DEBUG HOME
    DEBUG DEC soT,CR
    DEBUG DEC tC,CR
    DEBUG DEC tF,CR
    
    GOTO MainLoop
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1024 x 768 - 301K
  • TomvnTomvn Posts: 103
    edited 2009-10-07 13:53
    Hi Beau,

    your code and the way you wires your sample is work really good , but the problem my here , I have to transmitt temperature data away 600ft from my brother house to my house. that why i have to use two 912mhz TRX from parallax to do the job.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-07 16:10
    Tomvn,

    "your code and the way you wires your sample is work really good , but the problem my here , I have to transmitt temperature data away 600ft from my brother house to my house. that why i have to use two 912mhz TRX from parallax to do the job." - Yes, I understand that. This code exercise is to make sure that the code is correct. The next step would be to connect the TRX modules making sure that one is configured as a Transmitter, while the other is configured as a Receiver and connected to their appropriate BS2.

    Since the TRX is a line-of-sight device, building structures and external interference can play an role in the quality of the received signal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 10/7/2009 4:15:32 PM GMT
  • TomvnTomvn Posts: 103
    edited 2009-10-14 11:42
    ·Hi Beau,

    ·I come back ,and i still·have with the same problem .

    when i just send only one [noparse][[/noparse]tC] variable· to· RX the Rx·got confuse, sometime it recieve the right value sometime not.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-14 16:20
    Tomvn,

    perhaps your getting interference between your transmitter and your receiver that doesn't allow it to operate at 600 feet. Can you move the Transmitter and Receiver closer to one another just to see if that might be part of the problem? Another thing you could try is to lower the baud rate. Sometimes that will help in a noisy environment.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-15 15:39
    i did put it together but the same problem, so could i low to 2400baud that ok with 912mhz module ?
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-16 03:39
    Tomvn,

    You should be able to lower the baud just fine. I'm curious how far apart the transmitter and receiver are from one another? Is there a chance that you have another device nearby operating on the same frequency that could be causing some interference?

    Can you take a photo of your Transmitter and your Receiver setup? ... and possibly a schematic that you are using?

    That might help nail this problem down.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-18 15:47
    do you think it make interference with the eb500 bluetooth module ? like i say before , i use two bs2 one in my house and one from my brother house , it about 200meter and i use two 912mhz module , send temp data from my house to my brother house and my brother house with the bs2, 912mhz to receiver temp data then the eb500 send temp data to PC all work great i even test to send character and it receiver correct character value, but temperature data variable not correct ,
    yesterday i make a test to low the baud rate down but it didnt help.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-18 16:31
    Tomvn,

    I think I just figured out your problem....

    In your original code... soT, tC, and tF are defined as WORDS

    The serial function can only send BYTES ... so for your TX code it should look like this...

    TX code
    SEROUT Tx,N9600,[noparse][[/noparse]"!T"]            ' <---Sync characters can be anything as long as they match On the receiver
    SEROUT Tx,N9600,[noparse][[/noparse]soT.BYTE0]
    SEROUT Tx,N9600,[noparse][[/noparse]soT.BYTE1]
    SEROUT Tx,N9600,[noparse][[/noparse]tC.BYTE0]
    SEROUT Tx,N9600,[noparse][[/noparse]tC.BYTE1]
    SEROUT Tx,N9600,[noparse][[/noparse]tF.BYTE0]
    SEROUT Tx,N9600,[noparse][[/noparse]tF.BYTE1]
    
    




    ...And the RX code should look something like this...

    RX code
    SERIN Rx, N9600, [noparse][[/noparse]WAIT("!T")]    '  <---Sync characters can be anything as long as they match on the transmitter
    SERIN Rx, N9600, [noparse][[/noparse]soT.BYTE0]
    SERIN Rx, N9600, [noparse][[/noparse]soT.BYTE1]
    SERIN Rx, N9600, [noparse][[/noparse]tC.BYTE0]
    SERIN Rx, N9600, [noparse][[/noparse]tC.BYTE1]
    SERIN Rx, N9600, [noparse][[/noparse]tF.BYTE0]
    SERIN Rx, N9600, [noparse][[/noparse]tF.BYTE1]
    
    





    Note:

    Make sure that you define soT, tC, and tF as WORD variables. i.e.

    soT VAR WORD
    tC  VAR WORD
    tF  VAR WORD
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • TomvnTomvn Posts: 103
    edited 2009-10-22 17:07
    Thanks Beau ,
    it works great , thanks very much to take your time.
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-10-23 05:22
    Tomvn,

    Great!, I'm glad that worked.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.