Hello, I'm brand new to the world of microcontrollers and electronics so cut me a little slack on this one. I have an Arduino Mega2560 and I'm looking to measure it's own Vin voltage. I've drawn and attached an image of a breadboard layout of what I believe and am hoping will do what I want it to do. The battery is connected to the controller and along the connection line is a voltage divider (10Kohm and 8Kohm). I'm measuring across the 10Kohm resistor with the ground on one side and the 0A analog input pin on the other side. My hopes is that this cuts down the 9Vin to 5v which is the reference voltage of the board and I will be about to calculate the board's source voltage. Am I doing this correctly? And I mean even to the basics, are all the wires at the right spots including the battery terminals. I don't want to fry my board.
I also am aware that this current circuit design will put a constant drain on the battery through the voltage divider. I plan to insert a gait to prevent the constant drain unless I am measuring the voltage. As far as that is concerned, I would also like to know which part I should use for the gait. Would it be an NPN or PNP transistor? Or would that not work because I'd get amplification and an inaccurate reading? Or should I just use a SPST relay? Also, would I be okay just using one gait anywhere on the voltage divider or would I have to place a gait on both sides of the analog pin on the voltage divider?
Thanks a lot in advance,
Stauffski