5V+ Voltage to the arduino analog

If I connect a 12V / 12V+ battery to the arduino (uno) analog, will it be damaged ? What if I connect 230-240V to it ? Don't worry I haven't tried it yet. :D

If I connect a 12V / 12V+ battery to the arduino (uno) analog, will it be damaged ?

Yes, certainly.

What if I connect 230-240V to it ?

The chip will be damaged for sure and you may be damaged, as well, by the shrapnel from the exploding chip.

For 12VDC you can use a [u]voltage divider[/u], or a [u]protection diode[/u], or both.

For the power line, you need electrical isolation (for the Arduino and also yourself) as well as protection from voltages greater than 5V. For AC, you also need to protect the Arduino from the negative-half of the AC waveform. A transformer or an opto-isolator, or in some applications a relay, can be used for electrical isolation.

Dasaradh: If I connect a 12V / 12V+ battery to the arduino (uno) analog, will it be damaged ? What if I connect 230-240V to it ? Don't worry I haven't tried it yet. :D

As long as you are not powering other devices from the Arduino's 5V regulated output. The Ethernet shield draws more than 150ma from the VCC line. this additional load will overheat the Arduino's onboard 5V regulator if the Input power is above 9V.

Chuck.

chucktodd: As long as you are not powering other devices from the Arduino's 5V regulated output. The Ethernet shield draws more than 150ma from the VCC line. this additional load will overheat the Arduino's onboard 5V regulator if the Input power is above 9V.

Chuck.

I don't understand this and I am worried that it is wrong and unsafe.

The OP has not mentioned anything about the 5v regulated input - he has only mentioned the analog pins.

The advice in Replies #1 and #2 is safe.

...R

Robin2: I don't understand this and I am worried that it is wrong and unsafe.

The OP has not mentioned anything about the 5v regulated input - he has only mentioned the analog pins.

The advice in Replies #1 and #2 is safe.

...R

Your are correct, I miss interpreted his question, Though he was asking about powering the Arduino.

He wants to measure a 12V value with the Arduino Analog Input.

Now a voltage divider makes sense.

When I saw 12V I immediately ignored all input pins, and defaulted to the only connection that could handle that voltage (vin) ;)

Assume got me (ass u Me) ;)

chuck.