Arduino mini, leds blinks when it shouldnt whith battery power

Hi,

I got an Arduino Mini 04, and have a little problem with it. When I power it with a battery trough the 9v+ and GND pins, a led that I have connected to pin 13 lights up, but it is blinking. It is blinking like there is something wrong with the power supply. It's brightnes is lower, and it looks like it blinks with about 10ms delay. This happens with any voltage connected from 5-9V. When I use the 5V pin and using a battery or an Arduino Uno, then there are no problems.

So why are the led blinking when a battery is connected? It looks like the loop does not run either. Is it the power regulator on the mini?

The Mini is designed with a lp2985 regulator, which has a relatively small amount of current capability: 150mA. (300mA peak). With an input voltage of 9V, you can probably only get about 100mA out of it before it starts shutting down.

Do have any other hardware connected to the board and what is the value of current limiting resistor are you using with the LED?

Thanks for your reply.

I had some other hardware connected. Had one of these connected: APC220 Radio Communication Module - DFRobot

When I unplugged the power from it, it worked fine. Almoust. The led did not blink at it did at startup, but in my test code for the radio module, it sets pin13 high in the setup. It does not turn on. I do not have any resistor before the led, since pin13 has an bulit in resistor.

Any ideas?

Here is the test code that is uploaded to it

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */


void setup() {                
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);   
  Serial.begin(9600);
  Serial.println("  Lets test the bluetooth module");
  Serial.println("Press 1 to light the LED, and 2 to turn it off");
  Serial.println("Entery: ");  
   digitalWrite(13, HIGH);
}


void loop() {
  if (Serial.available()){
  char input = Serial.read();
  switch (input){
  case '1': //turn led on
  digitalWrite(13, HIGH);   // set the LED on
  delay(100);              // wait for a second
  Serial.println("it works on!!");  
  break;
  case '2':
  digitalWrite(13, LOW);    // set the LED off
  delay(100);              // wait for a second
  Serial.println("it works off!!");
  break;
}
  }
}

The LED use to blink and now it won't turn on at all? You didn't turn the LED around by accident, did you?

The LED blinks when it get data on RX from the radio module. But in the setup, it sets it high, so it should turn on. And no, it does not.

No, the led is not turned arround. It blinks at startup.

So you have pin 13 connected to something other than just the LED?

Pin13 is connected to the led, nothing else.

It seems like the setup() and loop() does not run. But only when I supply power trough the 9V pin. If I use a battery on 5V and supply it trough the 5V pin, it works fine. But any voltage from 5-9V on the 9V pin, then it does not work.

Sigh. Please be clear what hardware is connected and what code you are running.

As I tried to explain, the regulator used by the mini has a very limited current capability. It really isnt suitable for anything but the mini itself. Does your test code work if the radio isn't connected when you are powered by battery?

What kind of 9V battery? Is it the small rectangle type? If so, that is also a source of issue since IT has a very limited current capability itself.

As I wrote, the hardware that has been connected is the radio module I linked to earlier. It only takes 48mA max on Tx(or Rx, dont remeber...)

I removed it, and using the same code as posted above. The only thing, is that when the radio module is not connected, I can not switch it off or on, but in the setup() it sets 13 high, so it lights up when it is starting.

the 9v battery is a small rectangle type, yes. I have tried different power sources. The battery was on 200mA, but I have also tried to power it with a more powerfull 9V battery on 2000mA. No difference, since the regulator does not let so much power go trough. But why does not the loop run?

I have also tried to power up the radio module with a separate power supply. Still no loop running.. I can try to upload a different code, but it should work with this one too...

Any Ideas?

If you read the thread you find the info you need, like hardware and code..

It is still not working. Have tried different test codes, like the blink example, and the test code as posted above in the thread( It is a modifyed blink example...)

I have tried with and without the radio module, the only difference was the led did not blink as it did whit it connected. It is hard to explain how it did blink, but I can try. When the led should be on, and not blink, it looks like it blinks with a 10ms delay between the blinks, and it is almoust not visible, but the brightnes is oufcorse weaker... But whit the radio module removed, it did work properly at startup, but the setup() (witch sets pin13 HIGH) does not start, and since there is no setup() starting, no loop() either.

Can someone help me?

Any help?

I am having the same problem on my Arduino UNO R3. On USB-Power my sketch is running perfectly, on 9V battery it fails after some minutes and the LED13 starts blinking. Even the reset button does not help any more. But on USB-Power (with or without 9V Battery) everything is working perfect.

I am using really simple procedures for blinking my 6-7 LEDs, switching between different blinking modes by pressing a button. Sample code

// just blink all leds
void mode1() {
mode2millis2 = millis();
if (mode2millis2-mode2millis1>=1000) {
mode2millis1 = mode2millis2;
mode1value = mode1value == HIGH ? LOW : HIGH;

for (i=0; i<ledCount; i++) {
digitalWrite(leds*, mode1value);*

  • }*
  • }*
    }
    I am using 100 Ohm resistors for my leds and 1KOhm as a pull-down resistor for the button.
    Just tested the batteries... on my 9V (tested to have 6,82V) the leds at least light up... on my 9V (tested to have 8,66V) not a single led lights up and LED 13 is blinking dimly but very fast (almost on).
    Will try with a fresh battery tomorrow...

Those batteries sound so under voltage that they are shot and will not power anything for any length of time.

Thanks, yes, it has something to do with batteries... just connected my board to a constant 9V source and everything is working just as expected... even 7,5V, 6V and 4,5V are powering the board perfectly...