Go Down

Topic: 433 MHz transmitter receiver not working (Read 2955 times) previous topic - next topic

aparis1983

Having issues with a 433 MHz transmitter receiver pair. I've tried both the virtual wire library (https://github.com/gioblu/PJON_ASK) and this (http://arduinobasics.blogspot.com/2014/06/433-mhz-rf-module-with-arduino-tutorial.html).

With the virtual wire library it seems that the transmitter is working (LED is blinking) but the receiver is mum about it (nothing shows up on serial monitor except for "setup"). I've tried three different pairs of transmitter/receivers and four different UNOs as well as a Mega. I've tried different voltages (3.3v as well as 5v for receiver as well as for transmitter). I also tried it without and then with an extra soldered antenna on both the transmitter and receiver (17cm coiled antenna I made out of solid core). I've pretty much ruled out faulty hardware.

What else should I be looking at? Here's a pic of my current setup while trying the code below: https://imgur.com/a/mJmIw

Under the second set of codes (in second link above), this is the code for the transmitter:
Code: [Select]
/*
  RF Blink - Transmit sketch
     Written by ScottC 17 Jun 2014
     Arduino IDE version 1.0.5
     Website: http://arduinobasics.blogspot.com
     Transmitter: FS1000A/XY-FST
     Description: A simple sketch used to test RF transmission.         
 ------------------------------------------------------------- */

 #define rfTransmitPin 4  //RF Transmitter pin = digital pin 4
 #define ledPin 13        //Onboard LED = digital pin 13

 void setup(){
   pinMode(rfTransmitPin, OUTPUT);     
   pinMode(ledPin, OUTPUT);   
 }

 void loop(){
   for(int i=4000; i>5; i=i-(i/3)){
     digitalWrite(rfTransmitPin, HIGH);     //Transmit a HIGH signal
     digitalWrite(ledPin, HIGH);            //Turn the LED on
     delay(2000);                           //Wait for 1 second
     
     digitalWrite(rfTransmitPin,LOW);      //Transmit a LOW signal
     digitalWrite(ledPin, LOW);            //Turn the LED off
     delay(i);                            //Variable delay
   }
 }


And this is the code for the receiver:
Code: [Select]
/*
  RF Blink - Receiver sketch
     Written by ScottC 17 Jun 2014
     Arduino IDE version 1.0.5
     Website: http://arduinobasics.blogspot.com
     Receiver: XY-MK-5V
     Description: A simple sketch used to test RF transmission/receiver.         
 ------------------------------------------------------------- */

 #define rfReceivePin A0  //RF Receiver pin = Analog pin 0
 #define ledPin 13        //Onboard LED = digital pin 13

 unsigned int data = 0;   // variable used to store received data
 const unsigned int upperThreshold = 70;  //upper threshold value
 const unsigned int lowerThreshold = 50;  //lower threshold value

 void setup(){
   pinMode(ledPin, OUTPUT);
   Serial.begin(9600);
 }

 void loop(){
   data=analogRead(rfReceivePin);    //listen for data on Analog pin 0
   
    if(data>upperThreshold){
     digitalWrite(ledPin, LOW);   //If a LOW signal is received, turn LED OFF
     Serial.println(data);
   }
   
   if(data<lowerThreshold){
     digitalWrite(ledPin, HIGH);   //If a HIGH signal is received, turn LED ON
     Serial.println(data);
   }
 }

aparis1983

Forgot to mention that when using the code above, the serial monitor shows only this (without ever dropping below the threshold set in the code):

300
301
304
301
300
304
302
299
303
303
299
302
etc
etc
303

jang87


aparis1983


ad2049q

Try straight 17cm antenna instead of coiled, and orientation the same at both Tx and Rx.
Try on pinboard going direct to one LED display above one transistor whose base is connected (>=40kOhm) to the receiver data out.  Sometimes those have four pins and it is easy to not find the correct pin to wire to your arduino, so get it to flash an LED on pinboard while there is 433MHz signal in the air.  A Tx with just 10kOhm to GND or +V is enough to make the test signal.  That is a good setup to fiddle with antenna orientations, get the range up to what you need, and so on.  The transmitters are OK at 5V and purportedly have longer range if a 9V battery is used instead.  I forget whether the receiver was "never exceed 5.5V" or "never exceed 3.6V" and so you do need to check that on your datasheet.  Only after you can poke a Tx and see an LED flash near the Rx should you add the complication of microcontrollers at both ends.   

Go Up