Powering Arduino with a battery wont work

Hi everyone,

I am working on replicating a drone project from this YouTube video: Video Link. To minimize errors and simplify troubleshooting, I decided to follow the video’s setup exactly, using the same pins, hardware, and code.

I’m using an Arduino Nano and also tested with a Pro Mini as in the video. Both setups show the same issue. I tested several Nanos to rule out the possibility of a faulty unit, and I can confirm the Nanos worked fine in other projects. Additionally, the Pro Mini test behaves the same, so I don’t think the issue is with the Arduino boards themselves.

One more thing: I ordered my components from AliExpress, so they might not be original Arduino boards. Could this be a potential cause of the issue? However, I haven’t encountered this issue with these boards in other projects, and since both the Nano and Pro Mini exhibit the same behavior, I believe this is unlikely.

Issue Description: After assembling the components, I ran a test code that sets all four motors to a HIGH state for 5 seconds. When powered through a USB connection to the laptop, the motors run as expected. However, as soon as I switch to powering the entire system with a battery (via the VIN pin), nothing happens. The "L" LED on the Arduino starts flashing, which I believe indicates that the Arduino is stuck in a reboot loop.

Given that this is a small drone project, I’d like to avoid using power adapters or adding too many capacitors to smooth out the power supply to the motors, as Max (the creator in the video) didn’t include them, and the motors worked fine in his setup without them.

Questions:

  1. Could this rebooting issue be related to power supply instability when switching to battery power?
  2. Does the "L" LED flashing definitely indicate a reboot loop, and could this be caused by insufficient voltage or current?
  3. Is there something specific I should check with my setup or wiring to resolve this issue?

Circuit schematic:

Code:

const int pinD3 = 3;
const int pinD5 = 5;
const int pinD6 = 6;
const int pinD9 = 9;

void setup() {
  pinMode(pinD3, OUTPUT);
  pinMode(pinD5, OUTPUT);
  pinMode(pinD6, OUTPUT);
  pinMode(pinD9, OUTPUT);

  Serial.begin(9600);
}

void loop() {
  digitalWrite(pinD3, HIGH);
  digitalWrite(pinD5, HIGH);
  digitalWrite(pinD6, HIGH);
  digitalWrite(pinD9, HIGH);
  delay(5000);

  digitalWrite(pinD3, LOW);
  digitalWrite(pinD5, LOW);
  digitalWrite(pinD6, LOW);
  digitalWrite(pinD9, LOW);
  delay(5000);
}

Please let me know what additional information you might need to help me move forward, and thank you for your time

Power the motors separately and be sure to connect the grounds.

The design you show is utterly hopeless, regardless of whether the video misled you into thinking it might work.

Could this rebooting issue be related to power supply instability when switching to battery power?

Yes, that is the problem. Also, you cannot power the Arduino through Vin or "Raw" with a 3.7V battery.

The Nano VIN pin goes via a 5V regulator. The schematic for a Nano is here


There's no way that's going to work if you connect a 3.7V battery to VIN. You'd need about 6.5V minimum.

The video specifically calls for the 8MHz 3.3V version of the Pro Mini. But the Pro Mini also comes in a 16MHz 5V version. Neither that version nor the Nano will work with a 3.7V battery. So which version of the Pro Mini did you order from AliExpress? If you aren't sure, measure the voltage on the Vcc pin with your multimeter when powered from a 9V battery connected to Raw. If Vcc is very close to 3.3V, then you have the right Pro Mini. If it's higher than that, you don't.

It was the 3.3V version, but thx for the headsup and the output measuring tip

tested with the power supply with one motor and yes, it only starts working from 5.2V and quite slow too

I notice in the video that he describes the Pro Mini as the 3.3V version, but the product link below for the drone is for the 5V version, which of course is completely wrong.

Doesn't "8MHz 3.3V" just mean it can run at 8MHz with 3.3 V, and that all Pro Minis can take up to 5.5 V? If that's the case, you can safely power a "3.3V" Pro Mini with 3.7V, and it'll run fine at 8MHz (it could possibly run faster, say 9 or 10 MHz, depending on the voltage/frequency curve).

See Powering the arduino Pro Mini 3.3v from 3.7v 18650 battery to vcc pin - #6 by Paul_B

Yes, you're both correct here. After testing with a power supply, it started working at 5.2V on one motor. Does anyone have any idea how Max managed to get it working in his video? Could it be that he made some modifications that weren't shown?

Yes you can do that. But if it's actually a 5V Pro Mini, then you would have to power it unregulated at the Vcc pin, not the Raw pin, and you'd probably want to set the fuses to use the 8MHz internal oscillator because 16MHz isn't reliable below about 3.8V. But yes, if it's really a 3.3V Pro Mini, it should work fine with a 3.7V battery. I built a remote control that does exactly that.

Duh, he lied.

Tested that, and I can confirm that I have the correct Pro Mini, and it can run from a 3.7V battery. However, the motors won't run with the MOSFET setup I have, nor do they run directly from the cable or battery. If I connect the motor to VCC and GND and then apply the battery, the motor spins. I will keep digging into this later

Additionally, the L LED keeps flashing with the MOSFETs, no matter how much voltage is applied. I tried using a power supply with up to 9V, but still no results

I don’t know a lot about Arduino boards but everything from China has either manufacturer defects or is just plain junk

Did you read MaxImagination's pinned comment on the video?

UPDATE: This project tends to only work with the 5V 16mHz Arduino Pro Mini board (I used the 5V 16mHz Pro mini in the video under the assumtion that the 3.3V would also work for others, but apparently doesn't) - there hasn't been much success with the 3.3V 8mHz version showing up in MultiWii.
If you experience issues opening MultiWii on your Windows 10 or higher PC, it's because you do not have Java installed which MultiWii runs on. You're going to need to install Java 8u202 or earlier and edit your windows "path" data to point to that build, in order to use the MultiWiiConfig.

Thank you - I got it to work. A comment earlier suggested adding resistors between the digital pins and the transistor gate. After adding 330ohm resistors, the motors were spinning without the Nano resetting.

^ is what I presume to be MaxImagination said fixed his problem in development in post #12 from the thread that is on his phone at 13:18 in the YouTube video, this thread:
https://forum.arduino.cc/t/arduino-as-a-flight-controller-resets-under-motor-load-using-pwm-signals-and-multiple-transistors/944576/11

Got an answer from Max himself; he pointed out that it is indeed the Pro Mini 5V version that is required. I missed the comment below the video. I’m going to try that one and see if it works. For now, I’ll mark this as the solution

1 Like

Where does the 5V power supply come from to drive the 5V Pro Mini?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.