[SOLVED] Cannot get 433MHz TX/RX pair to work !

these things seemed cheap;
http://www.seeedstudio.com/wiki/index.php?title=433Mhz_RF_link_kit
but they've been expensive in trying to get them to work !

i've seen this thread on Virtual Wire Help;
http://forum.arduino.cc/index.php?topic=119170.0
so i'm aware of the library glitches in the switch from Arduino 022 to 1.0

i don't think i have that problem, compiling is fine - i just don't get anything received by the receiver Arduino.

any ideas on what else i could do to troubleshoot where the problem is ?

these are the "standard" codes used;

TRANSMITTER:

//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the sent module to D2 to use  
#include <VirtualWire.h>
 
int RF_TX_PIN = 2;
 
void setup()
{
  vw_set_tx_pin(RF_TX_PIN); // Setup transmit pin
  vw_setup(2000); // Transmission speed in bits per second.
}
 
void loop()
{
  const char *msg = "hello";
  vw_send((uint8_t *)msg, strlen(msg));  // Send 'hello' every 400ms.
  delay(400);
 
}

and

RECEIVER:

//Grove - 315(433) RF link kit Demo v1.0
//by :http://www.seeedstudio.com/
//connect the receive module to D2 to use ..
#include <VirtualWire.h>
 
int RF_RX_PIN = 2;
 
void setup()
{
  Serial.begin(9600);
  Serial.println("setup");
  vw_set_rx_pin(RF_RX_PIN);  // Setup receive pin.
  vw_setup(2000); // Transmission speed in bits per second.
  vw_rx_start(); // Start the PLL receiver.
}
 
void loop()
{
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;
  if(vw_get_message(buf, &buflen)) // non-blocking I/O
  {
    int i;
    // Message with a good checksum received, dump HEX
    Serial.print("Got: ");
    for(i = 0; i < buflen; ++i)
    {
      Serial.print(buf[i], HEX);
      Serial.print(" ");
	  //Serial.print(buf[i]);
    }
    Serial.println("");
  }
}

RESULT: i just get the Serial.println-ed "setup" and then nothing else happens.

i even tried the RC-switch library;
SEND:

/*
  Example for different sending methods  
  http://code.google.com/p/rc-switch/
  Need help? http://forum.ardumote.com
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  
  // Transmitter is connected to Arduino Pin #10  
  mySwitch.enableTransmit(10);

  // Optional set pulse length.
  // mySwitch.setPulseLength(320);
  
  // Optional set protocol (default is 1, will work for most outlets)
  // mySwitch.setProtocol(2);
  
  // Optional set number of transmission repetitions.
  // mySwitch.setRepeatTransmit(15);
  
}

void loop() {

  /* See Example: TypeA_WithDIPSwitches */
  mySwitch.switchOn("11111", "00010");
  delay(1000);
  mySwitch.switchOn("11111", "00010");
  delay(1000);

/*
  // Same switch as above, but using decimal code
  mySwitch.send(5393, 24);
  delay(1000);  
  mySwitch.send(5396, 24);
  delay(1000);  

  // Same switch as above, but using binary code
  mySwitch.send("000000000001010100010001");
  delay(1000);  
  mySwitch.send("000000000001010100010100");
  delay(1000);

  // Same switch as above, but tri-state code 
  mySwitch.sendTriState("00000FFF0F0F");
  delay(1000);  
  mySwitch.sendTriState("00000FFF0FF0");
  delay(1000);
*/

//  delay(20000);
  delay(2000);
}

and

RECV

/*
  Simple example for receiving  
  http://code.google.com/p/rc-switch/
  Need help? http://forum.ardumote.com
*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(0);  // Receiver on inerrupt 0 => that is pin #2
}

void loop() {
  if (mySwitch.available()) {
    
    int value = mySwitch.getReceivedValue();
    
    if (value == 0) {
      Serial.print("Unknown encoding");
    } else {
      Serial.print("Received ");
      Serial.print( mySwitch.getReceivedValue() );
      Serial.print(" / ");
      Serial.print( mySwitch.getReceivedBitlength() );
      Serial.print("bit ");
      Serial.print("Protocol: ");
      Serial.println( mySwitch.getReceivedProtocol() );
    }

    mySwitch.resetAvailable();
  }
}

again - NOTHING... :frowning:

EVEN using the plain TX/RX pins but probably not going to tell me anything since this RF pair uses "ASK modulation" (??)

PLAIN Serial.print
using TX

/*
* Simple Transmitter Code
 * This code simply counts up to 255
 * over and over
 * (TX out of Arduino is Digital Pin 1)
 */
byte counter;
void setup(){
  //2400 baud for the 434 model
  Serial.begin(2400);
  counter = 0;
}
void loop(){
  //send out to transmitter
  Serial.print(counter);
  counter++;
  delay(10);
}

and

using RX

