reading Vin pin

Hi there,

can I read the value on Vin pin directly without wiring it to analog in?

I'm powering my Uno through the 2,1mm plug from a 12V battery, the Vin pin should give about 12V as well. I'd like to read the battery voltage from this pin, something like analogRead(Vin); but, thats not the pin "name", can it be done this way? I really want to avoid using a voltage divider.

Thanks

No. You must use a voltage divider. Voltages above 6V directly applied to a pin will damage the chip.

Sure think, I don't want to apply that voltage into any pin, it should be already at the Vin - it has the same voltage as the input voltage connector, right? So can I read the Vin in software in similar way I read analog pins A0 through A5?

y100921: Sure think, I don't want to apply that voltage into any pin, it should be already at the Vin - it has the same voltage as the input voltage connector, right? So can I read the Vin in software in similar way I read analog pins A0 through A5?

Well no, because it'll be 12v, so you WILL be putting 12v into a pin although yes, it starts out at the Vin pin but you'll be shoving it into an analog pin. Hence CR's response re a voltage divider....

You don’t need to read the pin directly. Connect it to a normal analogue pin using a voltage divider and read the value from there.

Nah, I don't want to burn the voltage in divider... I just need to signal low voltage, so I'll probably use an alarm on the battery.

Thanks for replies guys!

I just need to signal low voltage

Then use a supervisor chip or a comparator.


Rob