• Twitter
  • Youtube
Rocket Scream
  • Blog
  • Shop
    • Arduino and Compatibles
      • Mini Ultra Series
      • osPID
    • Component
      • Connector
      • Interconnect & Cables
      • Wires
      • Sensors
        • Temperature
    • Wireless
      • Antenna
      • Module
  • Forums
  • Docs
  • Contact
  • About
  • My Account
  • Search
  • Menu Menu
  • 0Shopping Cart

Battery Voltage Monitoring on Mini Ultra Pro

You are here: Home1 / Docs2 / Battery Voltage Monitoring on Mini Ultra Pro
Overview

The Mini Ultra Pro was designed to be ultra low power when operating from the Li-Ion or Li-Polymer battery. Starting from V3 of the Mini Ultra Pro, we have added a simple battery voltage monitoring on pin A5. A simple resistor divider circuit (using a pair of high resistance value to reduce current consumption) with a decoupling capacitor (that also helps to hold the voltage as the internal ADC circuitry on the microcontroller has a limited input impedance range) is used.

The voltage divider will scale the maximum voltage of 4.2V of battery down to just below 3.3V to fit into the microcontroller ADC input voltage range.

VADC = (R16/(R15+R16))*VBAT
VBAT = VADC*((R15+R16)/R16)
VBAT = VADC*((3.3M+1M)/1M)
VBAT = VADC*4.3 V
Code

The following will convert the raw ADC voltage on pin A5 into the battery voltage. We perform some averaging here that basically increases the resolution of our reading.

int adcReading;
unsigned char counter;
float batteryVoltage;

adcReading = analogRead(A5);
// Discard inaccurate 1st reading
adcReading = 0;
// Perform averaging
for (counter = 10; counter > 0; counter--)
{
  adcReading += analogRead(A5);
}
adcReading = adcReading / 10;
// Convert to volts
batteryVoltage = adcReading * (4.3 / 1023.0);

Do that note that if no valid battery is inserted, the reading will be a random value.

Follow us on Twitter

Tweets by rocketscream

Subscribe to our newsletter

Information

  • About
  • Contact
  • Covid-19 Shipment Update
  • Ordering Info
  • Returns
  • Shipping Info
© Copyright - Rocket Scream Electronics
  • Twitter
  • Youtube
Tiny Reflow ControllerGetting Started with Mini Ultra LoRaWAN
Scroll to top

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies.

OK

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Google Analytics Cookies

These cookies collect information that is used either in aggregate form to help us understand how our website is being used or how effective our marketing campaigns are, or to help us customize our website and application for you in order to enhance your experience.

If you do not want that we track your visit to our site you can disable tracking in your browser here:

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Other cookies

The following cookies are also needed - You can choose if you want to allow them:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy Policy
Accept settingsHide notification only