Arduino gives random numbers in PWM pins

Hello

I'm trying to get my Arduino to receiver PWM signals from a radio controller.
However whenever I insert a wire random numbers will start appearing ranging from 0 to 10,000. I don't know what to do now, and I'm on a time crunch any help is much appreciated

Schematic (NOT Fritzing) , code (in code brackets) and more detail would also help.

Other than that, yonks of info on internet on how to using Google search.
This is the first one that came up in the blink of an eye.
https://www.youtube.com/watch?v=UZKxUFkwCc8

0 to 1023? Show your sketch.

Are you by, any chance, trying to print out numbers generated by reading the value of an analogue input?

Otherwise my crystal ball predicts the problem is on line 34 of your un-posted code. But it could just be that its battery is running down.

Another big tip is never make wiring changes when a circuit is powered up. That is the best way to destroy a chip, and you will have no idea why it stopped working.

You need to insert two wires, not just one.

The GND of the Arduino needs to be connected to the GND of the receiver.

Here is my sketch it. To test the board I wanted to just isolate one channel

#define RCpin 5
int RCValue;

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(RCpin,INPUT);

}

void loop() {
  // put your main code here, to run repeatedly:
RCValue = pulseIn(RCpin,HIGH);

Serial.println(RCValue);


}

I have 3 Arduinos that I have tried this on. 2 Elegoos and 1 official Arduino UNO board. So I'm not sure if all my boards are bad. I don't know how to tell if they are. I'm using a TS8 Radio transmitter with the supplied receiver. I supply power to the receiver by using a battery (not the Arduino). In frustration I have changed the pins while the Arduino was live. At one point I had a flysky that worked until about 4 days ago.

Hi, @rjbolden

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

Can you post some images of your project?
So we can see your component layout.

You do have the gnd of the Arduino connected to the gnd of the radio?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

int RCValue;

Shouldn't this be

unsigned long RCValue;

This is how it looks for me also, no I am not using a grond to the arduino. I can switch to an unsigned integer.

And there lies a problem

1 Like

So should I just power the reciever by using the Arduino?

Just connect a wire from an Uno GND to one of the unused GND pins on the R8EF module

The Yellow wire should connect to the Uno pin 5

1 Like

And make sure that the battery is switched off before pulling the power on the rest of the Arduino. Otherwise you will get what is known as phantom powering, where the battery tries to power the Arduino through its static protection diodes. Which will damage the Arduino.

So you need a switch in the +ve line of the battery.

1 Like

i
You need to make a circuit between the two units for CURRENT to flow.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Hello everyone wanted to say thank you for all your support. It was the ground wire that I didn't have. I now have everything coming out of the Arduino itself. I have a steady and predictable serial output. Below is a drawing of my pinouts and what I was trying to do. Thank you for all of the advice, especially on how fast this was resolved.

I asked you to supply the schematic wayyyyyy back in #2 so it could have been resolved wayyyyy back then instead of 17 posts later.

BTW...what is ch3 doing?

Right now its being used to test conditional statements with LEDs. After i plan on using othe hardware such as Linear actuators , motors etc.