433mhz wireless system help

I am having a lot of inconstant results with my 433mhz set up. I’ve made a few of these, and every time I get mixed results. Sometimes they work perfectly, sometimes not at all, sometimes only when a few cm away from each other. Sometimes they work great, then just decide to stop working after a few tests.

The set up:

Transmitter:

Receiver:

The antenna problem:
When first starting this project, I didn’t know you needed antennas for these chips. When I learned you did, I was using the generic copper Helical antennas for a while. Then I read that a 17cm wire also works, and for a while they were working better. I just had it coming straight off the module.

I then started to try a 34cm wire, half coiled for even better signal - but that was also hit or miss after a few set ups.

The antenna problem part 2:
I read somewhere, on some form post (that I now can’t find), that you are supposed to solder together your antenna and the prong next to it (picture below). Not sure if this was true, but upon trying it I did notice an improvement on some set ups.

Chip inconsistencies:
I also have noticed, after going though many of these 433mhz chips from various sellers, two big inconsistencies. First being one of the copper coils missing from some transmitter modules. Second being some copper coils being soldered into the antenna port rather than the normal port.

Servo Power:
The servo is powered from the arduino. I have read this is a no-no, but with how this project is used I have no choice. When the system decided to work, it works flawlessly despite this.

Code:
Now for the code. I have to use ServoTimer2 because the default servo library conflicts with both Virtual Wire and RadioHead (at least it did a year ago when I started this).

Receiver:

#include <RH_ASK.h>
#include <SPI.h>
#include <ServoTimer2.h>

RH_ASK driver(2000,11,12);
ServoTimer2 RFServo;

const int RFServo_pin = 9;
int RFServo_state = 0; //1 = up | 0 = down
int JustMoved = 0; //Check if just moved

void setup()
{
    //pinMode(RFServo_pin,OUTPUT);
    Serial.begin(9600);
    Serial.println("On");
    if (!driver.init())
         Serial.println("init failed"); //Radiohead Error Check
    RFServo.attach(RFServo_pin);
    RFServo.write(1000);
    delay(1200);
    RFServo.detach();
}

void loop()
{
    uint8_t buf[RH_ASK_MAX_MESSAGE_LEN];
    uint8_t buflen = sizeof(buf);
    if (driver.recv(buf, &buflen)) // Non-blocking
    {
      driver.printBuffer("Got:", buf, buflen);
      if (RFServo_state == 0 && JustMoved != 1){
        Serial.println("MOVE to State 1");
        RFServo.attach(RFServo_pin);
        int i;
        for (i = 1801; i > 1000; i -= 25){
            RFServo.write(i);
            delay(25);
          }
        RFServo_state = 1;
        JustMoved = 1;
        //Serial.println("In State 1");
        RFServo.detach();
        delay(200);
      }
      if (RFServo_state == 1 && JustMoved != 1){
        Serial.println("MOVE to State 0");
        RFServo.attach(RFServo_pin);
        int i;
        for (i = 1000; i < 1801; i += 25){
            RFServo.write(i);
            delay(25);
          }
        RFServo_state = 0;
        JustMoved = 1;
        Serial.println("In State 0");
        RFServo.detach();
        delay(200);
      }          
    JustMoved = 0;
    }
}

Transmitter:

#include <RH_ASK.h>
#include <SPI.h>

RH_ASK driver(2000,11,12);

const int buttonPin = 3;
int buttonState = 0;
int lastButtonState = 0;

void setup()
{
    Serial.begin(9600);
    pinMode(buttonPin, INPUT_PULLUP);
    if (!driver.init())
         Serial.println("init failed"); //Radiohead Error Check
}

void loop()
{
    buttonState = digitalRead(buttonPin);
      if (buttonState == LOW){
        Serial.print("Push");
        const char *msg = "1";
        driver.send((uint8_t *)msg, strlen(msg));
        driver.waitPacketSent();
        delay(200);
      }
}

What frustrates me the most about this project is half the time the kits I make work flawlessly the first time. Then I have 2-3 that I have to fiddle with for days to get working.

I replace the transmitter and receiver chips in case they are bad, re solder points, adjust antennas, and eventually they normally kick on.

I know the code and the wiring is correct (or correct enough), as it can work perfectly, I just want to know what is wrong that makes it not always work perfectly.

Is there a better way to validate Radiohead transmissions? My only theory is the transmitter is sending, but the receiver isn't listening correctly - or catches the message but doesn't see it as a message from the transmitter.

You just appear to be saying that some of the (cheap?) 433Mhz modules work well, and some do not.

I then started to try a 34cm wire, half coiled for even better signal - but that was also hit or miss after a few set ups.

With most 433Mhz modules expecting a 17cm length of wire for an end fed antenna, then 34cm is a bad length.

I just want to know what is wrong that makes it not always work perfectly.

Unfortunately, reliable radio transmission and circuit construction is not nearly as simple as you seem to think. Antenna design and construction is a critical aspect of it, and it is an extremely complex topic. So is module construction, with its associated coils (often bent for proper tuning and impedance matching).

17 cm of straight wire, pointing up and away from other conductors and surfaces should work in most cases, and ALL connections should be carefully soldered.

A balanced dipole will work much better, like that shown below (about 33 cm from tip to tip for 433 MHz). One internal connection is to the ANT terminal, the other to GND (yes, the other antenna terminal). These work very well with the cheapest transmitter and receiver modules; over 300 meters of range, line of sight.