ukmars / ukmarsbot

A simple beginners multi purpose robot platform
MIT License
67 stars 17 forks source link

Change the ratio of R7 and R8 (which derive BATTERY_VOLTS) to output < 3.3V for 3.3V MCUs #31

Closed gbulmer closed 1 year ago

gbulmer commented 3 years ago

Currently R7 and R8 are the same value (10k), which divides a battery voltage (V_BATT) of 9V down to a BATTERY_VOLTS of 4.5V.

That is too high for the ADC inputs of 3.3V MCUs (eg. Arduino Nano 33, STM32, etc). That voltage may cause damage to the ADC and MCU. It is also above the measured range of the ADC, and hence the ADC can't monitor changes of battery voltage.

Change the ratio of R7 and R8 to derive a BATTERY_VOLTS value below 3.3V from a 9V battery.

This will lose some range and hence resolution, for Arduino Nano. However, UKMARSBOT's BATTERY_VOLTS would become 'safe' and usable for 3.3V MCUs.

(Note: there may be other issues which I have not considered that would cause damage to a 3.3V MCU. SO there may be more changes required.)

micromouseonline commented 1 year ago

For continuity, it s best left as-is for now.

A note is needed about mods for using 3V3 processors anyway and this should be part of that note.