Measuring analog voltage

I’m building a project to test the voltage of laptop power supplies. All I really need is to be able to plug in the adapter and have a light illuminate if the voltage is correct. I did some research into the specifications of the charger and came up with this info:

6.5V idle voltage in power save mode,
16.5V active voltage, activates when 40K OHM load is applied
60W total power output

I built the following circuit and it worked beautifully with the first charger. The LED lit and A0 read about “440” through the serial to my PC. http://imgur.com/3vPenOw
However, I plugged in a second known-good charger and smoke started rolling out of my uno. The LED still lit and didn’t feel hot. There was a clear melted plastic look on pin 22 (GND) of my ATMEGA. Any advice on redesigning the circuit for safer measurements?

Thanks!

Run the to-be-tested voltage thru a voltage divider so it is no higher than 5V.
Do not rely on the LED to be the voltage limiter.
Most 7805s also need caps on input & output for stability - look up the datasheet from the manufacture of yours and add accordingly.

I'll look into the caps for the 7805, but I'll be running on USB power for the moment. Would a 120K resistor between +16.5V and A0, with a 39K between A0 and GND be sufficient?

There was a clear melted plastic look on pin 22 (GND) of my ATMEGA.

There shouldn't be this kind of "power" going through the ATMEGA. Are you sure you're not connecting a wire with NEGATIVE voltage to GND?

EDIT: Are there other connections not shown, like USB serial connection with GND at a different potential, due to above?

What is the maximum safe current an analog pin can withstand? I'm considering adding a fuse to the circuit as well. Some of these chargers are junk Chinese knockoffs and I'd rather not blow another chip and have to wait a week (again) for it to get here.

What is the maximum safe current an analog pin can withstand?

Its high impedance - out of spec voltage will be the main concern.

dlloyd:

There was a clear melted plastic look on pin 22 (GND) of my ATMEGA.

There shouldn't be this kind of "power" going through the ATMEGA. Are you sure you're not connecting a wire with NEGATIVE voltage to GND?

EDIT: Are there other connections not shown, like USB serial connection with GND at a different potential, due to above?

The 7805 was not hooked up during my original testing, the schematic was more of my hope for a final design. I was using USB power for the arduino during testing. Surprisingly enough the ATMEGA was still partially working after this happened. Although, I switched back to the formerly working charger and that killed my Uno for good.

dlloyd:

What is the maximum safe current an analog pin can withstand?

Its high impedance - out of spec voltage will be the main concern.

I measured 2.4 V across the LED prior to attaching my Uno. I attached the arduino in parallel with the LED, A0 connected to the anode, GND connected to the cathode.

jlinbu:
I measured 2.4 V across the LED prior to attaching my Uno. I attached the arduino in parallel with the LED, A0 connected to the anode, GND connected to the cathode.

No matter what you do, you cannot safely put more than 5 volts or less than 0 volts into any Arduino pin. Period.

To measure higher voltages, you need a voltage divider. For example, imagine two 10K resistors in series, one end to ground, the middle to the arduino and the other end to what you want to measure.

Since both resistors are the same (10K each), it makes a 50/50 split. That is, 10 volts in will give you 5 volts out (the center node) and with that circuit you can safely measure from 0v to 10v.

If you need to measure higher voltages, you must re-design the divider accordingly so that you NEVER get more than 5v going to the Arduino input.

Make sense?