Simple RF Transmit and Receive


Closed Thread
Results 1 to 40 of 43

Hybrid View

  1. #1

    Default Simple RF Transmit and Receive

    Good day All

    I am playing around with RF and just want to send something from one PIC to another.
    I'm using the Radiometrix RX2 (RX2-433-160-5V) and TX2 (TX2-433-160-5V) (http://www.radiometrix.com/html/products/emc.html) on a standard bread board.
    It only works about every 30th time I test it.

    Do anyone have an idea why this is happening?

    Attached is the Schematics, Photos and Below the Source.

    <hr>

    <code>
    '************************************************* ***************
    '* Name : Transmit.bas *
    '************************************************* ***************

    Include "modedefs.bas"

    DEFINE OSC 4 ' Set the Xtal frequency
    SerialOutPin VAR PORTC.2 ' Serial Out
    LEDPin Var PORTC.3
    DEFINE CHAR_PACING 1000
    ADCON1 = 7

    Main:
    &nbsp;PAUSE 5000

    &nbsp;Serout SerialOutPin, N2400, ["go"] ' Send Data
    &nbsp;HIGH LEDPin
    &nbsp;Pause 1000
    &nbsp;LOW LEDPin
    &nbsp;PAUSE 1000

    END
    </code>

    <hr>

    <code>
    '************************************************* ***************
    '* Name : Receiver.bas *
    '************************************************* ***************

    Include "modedefs.bas"

    DEFINE OSC 4 ' Set the Xtal frequency
    SerialInPin VAR PORTC.2 ' Serial Out
    LEDPin Var PORTC.3
    DATAReceived VAR Byte
    I VAR BYTE
    ADCON1 = 7

    Main:
    HIGH LEDPin
    Pause 5000
    Low LEDPin

    Loop:
    &nbsp;Serin SerialInPin, N2400, 1000, Loop, ["g"], DATAReceived
    &nbsp;If (DATAReceived = "o") Then
    &nbsp;&nbsp;for I = 1 to 10
    &nbsp;&nbsp;&nbsp;HIGH LEDPin
    &nbsp;&nbsp;&nbsp;Pause 100
    &nbsp;&nbsp;&nbsp;LOW LEDPin
    &nbsp;&nbsp;&nbsp;PAUSE 100
    &nbsp;&nbsp;next I
    &nbsp;ENDIF

    NOTFound:

    Goto LOOP

    END

    </code>
    Attached Images Attached Images   
    Attached Images Attached Images

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    There are a number of things you can do make RF comms more reliable. The first things I would recommend is a preamble, and a good 'start of data' byte.

    This is what I use for my RF projects:

    Serout2 rf_pin,17197,[$55,$55,$66,data]

    and

    Serin2 rf_pin,17197,[wait ($66),data]

    The $55,$55 is the preamble, and the $66 byte tells the receiver that the next byte(s) are the data.

    If you want to get more fancy you can add manchester encoding/decoding subroutines.

  3. #3
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Also bread boarding is not very good for RF stuff, You could be getting interferance form the bread baord, the best thing is solder or make a baord.

    like Kamikaze47 said send some preamble or search here and you will find all about manchester encoding

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    First off, the modules require a long wire antenna. What you have connected is a whip antenna which has a ground terminal too. This is not required.

    Second, a good preamble is a must.

    Third, make sure your code works when wired between tx and rx. Only then, go to the wireless part.

    Fourth, make sure your data rate is acheivable by the modules.

    JF

  5. #5
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Those are FM modules so you really don't need to worry about a preamble. Just use the carrier detect pin on the receiver to determine when it's receiving a signal. Radiometrix probably has some detailed instructions for their use.

    Also, you can ignore the advice re breadboards. The modules are basically self contained and all you need the breadboard for is the interconnections, power, etc. the breadboards won't affect the RF modules.

    And the antennas you're using are fine.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Thank you very much!!!!

    Will try out all the suggestions

Similar Threads

  1. rf problem
    By -Dan- in forum General
    Replies: 9
    Last Post: - 20th November 2007, 16:05
  2. 16F876 Usart Receive
    By syscoder in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st March 2007, 15:43
  3. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  4. USB Interface using PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 22nd May 2006, 16:04
  5. RF Transmitter
    By et_Fong in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th October 2005, 16:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts