Arudino doesn't work after disconnecting the USB from the pc even with the code uploaded and the PSU connected

I made a simple code that turns a led on in order to see if the setup work after disconnecting the USB from my PC .The setup is connected to a pack of 4 AA batteries each outputing 1.5V so that means 6V in total, wires are hooked up in place, red to VIN or 5V and the gnd to GND, BUT the led isn't turning on! I tried this with other projects like Servo Sweep but it's the same.

Which Arduino or other "compatible" MCU board?

Welcome to the forum

The VIN and 5V pins have different purposes

VIN requires 7V and because it provides power via a voltage regulator
5V powers the Arduino directly so be very careful about supplying more than 5V

Please post the sketch that will not run on external power. Does it by any chance have a line of code something like while (!Serial); in it ?

It doesn't have any !Serial like line it

It's a GroundStudio Jade Nano+

Connecting 6V to the 5V pin may have blown the MPU, does it still work on USB?

I didn't connect it I was just saying It's always on VIN it works just fine

Please post the sketch that you are having problems with

It's simple...

void setup() {
pinMode(A0, OUTPUT);

}

void loop() {
digitalWrite(A0, HIGH);

}

How is the LED wired ?

Don't mind the other leds

Are are pins that go into the breadboard soldered to the Nano ?

1 Like

Noo

Then that is your problem

1 Like

I don't get it,why? If it work when connected to the PC even when not soldered how does it not work when it's connected to the batteries?

When you plug in the USB lead the Nano gets 5V directly from it

When you use the external power supply it is quite possible that neither the 5V or GND (or both) is not actually connected to the Nano

The connection pads an the Nano are not sockets into which the pins are plugged so they may well not be making contact. They really need to be soldered in order to make a good contact

But when connected to the battery the PWR led from the Nano turns on, colour red.

That does sound like the Nano is being powered but unless the pins are soldered to the Nano there is no guarantee of anything

Have you got a soldering iron and some flux cored solder ?

I have, but I want to make sure that everything is okay before soldering so that I can resolve any problem that could appear.