Problem Regarding RF Receiver and Antenna

I'm trying to control two servo motors using a RF Transmitter and Receiver (YK04 + Generic remote that comes with it), but I've not been able to get consistent results regarding the receiver. The transmitter and servos work fine, I've checked before, but the transmitter seems to have issues.

Strangely, I tried using servo number one and two at the same time, which made my receiver's antenna stop working and I had to touch it with the antenna of the transmitter to make it work again, but then I could use it once before having to repeat the same process.

So, I used servo one alone, which worked at first (I did not need to touch the antenna anymore).Then I tried using servo two alone, which didn't work. But for some strange reason, after I tried changing the pins on servo number two to see if that was causing some interference, it stopped working properly and I now have to touch the antenna to make it work. I have not swapped the pins while the Arduino was receiving power.

What I'm currently using as an antenna is a 12CM aluminium rod, which I have not soldered yet. Both my code and a picture of the receiver are below.

#include <Servo.h>

Servo servo1;
Servo servo2;

bool on = false;

void setup(){
  servo1.attach(2);
  servo2.attach(3);

  servo1.write(0);
  servo2.write(0);
  
  Serial.begin(9600);
  pinMode(9, INPUT);
  pinMode(10, INPUT);
  pinMode(11, INPUT);
  pinMode(12, INPUT);
}

void loop(){
  if(digitalRead(9) == HIGH)
  {
     if(on)
     {
      servo1.write(90);
      delay(500);
      servo1.write(0);
      on = false;
      delay(1000);
     }
     else
     {
      servo2.write(90);
      delay(500);
      servo2.write(0);
      on = true;
      delay(1000);
     }
  }
}

I can provide more information if necessary.

Hi,
Welcome to the forum.

How are you powering your servos?
If from the 5V of the Arduino, the Arduino cannot supply the current needed for even one servo reliably.

Can you tell us the model Arduino you are using?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom.. :slight_smile:

Arduino Uno, and I am providing current to the servos using a battery on the breadboard

Here is a (almost half decent) schematic

I have one of those receiver and key fob things, or a very similar one- I forget the make and model- and it stopped working soon after I bought it. I think they're just crap.

disk:
I've not been able to get consistent results regarding the receiver. The transmitter and servos work fine, I've checked before, but the transmitter seems to have issues.

I'm confused: what that second sentence says is "the transmitter... works fine ... but the transmitter has issues"

Did you mean "the receiver has issues"? That makes more sense, especially in the light of "not been able to get consistent results regarding the receiver."

Your code only reads pin 9 so it's only testing one of the receiver's 4 pins. What about the others?

Put serial prints in the code to display the value of the pin/s you read on the Arduino.

But, have you tested it in a circuit that has no servos and external power at all? ie, just use the receiver to control one Arduino input with no servos hooked up? Or better yet, just stick 5V into the receiver and use your volt meter to read the receiver's outputs.

If that all works, then there's one problem. If that doesn't work, that's a different issue.

(Remind me what the Vt pin does?- it's ages since I used one of these things.)

Grrrrrr you added the schematic to an existing post while I was typing my previous reply.

According to adafruit here, those things don't like more than 6V, you're supplying 9? (Not necessarily the same brand, but I'm sure they all come from the same factory :wink: )

According to your not-really-half-decent schematic looks to me like you have 9V on the servos?

I'll try everything once I get home, especially supplying the receiver with less voltage. But when I tried testing all pins and printing results before, it also did not work unless I touched the antenna.

Main thing is to test it standalone first, no Arduino. Then if it works, test it with an Arduino, but no servos, just serial print the digitalRead()s. Then if that works, test it with the servos and their power.

If the first test doesn't work, then it's the receiver or transmitter, and is not an Arduino-related problem.

(Have you got 9V on the servos? All the hobby servos I've seen are 4.8 to 6V.)

kenwood120s:
Main thing is to test it standalone first, no Arduino. Then if it works, test it with an Arduino, but no servos, just serial print the digitalRead()s. Then if that works, test it with the servos and their power.

If the first test doesn't work, then it's the receiver or transmitter, and is not an Arduino-related problem.

(Have you got 9V on the servos? All the hobby servos I've seen are 4.8 to 6V.)

Thanks for the idea! And as strange as it sounds, mine are around 7 to 9v

Hi,
Are you using one of these?

There is no way they will provide the current for your servos,or the UNO.

Also where does it say that the RX runs on 9V, 5V more like it.

Do you have a DMM to measure your battery volts while your project is trying to work?

Tom.... :slight_smile:

TomGeorge:
There is no way they [a PP3 type] will provide the current for your servos,or the UNO.

That's pretty much why I suggested to the OP that he (or she, not wanting to assume anyone's gender... oh wait, this isn't 9gag :wink: ) adopt a logical fault-finding approach to isolate the problem:

  • Main thing is to test the receiver/transmitter pair standalone first, no Arduino.
  • Then if it works, test it with an Arduino, but no servos, just serial print the digitalRead()s.
  • Then if that works, test it with the servos and their power.

TomGeorge:
Also where does it say that the RX runs on 9V, 5V more like it.

Adafruit say that the datasheet for their version's underlying chipset says up to 15V, but that they (adafruit) reckon 6V tops. The OP's RXer has different markings from adafruit's, but looks otherwise identical so yeah, why go over 5V?

By the way, I think (from memory, but can't find it documented) that the VT pin is active during RX: the VT pin should show 5V while any of the keyfob buttons is pressed. That's the quickest test, at least of the rf side.