Shop OBEX P1 Docs P2 Docs Learn Events
Stamp and RF interference — Parallax Forums

Stamp and RF interference

ArchiverArchiver Posts: 46,084
edited 2003-12-04 21:26 in General Discussion
Hi All,

I have been working on a weather station in my spare time lately. One of the
features is a wireless temp and humidity sensor using a SHT11 and a pair of
315mHz TX/RX units. The sensor uses a PIC16F819, and the master (weather
station) is a B2SX. The master queries the sensor for data, and the sensor
then sends it. Fundamentally, it is working great. The problem is...

The sensor can receive from the master at 300+', through walls and trees.
However, the master can only receive data from the sensor from about a third
of that, and not very well, lots of bad data. The RX/TX units on the master
are mounted on a completely separate bread board from the Stamp, and there
are isolation and filter caps in place. The power supply looks clean on both
an Optascope and a TEX465M, and I have tried it on a battery anyway. I had
tried everything I could think of when...

I decided to make a master using a PIC. And now I get the same range both
ways!! For some reason the Stamp cannot receive as well as the PIC. The only
two options I see are A: The Stamp's oscillator is causing more RF
interference or B: That somehow it is a problem with the serial
communications. I can't see how it would be B, but maybe. I am running the
RX/TX at 2400 baud, so the speed shouldn't be too high. The '819 is running
at 8mHz, but I had the same symptoms with a 12F675 at 4mHz, so I don't think
the faster speed of the PIC is a factor.

Any ideas on how to track down the problem? The weather station brain is
going to be a Stamp for sure, so I have to solve this issue or have a PIC
run the TX/RX.

Jonathan

