Transmission works with wires but not always with wireless


Closed Thread
Results 1 to 40 of 43

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jerson View Post
    I think you got the point. Still, tell us your name. JYI1 sounds like a name from the new StarTrek series

    Jerson
    I discover that even if I send $55 4, 6, 8, 10, 20 times but it still picks it up occasionally. On the other receiver end I am looking for $55, $aa.
    Last edited by jyi1; - 24th April 2007 at 19:04.

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


    Did you find this post helpful? Yes | No

    Default

    I have used these extensively (although I get mine direct from WenShing in Taiwan). These are superregenerative ASK receivers. They need a pronounced preamble in order to set the AGC and receive threshold. They work quite well at low data rates using a protocol like the NEC protocol (used by X10 for their wireless remotes) which I've detailed here...You might also benefit from reading this page...You need a fairly good balance between pulses and spaces (which Manchester encoding guarantees) but the fact that you need to send several copies in order to receive reliably indicates you need the initial copies to set the threshold and AGC.

    Which output pin are you using? Using the linear (analog) output can complicate things. It's usually best to use the digital output. A good receiving antenna is important. An eggbeater is easy to build and matches the 50-ohm input impedance of the receiver.You can capture the output(s) from the receiver using a soundcard as I show here...which can give you an idea of the quality of the signal as received.

    Bruce Reynolds sells the 433.92MHz version of this receiver. I believe he has some example projects with PBP code on his website.

    BTW, the fact that your code works with a hardwired connection is another indication that your problems are related to RF signal quality.

    Good luck.
    Last edited by dhouston; - 24th April 2007 at 20:36.

  3. #3
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    I have used these extensively (although I get mine direct from WenShing in Taiwan). These are superregenerative ASK receivers. They need a pronounced preamble in order to set the AGC and receive threshold. They work quite well at low data rates using a protocol like the NEC protocol (used by X10 for their wireless remotes) which I've detailed here...You might also benefit from reading this page...You need a fairly good balance between pulses and spaces (which Manchester encoding guarantees) but the fact that you need to send several copies in order to receive reliably indicates you need the initial copies to set the threshold and AGC.

    Which output pin are you using? Using the linear (analog) output can complicate things. It's usually best to use the digital output. A good receiving antenna is important. An eggbeater is easy to build and matches the 50-ohm input impedance of the receiver.You can capture the output(s) from the receiver using a soundcard as I show here...which can give you an idea of the quality of the signal as received.

    Bruce Reynolds sells the 433.92MHz version of this receiver. I believe he has some example projects with PBP code on his website.

    BTW, the fact that your code works with a hardwired connection is another indication that your problems are related to RF signal quality.

    Good luck.
    I am using the digital data output pin. Also, since I need to send my data 5 times and with a pause of 5 does it mean that I should make my preamble longer?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Serial communication is a female thing, so bear in mind that preamble are needed and some of them may say the size don't make any difference
    ---------------------------------------------------------
    Usually 3-5 $AA as preamble is enough. Machester encoding have it's own advantage if you send long data packet. A checksum is also handy.

    I don't think the character pacing (pause x) is really needed if you're using a slow baudrate (2400 bauds or so)

    a single SEROUT/DEBUG/SEROUT2/HSEROUT line is all you need in many case.

    Always make sure your crystal are accurate.

    BTW which PIC are you using?
    Last edited by mister_e; - 24th April 2007 at 22:49.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Serial communication is a female thing, so bear in mind that preamble are needed and some of them may say the size don't make any difference
    ---------------------------------------------------------
    Usually 3-5 $AA as preamble is enough. Machester encoding have it's own advantage if you send long data packet. A checksum is also handy.

    I don't think the character pacing (pause x) is really needed if you're using a slow baudrate (2400 bauds or so)

    a single SEROUT/DEBUG/SEROUT2/HSEROUT line is all you need in many case.

    Always make sure your crystal are accurate.

    BTW which PIC are you using?
    I'm using PIC16F88. I have 4 $55 and am using Manchester Encoding.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oneohthree View Post
    I'm using PIC16F88. I have 4 $55 and am using Manchester Encoding.
    So...
    oneofthree = jyi1 ???

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So...
    oneofthree = jyi1 ???
    You are such a tease...!

    oneofthree or jyi1 or whatever your name is (we never got any) I told you before to start one data byte at the time. A complex program is hard to debug especially if there are serial com's.

    Also do not manchester encode the preambles. Only the data bytes and CRC or Checksum.

    Ioannis
    Last edited by Ioannis; - 25th April 2007 at 07:48.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by oneohthree View Post
    I am using the digital data output pin. Also, since I need to send my data 5 times and with a pause of 5 does it mean that I should make my preamble longer?
    I would use a 5ms pulse as the preamble and a 20ms pause between data packets (it allows the AGC and threshold to reset).
    On the receiving end I would use PulsIn to wait for the 5ms pulse and then go into the normal receive routine once it's received. Using some type of error detection (e.g. checksum) is a necessity.

    What range do you need? How much data do you need to send?

    Looking at the digital data pin with a 'scope (or recording it with a soundcard as I suggested earlier) can eliminate a lot of guesswork by telling you whether your signal strength is adequate. I find it invaluable.

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    I would use a 5ms pulse as the preamble and a 20ms pause between data packets (it allows the AGC and threshold to reset).
    I'm curious as to why you use the 20ms pause between packets? I know you said that the pause would reset the AGC & threshold, and that certainly makes sense. But I would figure if you're continuously sending bi-phase encoded data (manchester encoded) practically non-stop, wouldn't everything stay where it would need to be?

    EDIT: (add)
    I suppose if the TX and RX were changing positions relative to each other, the signal strength would vary, and maybe the AGC/threshold wouldn't 'keep up' with the varying conditions. The 20ms pause would compensate. If that's the case, then it really makes a lot more sense to me.
    Last edited by skimask; - 25th April 2007 at 03:46. Reason: Thought about it for a bit...

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    I'm curious as to why you use the 20ms pause between packets? I know you said that the pause would reset the AGC & threshold, and that certainly makes sense. But I would figure if you're continuously sending bi-phase encoded data (manchester encoded) practically non-stop, wouldn't everything stay where it would need to be?
    AGC reduces the gain as the signal gets stronger. Repeating the signal at close intervals can cause the gain to taper off, resulting in poorer reception. A gap between transmissions lets it reset to its baseline. You can play with the duration of the gap - in this case 5-10mS is probably adequate but its hard to say without hands-on experience to determine typical signal strength and performance. Also, I'm eliminating the manchester encoding - the NEC protocol assures a relatively balanced ratio of pulses/spaces for the dataslicer threshold.

    Another reason for inserting a gap is to allow the receiver time to analyze what it has received and decide what action to take.

    It is possible to get a measure of signal strength by taking ADC readings of the receiver's Linear output pin. I measure the difference between a pulse and space which, while it is not an absolute measure (due to AGC), gives a good relative indication of signal strength. IOW, if one signal registers 700 and another 500 I know which signal is stronger (and can use it for tuning) but I cannot definitively compare measurements from separate receivers since I'm not measuring an absolute magnitude.
    Last edited by dhouston; - 26th April 2007 at 13:28.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    AGC reduces the gain as the signal gets stronger......since I'm not measuring an absolute magnitude.
    Everything you said makes perfect sense to me. And it might also explain a few issues I've always had with a couple of my RF projects and lengthy/continuous packet transmissions getting dropped after a few seconds of transmitting. I'm going to try your 'pause between packets'/'making the packets smaller' idea and see what happens.

  12. #12
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    I would use a 5ms pulse as the preamble and a 20ms pause between data packets (it allows the AGC and threshold to reset).
    On the receiving end I would use PulsIn to wait for the 5ms pulse and then go into the normal receive routine once it's received. Using some type of error detection (e.g. checksum) is a necessity.

    What range do you need? How much data do you need to send?

    Looking at the digital data pin with a 'scope (or recording it with a soundcard as I suggested earlier) can eliminate a lot of guesswork by telling you whether your signal strength is adequate. I find it invaluable.
    Is the code that I wrote below what you are trying to tell me?
    I am only trying to send 4 bits (8 bits encoded). I looked at the digital data pin of the scope and my signal has an amplitude of about 3.72 v.

    Transmit:
    Pulsout PORTB.7, 500
    Pause 20000
    serout PORTB.7, n2400, [$aa,encoded2]
    Pause 20000

    Receive:
    Wait55:
    Pulsin PORTB.0,1,ct55
    If ct55 = 500 Then
    goto Waitaa
    Else
    goto Wait55
    Endif
    'goto Wait55

    Waitaa:
    serin PORTB.0, n2400, encoded1
    If encoded1 <> $aa Then goto Maina
    serin PORTB.0, n2400, encoded1
    write 0, encoded1

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jyi1 View Post
    Is the code that I wrote below what you are trying to tell me?
    I am only trying to send 4 bits (8 bits encoded). I looked at the digital data pin of the scope and my signal has an amplitude of about 3.72 v.
    Code:
    Transmit:
    	Pulsout PORTB.7, 500
    	Pause 20000
    	serout PORTB.7, n2400, [$aa,encoded2]
    	Pause 20000
    
    Receive: 
    Wait55:
            Pulsin PORTB.0,1,ct55
            If ct55 = 500 Then 
               goto Waitaa
            Else
              goto Wait55
            Endif
            'goto Wait55
    Yes, more or less. I would change it to...
    Code:
    Transmit:
    	Pulsout PORTB.7, 500
    	Pause 2500     'shorten space
    	serout PORTB.7, n2400, [$aa,encoded2]
    	Pause 20000
    
    Receive: 
    Wait55:
            Pulsin PORTB.0,1,ct55
            If ct55 < 450 Then Wait55
            goto Waitaa
    The important thing with the signal is that it be clean with no noise pulses interspersed with the data.

    With only 4 bits, I think I would use a variation of the NEC protocol, sending only 1 byte with each code. The NEC protocol has error detection built in so you can discard any corrupted codes. Read the NEC protocol documentation in the link I cited earlier and if you still have questions I'll try to answer them here.

  14. #14
    Join Date
    Apr 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    Yes, more or less. I would change it to...
    Code:
    Transmit:
    	Pulsout PORTB.7, 500
    	Pause 2500     'shorten space
    	serout PORTB.7, n2400, [$aa,encoded2]
    	Pause 20000
    
    Receive: 
    Wait55:
            Pulsin PORTB.0,1,ct55
            If ct55 < 450 Then Wait55
            goto Waitaa
    The important thing with the signal is that it be clean with no noise pulses interspersed with the data.

    With only 4 bits, I think I would use a variation of the NEC protocol, sending only 1 byte with each code. The NEC protocol has error detection built in so you can discard any corrupted codes. Read the NEC protocol documentation in the link I cited earlier and if you still have questions I'll try to answer them here.
    I tested out the above code thats included in my code and it does not work by wireless or by wire.

  15. #15
    Join Date
    Sep 2006
    Location
    Venezuela - Caracas
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    i had many bug with RF 433mhz
    try pause 5 to pause 50

    im my circuit pause 5 word perfect
    without pause not work for me

    my simple test

    Code:
       ...
    transmiter:
       for i =  1 to 30
          serout data_out, N2400, ["<", "A", "B", ">", i]
          PAUSE 5
       next i
    Code:
       ...
    receive:
       serin data_in, N2400, "<ABDC>", TIME_OUT, I
       if i=1 then .........
    
    TIME_OUT:
    goto receive
    Last edited by mpardinho; - 24th April 2007 at 20:47.

  16. #16
    Join Date
    Mar 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mpardinho View Post
    i had many bug with RF 433mhz
    try pause 5 to pause 50

    im my circuit pause 5 word perfect
    without pause not work for me

    my simple test

    Code:
       ...
    transmiter:
       for i =  1 to 30
          serout data_out, N2400, ["<", "A", "B", ">", i]
          PAUSE 5
       next i
    Code:
       ...
    receive:
       serin data_in, N2400, "<ABDC>", TIME_OUT, I
       if i=1 then .........
    
    TIME_OUT:
    goto receive
    The pause helps if I need to send the data more than once. But when I only send it once it doesn't help

Similar Threads

  1. Wireless Tachometer - Design Help
    By DanPBP in forum Off Topic
    Replies: 2
    Last Post: - 3rd May 2009, 09:06
  2. RS485 Vs Wireless (TWS-434A)
    By koossa in forum Off Topic
    Replies: 3
    Last Post: - 11th April 2009, 12:40
  3. Serial Wireless
    By mackrackit in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2007, 16:06
  4. Serial comm - are 2 wires for TX only enough?
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 30th August 2006, 03:23
  5. RS 485 wireless communication
    By Armadus in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 26th January 2006, 19:30

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