Where to turn the trimmer
Arduino C++Work out R2 and the trimmer turns for 3.3 V, 5.0 V and 12.0 V, and print each as "5.0 V: R2 = 1011 ohm, 2.5 turns". Flag any voltage a full 2S pack (8.4 V, less about 1 V of dropout) cannot give with a line saying "needs a 3S pack".
Checks
- Not run yetPrints the 3.3 V line: R2 = 555 ohm, 1.4 turns
- Not run yetPrints the 5.0 V line: R2 = 1011 ohm, 2.5 turns
- Not run yetPrints the 12.0 V line: R2 = 2890 ohm, 7.2 turns
- Not run yetSays 12 V needs a 3S pack
Hints
- Vout = 1.23 x (1 + R2 / R1). Solve for R2: R2 = R1 x (Vout / 1.23 - 1).
- The starter forgets the - 1: at 5 V it says 1341 Ω, which would give 6.25 V.
- A buck only steps down: anything above 8.4 - 1.0 = 7.4 V needs a bigger pack.