Arduino nano powers on but does not execute the code

My nano v3 (atmega 328version, not official:) ) works just fine and gives the expected serial output via bluetooth when a usb power supply used. However, the problem begins when I power it with a 9 volt battery on the Vin and Gnd pins. The board seems to work ie.there's no smoke or overheating :smiley: but also no serial output. As it's a clone board, it is expected to have problems but could you please let me know if it's only me having that problem or maybe there should be something extra in the code or with the connections while using the external power ports? Otherwise I'll have to use an extra lm 7805 and connect the 5V output to usb port on the board.

Is the 9V battery fresh? Perhaps it's too weak to power the BT module properly (what module is it, anyway?)
Do "regular" code examples, such as a Blink, work with the 9V battery?

If the unit works when there is enough power, I would as igendel suggests, check the battery.

Thanks for your help first,
Yes, the battery is fresh. Blink example works and even sends messages through bluetooth like "led is on/off". So the battery can provide enough current and the board is functioning well. The problem seems to be with the rfid reader connected to the arduino over i2c. The rfid reader is connected on the A4(SDA) and A5(SCL) pins. There's no problem when powered using usb port(sends rfid data through bluetooth). When an external power supply used, rfid module turns on(its led lights) but seems like there's no data transmitted to the board. What can be reason for this? I'm also checking and trying some modifications in the code right now.

berkeralpz:
The problem seems to be with the rfid reader connected to the arduino over i2c

Yeah well, that's the sort of thing you should have mentioned from the start...
Do the I2C lines have pull-up resistors? Someone else in here just had a problem because he forgot those.

igendel:
Do the I2C lines have pull-up resistors?

You're right,I should have mentioned it before. I've just realised that the problem was about the I2C lines. Here's what I have:
-Arduino Nano V3 clone
-HC-05 Serial Bluetooth Module
-PN532 RFID Module

In the schematic of the RFID module( http://www.elechouse.com/elechouse/images/product/PN532%20NFC%20Module/NFC_EASY_SHIELD_V2.0.pdf ) I thought R6&R7 were the pull-up resistors and didn't use any additional resistors. Aren't they the pull-up resistors that already connected on the board? According to the schematic, they both have 4K7 ohms of resistance.

berkeralpz:
I thought R6&R7 were the pull-up resistors and didn't use any additional resistors.

Perhaps. I was just guessing.
You can connect V and GND from the arduino and verify with a multimeter that these lines are high. While at it, just to be certain, probe the RFID module power lines to see whether it gets the same voltage (or uses the same current) under USB or battery.

Hi, 9V batteries are a poor way to power an Arduino imho. Better to use 3 or 4 "ready-charged" rechargeable AA or AAA cells (but not 4 non-rechargeables) and bypass the Arduino's regulator.

Paul

HI, your RFID unit probably draws a high pulse load when it triggers an RFID card.
Check the specs on it.

Tom..... :slight_smile:
Also a circuit diagram would be helpful thanks.