How do I measure current with a current using the INA2181A4QDGSRQ1 circuit?
@franlelin
First determine the maximum current you want to measure: Imax
Then find the shunt (sense) resistor value, use this formula
R = 5/(200*Imax)
Connect the shunt resistor between IN- and IN+
Connect Vref to ground.
Connect your power to IN+.
Connect your load betwen IN- and ground.
Do you understand?
Yes, thank
Now i want this current using my microcontroller ESP32. How todo please?
I already have this schematic in my board and my main problem is read signal I_charge using my microcontroller ESP32
What is Vref?
Where are the sense resistors?
Are you reading uni-direcional or bi-directional currents?
Vref is set at 0.5V using my microcontroller
sense resistor is connected to another sheet but communicates with this sheet
i want to read bi-directional current I_Charge and I_discharge
So exactly what is the problem?
went i use my voltmeter for reading voltage I_charge i have 1.42V and went i use microcontroller to read this same signal i have 3.3V
Are you using an ESP32 module or a board?
I use ESP32 module
Did you try the ESP AnalogRead example included in the Arduino package?
You should also read the documentation on how to use the ADC
https://docs.espressif.com/projects/arduino-esp32/en/latest/api/adc.html
yes, went i use the same pin to read others voltage i have a good reading but the problem occurs went i try to read the specifique value of I_Charge
OK
What are the sense resistor values and what is the max current you are trying to measure?
sense resistor is 0.001ohm and max current that i want is 5A
Without seeing the entire schematic and board layout and entire code, I would just be guessing as to what is wrong.
From what you have shown so far, I can't see any problems.
which ESP32 microcontroller board are you using?
remember the maximum input to a ESP32 ADC is 0 to +3.3Volts
what is the voltage you are attempting to read?
is it AC ? if so you have to offset it to the 0 to 3.3volt range
upload a schematic showing your wiring?
also have a look at fixing-the-non-linear-adc-of-an-esp32
I have deleted your other cross-post @franlelin.
Cross-posting is against the Arduino forum rules. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.
Repeated cross-posting can result in a suspension from the forum.
In the future, please only create one topic for each distinct subject matter. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.
Thanks in advance for your cooperation.