Wireless Receiver/transmitter

I just bought these three products off of sparkfun, the receiver to go onto my arduino, and the transmitter to connect to the FTDI thing with my computer.

Will this all work together? how would i go about connecting these together?

The transmitter and Receiver will work together yes.. but I'm confused, why do you need the FTDI break-out board? That's generally used for programming the Pro Mini and the Lilypad and I believe the boarduino.

But uh.. well, you could always do some research on how to hook them up.. but that's totally overrated, right?:smiley:

http://forum.sparkfun.com/viewtopic.php?p=77956&sid=a054594f6645275bb4f2d1a7b23842c0

It's just simply downloading the VirtualWire library (or another if you'd prefer) and plugging the receiver/transmitter in.. upload examples and you'll have blinking lights!

I only have one arduino that i want to connect to my computer wirelessly. is there an easier way of connecting the transmitter to my computer?

That.. well, will probably be a little more interesting. The biggest problem with that is you'd have to write your own program, or use VirtualWire to help write it, because you'll be dealing with alot of noise from the environment around you. So if you just send a couple bytes, you'll be lucky if you get those, you need a checksum and whatnot.. hard to explain.

But I haven't had experience with connecting to a computer directly, I've used an Arduino connected to my computer. Maybe this link will help you understand some of the basics for the RF transmission, it's not exactly arduino code, but it is based off the same chips.

http://narobo.com/articles/rfmodules.html

But yeah, best of luck. Somebody will come along and explain how to connect it to the computer and set up a check sum and all that good stuff soon. :smiley:

I found some good code on another website, i cant remember where, but it helped cancel out noise, so i think that the biggest challenge would be connecting the transmitter to my mac. I chose the arduino FTDI thing because it was USB to the TxRx, so i could send stuff to the serial port with hyperterminal and it get transmitted t the arduino. welll,......... i hope :-/

Can anyone point me in the right direction re: how to use the VirtualWire library, two arduino's and sparkfun pn/ 8950 + 8946 to do the following:

I want to push a button on one arduino (which will have the transmitter) and have an LED on the arduino with the receiver light up. That simple.

I've got the VirtualWire library to work with the tutorial (outputs Got: 68 65 6C 6C 6F which I believe to be the hex equivalent of 'hello') but it's not clear to me how to use this example to do what I want with the button & LED.

Many thanks.

this is that website, and it shows you EXACTLY how to do what you wanted to do:Hobby Robotics » Cheap Arduino Wireless Communications

I have those Sparkfun RF modules and they work well between 2 arduinos.

I have also connected the transmitter to my PC serial port but I used a MAX233a line driver/receiver to handle the inverted 12v/5v RS232 signals.

This link explains the difference between true RS232 and TTL serial signals:
http://en.wikibooks.org/wiki/Serial_Programming:MAX232_Driver_Receiver

I'm not sure if the SparkFun FTDI is going to provide you with a true baud signal or an inverted signal.

I used the virtualwire library for ther Arduino sketches:

receiver sketch (displays output on SparkFun serial LCD)

#define LCD                 //compile NewSoftSerial LCD code
#ifdef LCD
  #include <NewSoftSerial.h>
  NewSoftSerial serLCD(255, 3);        //tx only
#endif

#define lcdcmd        0xFE   //command prefix
#define lcdcmd2      0x7C   //special command prefix
#define clrLCD        0x01   //Clear entire LCD screen 
#define displayOff   0x08   //Display off 
#define displayOn   0x0C   //Display on 
#define noCurs       0x0C   //Make cursor invisible 
#define ulCurs        0x0E   //Show underline cursor
#define blkCurs      0x0D   //Show blinking block cursor
#define curpos       0x80   //set cursor  + position  (row 1=0 to 15, row 2 = 64 to 79)
#define scrollRight 0x1C
#define scrollLeft   0x18
#define curRight    0x14
#define curLeft      0x10

#include <VirtualWire.h>
#undef round 

void setup()
{
    Serial.begin(9600);      // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec
    vw_set_rx_pin(2);

    vw_rx_start();       // Start the receiver PLL running

#ifdef LCD      //setup serial LCD 
  serLCD.begin(9600);
  delay(1000);
  serLCD.print(lcdcmd, BYTE);
  serLCD.print(displayOn , BYTE);

  serLCD.print(lcdcmd, BYTE);
  serLCD.print(clrLCD, BYTE);
#endif
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
      int i;

        digitalWrite(13, true); // Flash a light to show received good message
      // Message with a good checksum received, dump it.
#ifdef LCD
  serLCD.print(lcdcmd, BYTE);
  serLCD.print(curpos+2, BYTE);
#endif
  
      Serial.print("Got: ");
      for (i = 0; i < buflen; i++)
      {
          Serial.print(buf[i]);   //, HEX);
//          Serial.print(" ");
#ifdef LCD
  serLCD.print(buf[i]);
#endif
      }
#ifdef LCD
        for (; i < 6; i++)      //clear leftover digits 
        {
          serLCD.print(" ");
        }
#endif
      Serial.println("");
        digitalWrite(13, false);
    }
}

transmitter sketch (loops sending sequential number 1,2,3....)

#include <VirtualWire.h>
#undef round 

int packet = 0;
char charnum[10];

void setup()
{
    Serial.begin(9600);        // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_tx_pin(3);
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000);       // Bits per sec
}

void loop()
{
    itoa(packet, charnum, 10);    

    digitalWrite(13, true); // Flash a light to show transmitting
    vw_send((uint8_t *)charnum, strlen(charnum));
    vw_wait_tx(); // Wait until the whole message is gone
    digitalWrite(13, false);
    delay(200);
    packet++;
    Serial.println(packet, DEC);
}

Hope this helps...

we shall see if it works when it gets here. 3 dollar shipping... o yea xD

Thinking back, I actually used the PC/MAX233a combination when I had the RF modules connected to Basic Stamp not with the arduino. The basic stamp code used the serin/serout instructions.

The arduino virtualwire library lets you determine if you want to invert the signal - e.g. vw_set_ptt_inverted(true) so your USB board may work directly with the RF modules.

Hi Ron - I'm using your example code with (what I hope are correctly hooked up) 315 mhz modules.

I'm not getting a thing on the receiver end, though. As far as I can tell they are wired up correctly but I'm not entirely sure what to do to test it.

For the receiver :

I have the data pin (pin 2) on the receiver hooked to the digital pin 2 on the arduino. If I look at data from that pin I get a ton but I'm assuming that's just noise.

For the transmitter :

I have the data pin attached to the digital pin 3 on the arduino.

I haven't changed your code at all. I realize it's just about impossible to say what might be going wrong but I'm not sure where to go from here.

@Mitch, if you're using the VirtualWire library, the TX and RX pins are defaulted to 12, and 11.

You can change them separately using:
vw_set_tx_pin(pinnumber);
//and
vw_set_rx_pin(pinnumber);

Try using the Examples from the VirtualWire library, then work up from there. :slight_smile:

Right, and Ron is using that in his examples (for the pins I'm using).

  • I just noticed that the coe Ron posted is an (almost) exact copy of the examples - he just set the TX and RX pins differently.

I guess I have something wired wrong.. I can't get a thing to happen.

Ah.. Got it.. Wiring problem (no shocker there!).. I tied the pin3 data to ground (as I had read to do). I removed that and it seems to work just fine.

Brilliant!