2

I have a pair of 433 MHz transmitter and receiver:

Transmitter / receiver

Transmitter is connected to Arduino pro mini, receiver to Arduino Uno R3.

Output of receiver on serial looks like that (it doesn't change much):

Basicly I am getting either 75x or zero regardless of transmitter is on or off.

in > upper
756
in > upper
758
0
0
 0
in > upper
758
0
in > upper
757
in > upper

Transmitter code:

#define rfTransmitPin 4  
#define ledPin 6

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

void loop()
{
    for(;;)
    {
         digitalWrite(rfTransmitPin, HIGH);     //Transmit a HIGH signal
         analogWrite(ledPin, 255);              //Turn the LED on
         delay(500);                            //Wait for 1 second

         digitalWrite(rfTransmitPin,LOW);       //Transmit a LOW signal
         analogWrite(ledPin, 0);                //Turn the LED off
         delay(500);                            //Variable delay
    }
}

Receiver code:

const unsigned int upperThreshold = 70;  //upper threshold value
const unsigned int lowerThreshold = 0;  //lower threshold value
const int ledPin = 13;

#define ReceiverPin  A0

void setup() 
{
    Serial.begin(19200);

    pinMode(ledPin, OUTPUT);

    DiodeTest();
}



void loop() 
{
   int data = analogRead(ReceiverPin);
   delay(50);

   if(data>upperThreshold)
   {
       digitalWrite(ledPin, LOW);   //If a LOW signal is received, turn LED OFF
       Serial.println("in > upper");
   }

   if(data<lowerThreshold)
   {
       digitalWrite(ledPin, HIGH);   //If a HIGH signal is received, turn LED ON
       Serial.println("in < lower" );
   }

   Serial.println(data);
}
3
  • 1
    The receiver simply sends random data to the output pin when it is not receiving a valid signal. It is up to you to encode your transmit signal in a fashion that you can recognise. Aug 22, 2015 at 19:25
  • Basically what dwayne is saying is this: if you connected a standard logic chip to your phone wires you wouldn't expect it to be internet ready. These are basic devices and the receiver will produce garbage when not poked by a transmission.
    – Andy aka
    Aug 22, 2015 at 20:04
  • Those receivers don't give an analog value. They give a HIGH if a signal is detected, and a LOW when no signal is detected. (Though the HIGH seems to only be 3.7v). So just use digitalRead instead of analogRead.
    – Gerben
    Aug 23, 2015 at 8:49

3 Answers 3

3

These types of receivers are AC coupled so you will not be able to do what you are doing as you need to have regular transitions in the signal and not stay in one state for too long.

They are also limited in the speed at which they will work, I expect 19200 bps is too fast.

You need to use a modulation technique such as Manchester Encoding or other technique that guarantees a suitable density of transitions, can synchronize the data and perform error checking.

One popular software library that does this is VirtualWire Arduino Library that is designed for Arduino and the type of transmitters and receivers you are using.

1

See this post about a radio-controlled car.

I found when using what looks like a similar receiver to yours, that the received data looked like this:

Radio receiver

The cyan line was the receiver, the yellow line is what is being transmitted.

The trouble turned out to be the pull-up resistor on the Arduino Rx pin (from the USB chip).

Even with SoftwareSerial it wasn't too great:

Radio receiver software serial

I found that using an op-amp as a buffer helped a lot:

Op-amp buffer


I also agree with the comments about adding an aerial wire, just a short length of hookup wire should do it.

0

You also need to attach a piece of insulated wire as a 1/4 wave length antenna to each of the receiver and transmitter boards. For the 433 MHz type antenna's this would be a piece of wire ~6.8" (17.3cm) long.

For reference if you were using the other popular type of low cost RF link pair at 315 MHz the antennas would be ~9.37" (23.8cm) long.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.