Arduino resets when giving throttle (Arduino , nrf24 brushed drone)

I have made a arduino brushed drone based on electronoobs's tutorial on youtube
i have done everything what he said in the video but when i give half the throttle in the transmitter , arduino in the receiver gets reset

this is the video link that i'm following :- Brushed motors Arduino drone - Part2 - Prototype + NRF24 code - YouTube

The receiver code :- Multiwii code brushed drone Arduino
The transmitter code :- https://www.thefscreations.info/2018/12/diy-rc-transmitter-and-receiver-for-rc.html

I have tried to smoothen the voltage by adding a 1000uf 25v capacitor connected to the vcc and ground pins on the arduino

pro mini.

I also tried connecting the battery to the vcc and raw pins ,neither made any difference

The receiver connection diagram :-

The transmitter connection diagram :-File sharing and storage made simple

I'm using 720 coreless motor :- https://s.click.aliexpress.com/e/_dYCDAZY
propeller :- Syma X5c X5 X5sw Main Blades Propellers Protective Ring Spare Parts For Syma X5 X5c Rc Drone Quadcopter - Parts & Accs - AliExpress

my drone pictures :-

It will be much easier to help if you post the code here in your next Reply and make your images visible in your Post. See this Simple Image Posting Guide

The most likely cause of a reset is inadequate power for the Arduino so make a simple pencil drawing showing how YOU have everything connected and post a photo of the drawing.

...R

receiver connection diagram :-

receiver code file has been attached below

on the receiver code i'm uploading the code shown in this picture

MultiWii_RF24.ino (661 Bytes)

Do you really have 5 x 3.7V lipos or is it just one? If so what is the capacity and C-rating? It sounds like the battery is too weak for the full load or not fully charged or maybe the connectors are wrong or the wiring is too thin.

Steve

calvinsamjoju:
receiver connection diagram :-

receiver code file has been attached below

Please make your images visible in your Post so we don't have to download them - I have already given you a link to the instructions.

Also please include your code in your Post for the same reason.

...R

I only have one 3.7v lipo battery and its capacity is 500mah

i bought it from a local shop. i don't know the c rating it is not written on the battery

arduino receiver code:-

#include "Arduino.h"
#include "config.h"
#include "def.h"
#include "types.h"
#include "MultiWii.h"
#include <RF24.h>
#include "NRF24_RX.h"
#include <Serial.h>

#if defined(NRF24_RX)

int16_t nrf24_rcData[RC_CHANS];

// Single radio pipe address for the 2 nodes to communicate.
static const uint64_t pipe = 0xE8E8F0F0E1LL;  //Should be same as the transmitter

RF24 radio(7, 8); // CE, CSN

RF24Data MyData;
RF24AckPayload nrf24AckPayload;
extern RF24AckPayload nrf24AckPayload;

void resetRF24Data() 
{
  MyData.throttle = 0;
  MyData.yaw = 128;
  MyData.pitch = 128;
  MyData.roll = 128;

  //Same as the transmitter code
  MyData.AUX1 = 0;
  MyData.AUX2 = 0;
  MyData.switches = 0;
}

void resetRF24AckPayload() 
{
  nrf24AckPayload.lat = 0;
  nrf24AckPayload.lon = 0;
  nrf24AckPayload.heading = 0;
  nrf24AckPayload.pitch = 0;
  nrf24AckPayload.roll = 0;
  nrf24AckPayload.alt = 0;
  nrf24AckPayload.flags = 0;
}

void NRF24_Init() {

  resetRF24Data();
  resetRF24AckPayload();

  radio.begin();
  radio.setDataRate(RF24_250KBPS);
  radio.setAutoAck(false);                    // Ensure autoACK is enabled
  //radio.enableAckPayload();

  radio.openReadingPipe(1,pipe);
  radio.startListening();  
}

