+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Banned
    Points: 277, Level: 3

    Join Date
    Nov 2018
    Posts
    42
    Helped
    0 / 0
    Points
    277
    Level
    3

    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

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 68,549, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,002
    Helped
    3206 / 3206
    Points
    68,549
    Level
    63

    Re: Lm358 circut problem

    Hi,

    Schematic is missing...

    Use the "Insert image" button in top toolbar.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Banned
    Points: 277, Level: 3

    Join Date
    Nov 2018
    Posts
    42
    Helped
    0 / 0
    Points
    277
    Level
    3

    Re: Lm358 circut problem

    Click image for larger version. 

Name:	image.png 
Views:	19 
Size:	272.3 KB 
ID:	150163 Here is my picture.



    •   AltAdvertisment

        
       

  4. #4
    Full Member level 1
    Points: 1,708, Level: 9

    Join Date
    May 2013
    Posts
    107
    Helped
    23 / 23
    Points
    1,708
    Level
    9

    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.



  5. #5
    Super Moderator
    Points: 76,044, Level: 67
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,439
    Helped
    4143 / 4143
    Points
    76,044
    Level
    67

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--