Arduino uno does´t work with external supply power, just with usb to computer

i have a 5V and 12V Super rechargeable Li-ion Battery, and im trying to power my arduino with it, its an amergency because tomorrow i have to present a robot and it doest work. My Arduino is an Arduino UNO R3, i try connecting the 12V power to the barrel plug in the arduino. It doesnt work. I try connecting de 5V power from the battery to the USB port in the arduino. It doesnt work. BUT when i connect the arduino by the USB to the computer it works!

my code is this:

int led[5] = { 3, 4, 5, 6, 7}; // Assign the pins for the leds

int leftChannel = 0;
int left, i;
int Valor1;
int Valor2;
int Valor3;
int Valor4;

void setup()
{
for (i = 0; i < 5; i++)
  pinMode(led[i], OUTPUT);
}

void loop()
{
left = analogRead(leftChannel);
Valor4 = Valor3;
Valor3 = Valor2;
Valor2 = Valor1;
Valor1 = left;


left = left/5;

if (Valor1+Valor2+Valor3+Valor4==0){
   for(i = 0; i < 5; i++)
     {
     digitalWrite(led[i], LOW);

     }
  }

  else
  {
   for (i = 0; i < left; i++) 
    {
     digitalWrite(led[i], HIGH);

    }

    for(i = i; i < 5; i++)  
     {
      digitalWrite(led[i], LOW);

     }
  }
}

I believe it is the serial communication, i have tried connecting a 10k resistor from RX/TX to GND but it doesnt work. help please!

Thanks!

dahngeek: i have a 5V and 12V Super rechargeable Li-ion Battery, and im trying to power my arduino with it

When the battery is connected, what voltage is preset on the Vin pin and 5V pin of the Arduino?

dahngeek: It doesnt work.

What does this mean? What "doesn't work?" How do you know it "isn't working"?

dahngeek: I believe it is the serial communication

Since that code contains nothing related to serial communication, I doubt it is the problem.

Hi, i get in the Vin pin: 4.55V and in the 5V pin: 5:04V

When i say it doesnt work is that the script doesnt runs correctly. Its a vumeter, in the A0 is the audio signal, and the leds turn on depending on the volume oof the song. when i run it connected to the computer, it works, the leds blink and turn on according to the volume of the song, when running on the battery, it onnle turns on all the leds, and nothing more.

Hmnn, ok, i said that because researching i've found that the TX/RX cause that problem in other cases.

Thanks for answering

It sounds like you haven't got a common ground between your audio input and the arduino. When Connected to a computer you can get a ground through the computer depending on how your set up is wired. Try just a simple blinking LED sketch to check it works with your power supply.

dahngeek: i get in the Vin pin: 4.55V and in the 5V pin: 5:04V

That's not possible.

If you put 12volts into the barrel jack and measure 4.55volts on Vin, it is absolutely not possible for 5V to be 5.04volts. Are you making this measurement while the 12volt supply and USB are connected at the same time?

You can get a lower voltage on the Vin pin if you just feed 5V into the 5V pin with nothing into the barrell, which is what I think he is doing.

A very simple possible solution to this is use the 9V battery, and plug the positive pin into the "VCC" pin on the arduino UNO, then just plug the ground pin into the ground pin on the UNO.

capacitor99: A very simple possible solution to this is use the 9V battery, and plug the positive pin into the "VCC" pin on the arduino UNO, then just plug the ground pin into the ground pin on the UNO.

No, it is not. Rectangular 9V batteries are absolutely lousy options for most Arduino projects. They are only designed to deliver 25mA of current long term, which is the load the Arduino board itself draws.

The original poster claims to have a 12V battery, we need to focus on if that is really the case or why it is not working.

I have a question somewhat related to this, and in the spirit of helping the OP make connections more easily. If I want to power a Uno from 12V (from a switchmode PSU), do/can I use the Vin pin for this? I have seen it documented that this is so, but there's very little mention of it. It'd suit me a lot better than making up a cable/barrel plug from the existing 12V circuit that'll be used with the Uno (12V LED lighting).

@emueyes

If I want to power a Uno from 12V (from a switchmode PSU), do/can I use the Vin pin for this

YES. you can use the Vin for the +12v, and ground for the PSU ground.

Cool, thank you.