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

Need Wireless Help

ChristianChristian Posts: 10
edited 2007-02-08 15:45 in BASIC Stamp
I need some wireless help. I have been working on this for a month and I'm stumped. Please help! What am I doing wrong? Here is the setup and code.


BASIC Stamp side:
I have a BS2 BOE Kit with a 433MHz RF transmiter (data on PIN 8) and a 433MHZ RF receiver (data on pin 7). The BS2 is connected to the PC using the serial port COM1 for debugging. Here is my BS2 Code:

'{$STAMP BS2}
'{$PBASIC 2.5}
'{$PORT COM1}
x VAR Byte(8)
Main:
DO
· PULSOUT 7, 1200
· SERIN 7/8, 396, [noparse][[/noparse]WAIT("!"), STR x\8]
· DEBUG STR x
· SEROUT 8/7, 396, [noparse][[/noparse]"Received",x]
LOOP

PC Side:
I then have a USB2SER with TX connected to another 433MHz RF transmiter, RX connected to a 433MHz RF reciever, and VSS connected to GND on both transmitter and receiver. RES is not connected. I am powering the 5V on all transmitters from the BS2 VDD pin with GND connected to the BS2 VSS pin.

I am using the USB2SER to connect a PC to the wireless transmitters and send information. Here is the PC code in C#, where I am using COM6 for the USB2SER:


using
System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.IO;

namespace USB2SER_Comm

{

public partial class Form1 : Form

{

string port = "";

public Form1()

{

InitializeComponent();

}

private void button3_Click(object sender, EventArgs e)

{

port=comboBox1.Text;

if (!serialPort1.IsOpen)

{

serialPort1.PortName = port;

serialPort1.BaudRate = 2400;

serialPort1.DataBits = 8;

serialPort1.Parity = 0;

serialPort1.Open();

}

}

private void Form1_Load(object sender, EventArgs e)

{

string[noparse]/noparse pts = System.IO.Ports.SerialPort.GetPortNames();

foreach (string pt in pts)

{

comboBox1.Items.Add(pt.ToString());

}

}

private void button4_Click(object sender, EventArgs e)

{

if (serialPort1.IsOpen)

{

serialPort1.Close();

}

}

private void button1_Click(object sender, EventArgs e)

{

if (serialPort1.IsOpen)

{

serialPort1.Write(textBox1.Text);

}

}

private void button2_Click(object sender, EventArgs e)

{

if (serialPort1.IsOpen)

{

textBox2.Text = serialPort1.ReadExisting().ToString();

}

}

}

}


·

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-06 05:09
    Why are you using 7/8 on SERIN and 8/7 on SEROUT? The /pin is for flow control, and shouldn't be used, especially on tx for the rx end and vice versa.

    Also, what is the purpose of the PULSOUT the transmitter?

    With these devices, you generally want to use inverted data also. Idling high (non-inverted) will cause one to be transmitting continually interfering with other transmitters. I believe the value you are using is non-inverted.

    Well, there's a few things that come to mind..
    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • ChristianChristian Posts: 10
    edited 2007-02-07 01:53
    The switching was suggested by another forum. At this point it doesn't seem to have any effect, so I will remove it. The PULSOUT is suggested in the 433MHz manual to sync the transmitter/receiver. I will try removing it. I wasn't aware of the inverted vs. non-inverted issue. I'll give that a try.

    One thing I also need clarified is does the transmitter/receiver output in the same format as the USB2SER or do they have to be setup somehow? In other words, I am only setting COM1 and COM6 input/output methods and assuming that these settings are flowed down to the 433MHz units automatically. Is that assumption correct?

    Also, is the USB2SER suppoed to be connected in the manner I have shown?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-07 02:21
    The 433MHz units are fairly simplistic compared to newer RF units such as ZigBee/IEEE 802.15.4 or Bluetooth (though BT is a bit of an overkill though for simple comms). The 433's simply emit a frequency when then input is high, and no frequency when low. The receiver senses the 433Mhz, and produces a high to reconstruct the signal. So, the 433's really don't have settings, you just can't bang bits out faster than they can keep up.

    So, if you have 2 transmitters both pumping out 433Mhz, neither will get the data across. This is why it is important to use inverted, so the transmitter is silent when idle. An additional problem may be with the USB2SER since it cannot be inverted directly, it may be transmitting all the time. The physical connects seem correct, though again, it may be transmitting continually interfering with data from your other transmitter.

    I would simplify testing by using only 1 transmitter, 1 receiver and try to get data flowing both directions. If you are worried your program may be causing additional problems, simply use hyperterminal to send/receive simple data.

    Once you have data going both ways, try both at once.

    If you want to check out more advanced units that can be used to send and receive data transparently at once (or appears to be at once to the user), and directly to a PC, you can check out the docs on my website: http://www.selmaware.com/appbee

    Not to push those over Parallax's 433Mhz units, but they make life much simplier for multiple/duplex RF comms.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • ChristianChristian Posts: 10
    edited 2007-02-07 05:35
    I would really like to use Wireless G, the 433MHz was just a way to get a prototype up and running quickly. Have you seen any hardware to implement Wireless G quickly?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-02-07 05:47
    802.11g? Um.... no. Generally, not the right tool for this job.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    StampPlot - GUI and Plotting, and XBee Wireless Adapters
    Southern Illinois University Carbondale, Electronic Systems Technologies
  • WarrlokWarrlok Posts: 77
    edited 2007-02-07 16:24
    Christian said...
    I would really like to use Wireless G, the 433MHz was just a way to get a prototype up and running quickly. Have you seen any hardware to implement Wireless G quickly?
    so far ive found these
    http://www.dpactech.com/wireless_products/embedded-802.11-wireless-module.asp

    http://www.aerocomm.com/rf_transceiver_modules/ac4790_mesh-ready_transceiver.htm·· i really looking at this 1 could somebody tell me if it,ll work ???

    http://www.vinculum.com/prd_vnc1l.html·this 1,s got a lot going for it·too like being able to carry a web cam and other usb devices,,, range???

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"
    ·
  • TiboTibo Posts: 81
    edited 2007-02-07 20:58
    another quick sugg : have a wifi pocketPC ? use it with the appropriate serial cable to connect with the stamp
  • WarrlokWarrlok Posts: 77
    edited 2007-02-08 15:45
    look like for the price they wont for some of this stuff ,,could probly buy a laptop since i already have to deal with all windows stupid Smile,,,tht celluar chip is looking better spark fun has a new cell chip with gps it does,nt even need a micro ...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Problems are the "roads" of life,
    solutions are only "onramps" to the next problem



    ············································· "Brad Smith"


    Post Edited (Warrlok) : 2/8/2007 3:51:46 PM GMT
Sign In or Register to comment.