Welcome to MicroROS Self-balancing Robot Car repository
04.Power circuit design
Power circuit design
The balancing car is powered by a 12V lithium battery with an output voltage of 12V; we need to step down the 12V voltage input from the DC port to 5/3.3V for the development board.
Power supply circuit
Use the step-down chips MP2225 and AMS1117 to provide stable 5V and 3.3V power to the development board.
MP2225: supports a wide input operating voltage range of 4.5-18V → steps down the 12V voltage of the DC port to output a stable 5V voltage → supply voltage for some module interfaces;
AMS1117: further steps down the stable 5V voltage to 3.3V → for the main control chip.

Voltage detection
Use ADC to collect voltage with a maximum range of 3.3V. To measure the battery pack voltage, the voltage after voltage division needs to be given to the ADC detection channel, and finally the actual battery pack voltage is calculated by the voltage division formula.
Referring to the hardware schematic diagram, we can see that: Current equality principle
ADC input range is: VREF- ≤ VIN ≤ VREF+Generally, VSSA and VREF- are grounded, VREF+ and VDDA are connected to 3V3, and the input voltage range of the ADC is: 0~3.3V
