This answer has three parts:
- What you described doing, and how that relates to elements of the Arduino design.
- What you might have done, to cause the symptoms you describe
- How you might start to narrow down the fault
What you described doing
I had connected a 12V battery pack to VIN and GND.
That is not a problem, that is the input to the inboard regulator so it's fine
I read that there's a diode on the board which selects the highest voltage in.
Yes, there is a Schottly MBR0520 diode between the USB supply and regulator output, the diode has a Vf of about 0.3v
At one point I disconnected the pack and then reconnected..
Point is, now the board wont start..
I'm not sure what to make of that, I don't see a reason for the board to get damaged
Arduino Nano schematic
What you might have inadvertently done
There's a list of ways to kill an Arduino which consists of
- Method #1: Shorting I/O Pins to Ground
- Method #2: Shorting I/O Pins to Each Other
- Method #3: Apply Overvoltage to I/O Pins
- Method #4: Apply External Vin Power Backwards
- Method #5: Apply >5V to the 5V Connector Pin
- Method #6: Apply >3.3V to the 3.3V Connector Pin
- Method #7: Short Vin to GND
- Method #8: Apply 5V External Power with Vin Load
- Method #9: Apply >13V to Reset Pin
- Method #10: Exceed Total Microcontroller Current
Number 4 and 7 are interesting candidates because, on the Nano, Vin and GND are adjacent.
If you have a Nano in a solderless breadboard, with wires connecting various IO pins to the breadboard, there is always the possibility of briefly accidentally touching a 12V power lead to some component leads that connect to an IO pin.
What you can do to narrow down the area of the fault
There are many components on the Nano board itself, by disconnecting everything else apart from power to Vin & GND you can use the schematic to work out what voltages or signals should be present at various points and use a multimeter to test whether the expected voltages or signals are present.
For example you can test the input and output pins of the 5V regulator. You'd expect to see 12V at the input and 5V at the output. If you don't get 5V at the output, you might suspect the regulator has failed. You could check it's datasheet and see what kind of protections it has.
You could also check the voltage at the reset pin of the ATmega chip. What happens when you press the reset button?
And so on.
In the end though, it isn't worth spending much time on this. Your aim is not to repair the Nano but to avoid frying another one. Reading about failure modes and taking care with connections is probably the best.
After reading the comments and researching "pull up registers" some more, I have come to understand that my mental image of "pull up" registers was wrong. Fundamentally, when the pull up configuration is used, the switch "press" causes a 0 on the pin. When the switch is open it causes a 1 on the pin.I thought it was the other way around, hence the confusion.
Thanks for all the help and the hints.
Best Answer
The LED should extinguish completely. You must have a wiring error or are not driving it correctly in the software.
One possibility is that you have the pull-up enabled in the processor.
The AVR microprocessor has the ability to enable a high-value pull-up resistor (20k) if needed. If you do this when you intend to turn the LED off it will glow dimly.
One way this can happen is to set the pin_mode() as INPUT_PULLUP. It will also happen if you turn the pin to an input and write a 1 to the pin output register.
The usual way to connect an LED to an Arduino or other processor is to connect one end of the LED to the +5V with the other end connected to the output pin through a resistor in the range of 220-1000 ohm depending upon the LED and brightness required.
Some people call this resistor a current-limiting resistor, I prefer to call it a current defining resistor. It is not there to protect the LED it is to set the desired current.
You write 0 to the pin to turn the LED on and a 1 to turn it off.