“This allows the VL and/or VS inputs to be connected to two of the AtMega328’s analog inputs through a 4:1 voltage divider. For example, if the battery voltage were 9vdc, the analog input would see 2.25vdc.”
Can anyone tell me what the purpose of this is? To be able to measure the input voltage programmatically? Or to set a specific voltage reference? I’ve googled and searched the forums to no avail.
(I’m teaching a high school class that is using this board, and I’d like to be able to give students a definitive answer. I’m also curious!)
They are there to allow you programmatically to measure the voltages that are coming in on the Servo and/or the Logic power connections.
They go through a voltage divider of a 10K and a 30K resistor. So the voltage at this pin is 1/4th the actual voltage.
Example usage: Suppose you are running a hexapod robot using a 2S LIPO battery. The normal voltage for this battery is something like 7.4 volts, with a fully charge voltage somewhere over 8 volts. So without the voltage divider connecting this directly up to an analog pin would exceed 5v and probably damage the board.
While running your program, if you run the voltage down to below some voltage, you can easily damage the battery and worst case fire… So for example we have code in the Phoenix code base that checks the voltage. If it goes below some warning level, we may beep, flash leds, to warn you. If it goes below another level the code will turn off the servos.
Suppose we wish to detect 7 volts. through the voltage divider that will give you somewhere near: 1.75 volts, using the AtoD converter, I believe that translates to something like:
1024 * 1.75 / 5.0 = 358