# LM358 Circuit Problem

1. ## LM358 Circuit Problem

1, J3A is the 7.2V battery pack charging and discharging interface
2, DIS_CHG and PWM control battery pack charge and discharge
3. BV1 and BV2 are respectively connected to the ATmega16 pin, and BV10 and BV20 are used to detect the voltage across the resistor R13.
4. By measuring the voltage drop across R13, the MCU calculates the charging current, and determines the charging and discharging operation according to the current.
problem:
1, LM358 should be used as an intermediate device, the purpose is to convert the voltage value that can not be used by the microcontroller to be usable, right?
2. Ask friends to explain how the microcontroller handles the voltage across R13 and convert it into current  Reply With Quote

•

2. ## Re: Lm358 circut problem

Hi,

Schematic is missing...

Use the "Insert image" button in top toolbar.

Klaus

1 members found this post helpful.  Reply With Quote

•

3. ## Re: Lm358 circut problem  Reply With Quote

•

4. ## Re: LM358 Circuit Problem

1) Yes. Althought not needed, it is a good practice to use a buffer to isolate analog voltages from the MCU.

2) You should just subtract the voltage measured in the ADC for both BV10 and BV20. You are able to know which is greater, so you can know the current direction. As R13 is a 1R resistor, the ADC value converted to Volts will give the voltage in Amperes.  Reply With Quote

5. ## Re: LM358 Circuit Problem

1, LM358 should be used as an intermediate device, the purpose is to convert the voltage value that can not be used by the microcontroller to be usable, right?
Not quite. The voltage is brought within the range of the microcontroller by the potential divider R6/R8 and R7/R9, the amplifier is configured as a unity-gain buffer so the impedance presented to the ADC is low which improves accuracy.

2. Ask friends to explain how the microcontroller handles the voltage across R13 and convert it into current
The two buffers are identical so one gives a scaled voltage of BV10 and one gives an identically scaled voltage of BV20. The difference between them is the voltage dropped across R13. So by subtracting BV20 from BV10 and knowing the value of the resistor you can use Ohms law to calculate the current through it.

Brian.  Reply With Quote

--[[ ]]--