www.madlabs.info

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 03:53
    Jonathan Peakall wrote:
    > Hi All,
    >
    > I have been working on a weather station in my spare time lately. One of the
    > features is a wireless temp and humidity sensor using a SHT11 and a pair of
    > 315mHz TX/RX units. The sensor uses a PIC16F819, and the master (weather
    > station) is a B2SX. The master queries the sensor for data, and the sensor
    > then sends it. Fundamentally, it is working great. The problem is...

    1. What RF units are you using?

    2. Is the stamp being put in sleep mode between data requests?

    Michael
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 07:49
    At 05:30 PM 12/3/03 -0800, Jonathan Peakall wrote:
    >Hi All,
    >
    >I have been working on a weather station in my spare time lately. One of the
    >features is a wireless temp and humidity sensor using a SHT11 and a pair of
    >315mHz TX/RX units. The sensor uses a PIC16F819, and the master (weather
    >station) is a B2SX. The master queries the sensor for data, and the sensor
    >then sends it. Fundamentally, it is working great. The problem is...
    >
    >The sensor can receive from the master at 300+', through walls and trees.
    >However, the master can only receive data from the sensor from about a third
    >of that, and not very well, lots of bad data. The RX/TX units on the master
    >are mounted on a completely separate bread board from the Stamp, and there
    >are isolation and filter caps in place. The power supply looks clean on both
    >an Optascope and a TEX465M, and I have tried it on a battery anyway. I had
    >tried everything I could think of when...
    >
    >I decided to make a master using a PIC. And now I get the same range both
    >ways!! For some reason the Stamp cannot receive as well as the PIC. The only
    >two options I see are A: The Stamp's oscillator is causing more RF
    >interference or B: That somehow it is a problem with the serial
    >communications. I can't see how it would be B, but maybe. I am running the
    >RX/TX at 2400 baud, so the speed shouldn't be too high. The '819 is running
    >at 8mHz, but I had the same symptoms with a 12F675 at 4mHz, so I don't think
    >the faster speed of the PIC is a factor.
    >
    >Any ideas on how to track down the problem? The weather station brain is
    >going to be a Stamp for sure, so I have to solve this issue or have a PIC
    >run the TX/RX.
    >
    >Jonathan
    >
    >www.madlabs.info

    Jonathan -

    What do two complete TX/RX cycles look like from a logical point of view. In
    other words, are you sending a preamble ($55), then an identifier ("SL1"),
    followed by data or something like that ? If it is indeed something like that,
    is the Stamp doing a WAIT on the "SL1" string or using any formatters [noparse][[/noparse]DEC data]

    to parse data within the data stream ? Any of these factors will slow the Stamp
    down immeasurably.

    Second, what language are you using to program the PIC ? If you are using
    assembler, you may be over-driving the serial comm line, and may need to add
    some pacing characters. Something like this might appear as framing errors
    to the Stamp.

    Third, are you using a hardware encoder (typical Holtek) ?

    Fourth, how are you determining that you have "bad data" ? Is it just that it's
    not what you expect to see, and if so, have you tried to detect a pattern to it
    ?

    Fifth, what are the environmental conditions for these test ? Is this
    line-of-sight with only trees nearby or are there other things like power lines
    ?

    Lastly, what is the exact BAUDMODE you are using on the Stamp ?

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 14:55
    Micheal,

    Linx TX/TXLC units, and no, I am not going to sleep. The sensor will be in
    the future, but isn't now.

    Thansk for the help,

    Jonathan
    Original Message
    From: "Michael Burr" <mburr@b...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, December 03, 2003 7:53 PM
    Subject: Re: [noparse][[/noparse]basicstamps] Stamp and RF interference


    > Jonathan Peakall wrote:
    > > Hi All,
    > >
    > > I have been working on a weather station in my spare time lately. One of
    the
    > > features is a wireless temp and humidity sensor using a SHT11 and a pair
    of
    > > 315mHz TX/RX units. The sensor uses a PIC16F819, and the master (weather
    > > station) is a B2SX. The master queries the sensor for data, and the
    sensor
    > > then sends it. Fundamentally, it is working great. The problem is...
    >
    > 1. What RF units are you using?
    >
    > 2. Is the stamp being put in sleep mode between data requests?
    >
    > Michael
    >
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 15:19
    >
    > What do two complete TX/RX cycles look like from a logical point of view.
    In
    > other words, are you sending a preamble ($55), then an identifier ("SL1"),
    > followed by data or something like that ? If it is indeed something like
    that,
    > is the Stamp doing a WAIT on the "SL1" string or using any formatters [noparse][[/noparse]DEC
    data]
    > to parse data within the data stream ? Any of these factors will slow the
    Stamp down immeasurably.

    Right now, for test purposes, the sensor is sending 10 transmissions,
    pausing 100mS, then repeating. The master verifies two of them with a
    checksum, then considers the data valid, writes it to the VFD and beeps a
    speaker. I do use both a preamble and a sensor identifier before all
    transmissions. The code looks like this:

    Get_Data:

    SERIN2 portb.3,17197,20,No_Data,[noparse][[/noparse]WAIT
    ("A"),inJunk,injunk,degHi,deglo,humiHi,humilo,batVoltHi,batVoltLo]
    PAUSE 20
    checksum1 = degHi+degLo-batvoltLo+batVoltHi
    again:
    SERIN2
    portb.3,17197,20,again,[noparse][[/noparse]WAIT("A"),inJunk,injunk,degHi,deglo,humiHi,humilo,ba
    tVoltHi,batVoltLo]
    PAUSE 20
    checksum2 = degHi+degLo-batvoltLo+batVoltHi
    PAUSE 10

    return

    No_data:
    goto Get_Data

    This code is for the PIC based RX, but it is the same as used by the Stamp,
    just change the baud rate and pin on the serouts. The pauses are necessary
    with the Stamp, not the PIC.

    > Second, what language are you using to program the PIC ? If you are using
    assembler, you may be over-driving the serial comm line, and may need to add
    > some pacing characters. Something like this might appear as framing errors
    > to the Stamp.

    PicBasic Pro. I have tried doing some char pacing between 10 and 100 ms on
    the transmitter side, no joy.

    >
    > Third, are you using a hardware encoder (typical Holtek) ?

    No encoders. Just straight serial stream to the transmitters.

    >
    > Fourth, how are you determining that you have "bad data" ? Is it just that
    it's not what you expect to see, and if so, have you tried to detect a
    pattern to it ?

    The master hangs during the serin. I can of course make it exit the loop,
    but no verified data.

    >
    > Fifth, what are the environmental conditions for these test ? Is this
    line-of-sight with only trees nearby or are there other things like power
    lines ?
    >

    Pretty quiet, by most standards. My nearest neighbor is 1/2" away. There are
    plenty of trees. I have tried the master well away from my computer where it
    normally sits. The PIC based master don't mind sitting next to the computer
    a bit.

    > Lastly, what is the exact BAUDMODE you are using on the Stamp ?

    18447.
    >

    I have looked at the Stamp based master on the scope, and can see the signal
    start to degrade. If I have time today, I am going to do the same with a PIC
    based master and see if it is the same, and the PIC can handle it, or see if
    it just doesn't degrade as quickly.

    Thanks for the help!

    Jonathan

    www.madlabs.info
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 17:51
    At 07:19 AM 12/4/03 -0800, Jonathan Peakall wrote:
    >>
    >> What do two complete TX/RX cycles look like from a logical point of view.
    >In
    >> other words, are you sending a preamble ($55), then an identifier ("SL1"),
    >> followed by data or something like that ? If it is indeed something like
    >that,
    >> is the Stamp doing a WAIT on the "SL1" string or using any formatters [noparse][[/noparse]DEC
    >data]
    >> to parse data within the data stream ? Any of these factors will slow the
    >Stamp down immeasurably.
    >
    >Right now, for test purposes, the sensor is sending 10 transmissions,
    >pausing 100mS, then repeating. The master verifies two of them with a
    >checksum, then considers the data valid, writes it to the VFD and beeps a
    >speaker. I do use both a preamble and a sensor identifier before all
    >transmissions. The code looks like this:
    >
    >Get_Data:
    >
    >SERIN2 portb.3,17197,20,No_Data,[noparse][[/noparse]WAIT
    >("A"),inJunk,injunk,degHi,deglo,humiHi,humilo,batVoltHi,batVoltLo]
    >PAUSE 20
    >checksum1 = degHi+degLo-batvoltLo+batVoltHi
    >again:
    >SERIN2
    >portb.3,17197,20,again,[noparse][[/noparse]WAIT("A"),inJunk,injunk,degHi,deglo,humiHi,humilo,ba
    >tVoltHi,batVoltLo]
    > PAUSE 20
    >checksum2 = degHi+degLo-batvoltLo+batVoltHi
    >PAUSE 10
    >
    >return
    >
    >No_data:
    >goto Get_Data
    >
    >This code is for the PIC based RX, but it is the same as used by the Stamp,
    >just change the baud rate and pin on the serouts. The pauses are necessary
    >with the Stamp, not the PIC.

    Are these battery powered devices, and if so, have you checked the battery
    condition (voltage) after they've been in operation and outside for a while ?

    >> Second, what language are you using to program the PIC ? If you are using
    >assembler, you may be over-driving the serial comm line, and may need to add
    >> some pacing characters. Something like this might appear as framing errors
    >> to the Stamp.
    >
    >PicBasic Pro. I have tried doing some char pacing between 10 and 100 ms on
    >the transmitter side, no joy.
    >I might even try boosting that higher as the Stamp has no input buffer.
    <snip>

    >> Fourth, how are you determining that you have "bad data" ? Is it just that
    >it's not what you expect to see, and if so, have you tried to detect a
    >pattern to it ?
    >
    >The master hangs during the serin. I can of course make it exit the loop,
    >but no verified data.

    I'd remove the WAIT if you use one on the Stamp, and just receive that one
    character, just to see what happens. If need be, you can check for that
    character after the SERIN completes.

    <snip>

    >> Lastly, what is the exact BAUDMODE you are using on the Stamp ?
    >
    >18447.

    That's fine for 1200 BAUD, but for 2400 BAUD (as you stated you were running)
    you need a BAUDMODE of 17405 for the BS-2SX.

    >>
    >
    >I have looked at the Stamp based master on the scope, and can see the signal
    >start to degrade. If I have time today, I am going to do the same with a PIC
    >based master and see if it is the same, and the PIC can handle it, or see if
    >it just doesn't degrade as quickly.
    >
    >Thanks for the help!
    >
    >Jonathan
    >
    >www.madlabs.info
    >
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-04 21:26
    Bruce,

    >
    > Are these battery powered devices, and if so, have you checked the battery
    condition (voltage) after they've been in operation and outside for a while
    ?

    Yes they are. Batteries have been eliminated as an issue.

    > I'd remove the WAIT if you use one on the Stamp, and just receive that one
    character, just to see what happens. If need be, you can check for that
    character after the SERIN completes.
    >

    Last time I tried this, it didn't help the range. It did increase how often
    the master caught the transmission though. I'll try again to make sure.


    > >> Lastly, what is the exact BAUDMODE you are using on the Stamp ?
    > >
    > >18447.
    >
    > That's fine for 1200 BAUD, but for 2400 BAUD (as you stated you were
    running) you need a BAUDMODE of 17405 for the BS-2SX.
    >

    Ooopsie, I cut and pasted the wrong code. I had been trying 1200 baud but
    found it no better and went back to 2400.

    Jonathan
Sign In or Register to comment.