/*
* Simple Receiver Code
* (TX out of Arduino is Digital Pin 1)
* (RX into Arduino is Digital Pin 0)
*/
int incomingByte = 0;
void setup(){
//2400 baud for the 434 model
Serial.begin(2400);
}
void loop(){
// read in values, debug to computer
if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.println(incomingByte, DEC);
}
incomingByte = 0;
}

even debug-ged that last code to;

/*
* Simple Receiver Code
 * (TX out of Arduino is Digital Pin 1)
 * (RX into Arduino is Digital Pin 0)  ***DISconnectWHILEuploading
 */
int incomingByte = 0;
void setup(){
  //2400 baud for the 434 model
  Serial.begin(9600);
}
void loop(){
  // read in values, debug to computer
  if (Serial.available() > 0) {
    incomingByte = Serial.read();
    Serial.println(incomingByte);
    Serial.println("got SOMEthing");
  }
  incomingByte = 0;
  Serial.println("got NOTHING");
}

but this is probably registering just random noise because it gives pretty much the same result with the transmitter OFF.

would manual tuning be in order ?

what could i do just to see what parts actually are working ?

You are running the Tx and Rx modules on seperate Arduino's?
You have 17cm antenna wire on each?
If you connect Tx to Rx and Gnd-Gnd can you get good comms running?

CrossRoads:
You are running the Tx and Rx modules on seperate Arduino's?

yes Sir, two different Arduinos, one Uno, one Nano.

CrossRoads:
You have 17cm antenna wire on each?

no Sir, they are very close when i'm testing them - maybe not even 10cm - is there such a thing as too close ?

CrossRoads:
If you connect Tx to Rx and Gnd-Gnd can you get good comms running?

i haven't yet tried running them "ActualWIred" - how would that look ?

like this ?

	   UNO			            NANO
	"Data In"		          "Data Out"

	    RX  -------------------  TX

	   GND  -------------------  GND

	   Vcc	 *not connected*    Vcc
	    |							     |
	  ( to their respective 5V pins )

and the code exactly the same ?

Distance should be fine.
Wiring as you depicted should work.

for a brief moment i thought i'd discovered the SILLY error !
i'd lifted the TX module off the breadboard just to have a closer look at the board, whether the GND & VCC were in the "right " place - i wanted to compare it to the schematics on the wiki
http://img141.imageshack.us/img141/9239/cdt88.png
i could trace the coils to the VCC so they're not "mislabeled".

anyway, i saw a glaring mistake when i saw a GAP in the jumpers stuck into the breadboard - the GND jumper was NOT(!) aligned to the board pin - but then, having corrected that - still no luck ! :frowning:
i'm thinking perhaps the TX module is faulty ?
i think the RX module probably is functioning as i've had that "debug" code show something for either probability, but i'm not sure how i'd make something similar for the TX module ?

would using pulseIn() be an option ? just to see if there's anything coming out of there ?

EDIT:
just to confirm that i did try the direct connection and still nothing.

Well, the direct connection is basically software serial, that should work.
Can you confirm the pin being used for tx actually toggles ok? Put an LED/resistor on, run the blink sketch.

You should get the direct connection working before you can use the Arduino for debugging the wireless connection.

After that is working and still nothing using the transmitter and receiver, if you have access to an oscilloscope, look at the signals on the DATA pins of the TX and RX. You should see pulses on both. If you see pulses on TX and just random noise on RX, then perhaps one of them is seriously mistuned.

You have been given some very good advise, but what about supply voltages for Unos and Nanos. They must be the same.

Nonsense. I have a Remote running from 3.7V Lipo and a Main box with receiver running form 5V.
Having a higher voltage battery on the Tx would just provide greater transmit range.

CrossRoads:
Nonsense. I have a Remote running from 3.7V Lipo and a Main box with receiver running form 5V.
Having a higher voltage battery on the Tx would just provide greater transmit range.

Yes of course if you are using that transmitter. But direct pin to pin serial requires same logic levels.

Only partially correct -they require compatible levels! Which can be different than "same" logic levels.
A 3.7V Lipo powered card will generate a good enough High when the signal is lightly loaded for a 5V powered card to recognize valid 1s & 0s.

it was simply an issue of first principles !!

i hadn't done the "ActualWired" properly - i hadn't even connected the RX module to the Uno "RX" pin - so that diagram i drew up should basically be two jumper cables in addition to the wireless wiring/setup.

so that "softwareSerial" then worked - and after i disconnected the "training bridge" - it continued to work !
that unconnected GND pin in reply #4 was the initial fault !!

regarding the logic levels, the Uno was connected via USB, while the Nano was on a 4xAA battery pack - which is probably on the lower limit of the accepted level of Vin - i tested the wireless TX Nano from about 2m away and behind a wall before the signal started to slow/deteriorate.

thanks again everyone !

how to sync rf 433mhz transmitter and receiver in sinusoidale?
plz send me code i thank full u

Please do not hijack old threads. Start your own thread.

You will need to describe what you want to do.