Nano hang-up after reveicing RC signal from FlySky FS-i6x

Hi guys,

i'm struggling with a strange behaviour in my drone project and need some help.

The Hardware-Settings:
I use a FlySky X6B Receiver for receiving Throttle-inputs etc. from my FlySky FS-i6x RC. The X6B is connected via PPM-Output to the Arduino Nano Pin D2. GND is connected to GND of Nano and VCC to the 5v of Nano.
I want to power the whole electronics of my quadcopter with a 3S Lipo (12.6 V) via Vin. I placed a diode, to get a voltage-drop and protect USB-Port. When the Lipo is connected, the incoming voltage at the Vin is round about 11.5 V (Nano gets warm, but not much)
See schematic attached.

Sketch I use (its only the RC part of the whole Drone Sketch): i found it on a homepage, i already flew with it several times (in another hardware build). So it should work (see Test-Case 1)

#define RECEIVE_PIN 2    // Pin 2 geht z.B. auch
#define CHANNEL_AMOUNT 8
#define DETECTION_SPACE 2500
#define METHOD RISING

int ch[CHANNEL_AMOUNT + 1];

void setup()
{
Serial.begin(115200);
pinMode(RECEIVE_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(RECEIVE_PIN), ppm_interrupt, METHOD);
}

void loop()
{
ppm_write();


}

void ppm_write()
{
static unsigned long int t;
if (millis() - t < 100)
return 0;
for (byte i = 0; i < CHANNEL_AMOUNT + 1; i++)
{
Serial.print("Ch ");
Serial.print(i);  
Serial.print(" ");  
Serial.print(ch[i]);
Serial.print("\t");
}
Serial.print("\n");
t = millis();
}

void ppm_interrupt()
{
static byte i;
static unsigned long int t_old;
unsigned long int t = micros(); //store time value a when pin value falling/rising
unsigned long int dt = t - t_old; //calculating time inbetween two peaks
t_old = t;

if ((dt > DETECTION_SPACE) || (i > CHANNEL_AMOUNT))
{
i = 0;
}
ch[i++] = dt;
}

Test-Case 1: Powering the Arduino via USB
Everything works! The serial monitor shows the pulse of every channel between 1000 and 2000. The Nano dont hang-up. Code looks fine.

Test-Case 2: Powering the Arduino with a 3S Lipo (12.6 V) via Vin, also connected via USB to read the serial Monitor
Step 1: RC is turned Off. Everything works, like in Case 1. Only the pulse of every channel is zero. Nano dont hang-up. Receiver LED blinks, searching a transmitter signal.
Step 2: I turn the RC on. immediately the LED on the X6B receiver stop to blink and shines constant (= connection between receiver and transmitter) AND the Nano hang-up! I know it because the serial monitor stops sending pulses, instead there are the ??⸮⸮??? Symbols (like when you have the wrong baud).
Furthermore i testet it with a constant blinking LED in a modified sketch, an the blinking also stopped when i turned on the RC. Therefore i think the Nano hang-up and stop working correctly.

What causes this problem?
I think its a hardware problem, but i cant figure it out exactly. What else could i test?

FYI: I had disconnected the Motors VCC/GND and GND/Signal of the ESCs. But also with a connection it didnt work.

Thanks for your help!

A "proper" schematic might get you some help.
Forget the diode and use an external converter, disconnect the latter when connected to usb.
Cannot read whatever the adaptor board is and the wiring is a complete rat's nest.

Sorry for the rats nest ...
The schematic shows the Arduino Uno. It was my first build before i switched to the Nano.
Here is the schematic in PDF, hope you can see it better now.

Why should i forget the diode? In my first build it already worked fine with the diode.

drone schematic.pdf (1.14 MB)

Hi
Welcome to the Forum.
OPs fritzy;

One problem you have, there are NO BYPASS CAPACITORS on the power wires.
Also your gnds are all over the place , you should be grounding ALL your peripheral devices to ONE place and this place should be where the gnd from your LiPo connects to the board.

Can you please post a picture of your project so we can see your component layout.

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

Thanks.. Tom... :slight_smile:

Hi Tom,

thanks four your reply. Sry that im answering so late, but i orderd a set of electrolyth capacitors and now i'm ready for a bypass capacitor :slight_smile:

Where should I place the capacitor and with which value?
Between 5V and GND of Arduino and/or + and - of Lipo?
Is there any thumb-rule for dimensioning the value?

I attached two pics of my Prototyp-PCB. The cabeling is awful... sry...
In the Top Picture, the yellor lines are the GND-pads, where a connected als GNDs togehter (5V-pads are beside). The red lines shows the Receiver and its 5V, GND and Signal pads. Blue line go first to GND, and after the resistors-volt-divider to A0. The Orange lines go to Vin (like in my schematic).

I will rewrite my schematic with kiCAD on the weekend :slight_smile: