RF Link Receiver - 4800bps && Transmitter

Hi.

Products i use are = WRL-10533 && WRL-10535

I bought them to communicate (at low price and place) between a sensor with an ATMEGA328 (5 to 20 meters) and a Arduino UNO. I don’t get it.

I tryed the example code KLP Walkthrough Tutorial and the RFASK_example_code that SFE gives on the product page, but nothing works.

I tryed to use them with newsoftserial, and no matter what i send to the transmitter i only have a high amount of noise on my Rx pin (the receiver). If i send a byte (lets say 255) 3 times, i monitor the serial Rx Port and i never see these 3 255.

Here is a piece of code with newSoftSerial (i use the same UNO for Rx an Tx)

/////// port Série supplémentaire ////////
#include <NewSoftSerial.h>
NewSoftSerial radio(11, 12); // PIN de reception / PIN d'emission


unsigned long currentTime = millis();
unsigned long lastSendTime = 0;


void setup() {

  radio.begin(4800);

  Serial.begin(4800);

  Serial.println("Start");
}


void loop(){
  currentTime = millis();

  if(currentTime - lastSendTime > 100){
    lastSendTime = currentTime;

    Serial.println("");
    Serial.print("Envoi : ");

    for( int T=1; T<4; T++){
      byte yo = 255;
      radio.print(yo);
    }

  }

  checkFMReceive();


}



void checkFMReceive(){

  if(radio.available() > 0) {

    byte charFM = radio.read();
    int yo = charFM;

    Serial.print(yo);
    Serial.print(" ");
  }
}

I tryed this code with virtualWire, but i don’t see any byte printed in the serial Monitor

#include <VirtualWire.h>

unsigned long currentTime = millis();
unsigned long lastSendTime = 0;


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

  // Initialise the IO and ISR
  vw_setup(4800);	 // Bits per sec
  vw_set_rx_pin(2);
  vw_set_tx_pin(3);
    
  vw_rx_start();       // Start the receiver PLL running



}

void loop()
{

  currentTime = millis();

  if(currentTime - lastSendTime > 100){
    lastSendTime = currentTime;
    sendMess('A');
    sendMess('B');
    sendMess('C');
    sendMess('D');
    sendMess('E');
  }




  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;

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

    Serial.println("Got: ");

    for (i = 0; i < buflen; i++)
    {
      Serial.print(buf[i]);
      Serial.print(" ");
    }


  }
  
  
}



void sendMess(char quel){

  char msg = quel;

  vw_send((uint8_t *)msg, quel);
  vw_wait_tx(); // Wait until the whole message is gone 

}

I simply don’t understand how these RF modules works.

I plugged two 23 cm wire for antennas, but the RF modules are only at 5 cm distance.

I plugged a cap to filter the Vcc of the receiver, but nothing change.

I saw some posts on the subject but nothing helps me.

may i have more luck with a new topic

thank you

You probably need Manchester code with those units. You might be able to get away with a series of synchronising characters.

I don’t understand why SFE gives this code and tutorial for this units, …

Manchester code … i am not familiar with this … I dont’ have a strong knowledge in electronique & code.

Do you know a way to achieve this ?

thank u

Google?

I mean …

I understood (a little bit) what is Manchester code, … but what is the difference ? … if i send a byte trough a Serial Port and the transmitter , i am supposed to get this byte through the receiver right ?

This is not the case.

I think.

Maybe i am wrong on what Manchester code will give me.

but i am still lost

yohan

While you may have to do more to get this working, let’s try to see if the basics are working first. Can you setup your code to send a continuous stream of alternating 0s and 1s, say 10 or so characters worth, at 2400 bps ? That should give the receiver enough time to gets it’s AGC sorted out. If you don’t see a good receiver output then you have to wonder it the Tx side is working.

Manchester code does something like that, which is why it is so popular.

google “atmel manchester basics” and download the document “doc9164.pdf” for the clearest description on writing a manchester coder and decoder in an language on any uController you like.

What goes into the transmitter and comes out of the receiver should look something like this (bottom trace) of ascii 237:

The 3 clock long pulse at the beginning is the illegal character trigger (hi to low) that lets you know a byte is starting as legal manchester will always have a transition at least once every 2 bit clocks (if baud rate is 4800 bps [208uSec] then bit clock is 104uSec)

Another problem you may be having is the receiver’s output impedance, which has problems driving TTl logic. I use a buffer like this:

OK.

i will try to work on this.

Thank you for you help

It’s a lot of work. i don’t understand the best part of the code… but i will try

Did you try sending alternating 1s and 0s, a stream of ‘U’ characters?

so many inexperienced people buy really cheap RF transmitters, receivers and expect them to work like a dial-up modem without dialing. It’s far more complex, as said above, on modulation and coding methods.

So as a novice, spend more on a full radio with a real “MAC” layer protocol. Learn that. Then decide if you still want a fully DIY cheap-o,

Maybe try this tutorial?

http://letsmakerobots.com/node/12336

I have the wireless modules you are using and that tutorial made them work perfectly the very first time. The biggest problem I’ve run into is my lack of programming experience and trying to convert other data into the type needed to transmit it.

OK.

thank you all of you.

I tried your new tuto static418, it seems the same than the one on sparkfun, but it works.

Maybe it’s because i did it with 2 arduinos and not one like before.

I just mixed the receiver and the transmitter sketch for one arduino.

but now it is good.

I suppose Manchester code would be stronger, but this one works and i will do with it.

Stevech, I understand you point of you.

Electronic things jumped into my life only few mounth ago, i am inexperienced as you said.

I did stuffs, circuits, little interactiv-machin, complexe or simple stuff, with the help of internet, forums, and people more experienced (thanks to SFE too, and there links and tuto).

Why should i spend a life time studiing electronic and miss everything else (… like the life … outside a computer), when i can go faster, and get the help of others ?

If you’re a novice in RF and wireless telemetry, etc., then start with a full-up data radio with MAC and PHY pre-built and standardized, such as the Digi XBees. Starting with a $3 transmitter that requires you to learn how to modulate an RF carrier, or do on-off-keying with a too-crappy radio, leads to frustration for the beginner.