Skip to main content
Tweeted twitter.com/StackElectronix/status/1008175722995777536
schematic updated based on @stevenvh and @Nick's suggestions
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic (updated for a 2nd time based on suggestions of @stevenvh and @Nick):

Voltage divider w/ Switchenter image description here

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic (updated for a 2nd time based on suggestions of @stevenvh and @Nick):

enter image description here

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

Updated schematic with P-MOSFET
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ SwitchVoltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

Changed to P-MOSFET high-side switch
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and FETP-MOSFET switch added based on @Jonny@stevenvh and @stevenvh's@Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ SwitchVoltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and FET switch added based on @Jonny and @stevenvh's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

What I am working with: I am running my self-made Arduino board (in the sense that I use the Arduino bootloader and code editor) at 3.3V, and powered from a Lithium ion battery, which is USB-charged by a corresponding Microchip charger IC.

What I am trying to achieve: I want to measure battery capacity once every minute or so. I have an LCD attached, so the idea is that the overall setup lets me know how the battery is doing at a given moment. The datasheet of the battery has a voltage versus discharge-level curve, and so by measuring the voltage of the battery, I can estimate the remaining capacity (very roughly but enough for me!).

What I did:

  • (EDIT: Resistor values updated and P-MOSFET switch added based on @stevenvh and @Jonny's suggestions).

  • I connected a voltage divider from the battery V_plus, with the larger "portion" going to an analog-read-pin (i.e., ADC) on the Arduino/Atmega chip.

  • The divider is 33 KOhm-to-10 KOhm, thus allowing measurement up to 4.1 Volts maximum of the Li-ion battery from my 3.3V level microcontroller.

  • Also, using one of the I/O pins connected to an n-channel MOSFET, I can switch the current through the divider only when I need the measurement.

  • Here is a rough schematic:

Voltage divider w/ Switch

My question:

  • How is my current setup?

  • My only constraints are: (1) I would like to make a rough measurement of the battery capacity based on the voltage reading, as described above. (2) I would like to prevent the voltage divider from interfering with my charging IC's reading of battery presence (in my original setup, the divider sometimes caused the IC to misread presence even when the battery was absent).

deleted 9 characters in body
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74
Loading
updated based on @Jonny and @stevenvh's suggestions, and added schematic
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74
Loading
Source Link
boardbite
  • 5k
  • 12
  • 49
  • 74
Loading