void NRF24_Read_RC() {
  
  static unsigned long lastRecvTime = 0;

  nrf24AckPayload.lat = 35.62;
  nrf24AckPayload.lon = 139.68;
  nrf24AckPayload.heading = att.heading;
  nrf24AckPayload.pitch = att.angle[PITCH];
  nrf24AckPayload.roll = att.angle[ROLL];
  nrf24AckPayload.alt = alt.EstAlt;
  memcpy(&nrf24AckPayload.flags, &f, 1); // first byte of status flags
	
  unsigned long now = millis();
  while ( radio.available() ) {
    radio.writeAckPayload(1, &nrf24AckPayload, sizeof(RF24AckPayload));
    radio.read(&MyData, sizeof(RF24Data));
    lastRecvTime = now;
  }
  if ( now - lastRecvTime > 1000 ) {
    // signal lost?
    resetRF24Data();
  }
  Serial.print(MyData.throttle);
  nrf24_rcData[THROTTLE] =  map(MyData.throttle, 0, 255, 1000, 2000); //If your channels are inverted, reverse the map value. Example. From 1000 to 2000 ---> 2000 to 1000
  nrf24_rcData[ROLL] =      map(MyData.yaw,      0, 255, 2000, 1000);
  nrf24_rcData[PITCH] =     map(MyData.pitch,    0, 255, 1000, 2000);
  nrf24_rcData[YAW] =       map(MyData.roll,     0, 255, 2000, 1000);

  nrf24_rcData[AUX1] =       map(MyData.AUX1,     0, 1, 1000, 2000);
  nrf24_rcData[AUX2] =       map(MyData.AUX2,     0, 1, 1000, 2000);
  
}

#endif

MultiWii_RF24.ino (661 Bytes)

The data says circa 2.7A for each motor.

The lipos appear to be fitted with the so called 'protection' ciruits which will very likley limit the output current.

For high current applicatiosn you really need to be using Lipos without protection circuits.

I have also tried using a 4v lead acid battery to check whether the drone will reach full throttle without getting reset but I still have the problem, the Arduino gets reset

Anything else you have tried, just in case someone suggests you try it ?

You seem to be feeding 3.7v into the 3.3v regulator. I wonder is the difference between 3.7v and 3.3v sufficient?

When I power an Arduiino Attiny and an nRF24 from a 1S LiPo I just use a diode to drop the voltage for the nRF24. The 0.6v diode voltage drop is sufficient.

...R

I haven't tried using any other battery but i tried connecting all components except battery to the vcc pin and the positive wire from the battery to raw on the arduino pro mini. But there isn't any noticeable difference.

I'm using HT7333 3.3v voltage regulator which has no power loss

I didn't use diode because if i use 0.4v diode voltage drop and i have a 3.7v battery i get 3.3v but when the batteries voltage changes to 3.6v or 3.5v i will only get 3v which is not sufficient for the nRF24. So i used voltage regulator

calvinsamjoju:
I'm using HT7333 3.3v voltage regulator which has no power loss

A regulator that 'has no power loss' is not possible, no regulation can be 100% efficient.

So at the point of 'giving throttle' that causes your Arduino to reset, what was the measured supply voltage on;

The input to the HT7333 regulator ?

The output of the HT733 regulator ?

calvinsamjoju:
i will only get 3v which is not sufficient for the nRF24. So i used voltage regulator

3v is perfectly adequate. I have several nRF24 projects running off a pair of AA alkaline cells. The nRF24 datasheet says the lower limit is 1.9v unless the signal voltages exceed 3.6v, when the lower limit is 2.7v

And a silicon diode voltage drop is about 0.6v which is sufficient to protect the nRF24 from the 4.2v of a fully charged LiPo

...R

Sorry for the late reply

I used two diodes instead of the voltage regulator
I used two diodes because when I check with one diode it only decreased voltage from 4.1v to 3.8v which will burn the nRF24 so I added one more diode so I got 3.55v as output
I tried running the drone with the diode and the problem still exists . There was no difference at all

Are you sure the Arduino is resetting? The usual way to check that is by printing a message from setup() - if the message repeats the Arduino has reset.

Another option is to blink an LED from setup() with a pattern that is easy to recognise.

...R

calvinsamjoju:
Sorry for the late reply

I used two diodes instead of the voltage regulator
I used two diodes because when I check with one diode it only decreased voltage from 4.1v to 3.8v which will burn the nRF24 so I added one more diode so I got 3.55v as output
I tried running the drone with the diode and the problem still exists . There was no difference at all

Have you been measuring the 3.55V as you increase the throttle?
Can you post a picture of your project so we can see your component layout?
Thanks.. Tom... :slight_smile:

Hi,
This is the schematic from Electronoobs site;

Tom... :slight_smile:
PS Unfortunately its a search a word schematic, its simple enough it could really have ALL the wires.

I fought out that when I increase the throttle the voltage in the Arduino and in the nRF24 also decreases I don't know why I only tested with the voltage regulator
My circuit is parallel right??
Then why voltage drops according to throttle