Author Topic: Simple current detection  (Read 779 times)

0 Members and 1 Guest are viewing this topic.

Offline JJallingTopic starter

  • Supporter
  • ****
  • Posts: 246
  • Country: dk
Simple current detection
« on: February 04, 2021, 02:55:49 pm »
Hello,

I have a stm32 running at 3V3. I want to monitor a USB VBUS (5V) line and detect if the current draw is higher than say 50-100mA (the number doesn't need to be exact - just ball park).

How would you do this with as few external components as possible? A sense resistor and a voltage divider on the VBUS line, to the ADC of the STM32?

Thanks in advance.

BR Jonas
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Simple current detection
« Reply #1 on: February 04, 2021, 04:15:12 pm »
Use a current monitor amp and connect its output to your ADC input. You can tie the ADC ref in as well.... FAB
eg https://www.onsemi.com/products/amplifiers-comparators/current-sense-amplifiers/ncs199a3rsqt2g
Cheaper than an Aussie Dollar. Happy days!
 

Offline mvs

  • Frequent Contributor
  • **
  • Posts: 370
  • Country: de
Re: Simple current detection
« Reply #2 on: February 04, 2021, 04:27:18 pm »
How would you do this with as few external components as possible?
current shunt + integrated high side CSA.
If you are space constrained, there is quite small CSA in sot23-3 package with current output - ZXCT1009.
https://www.diodes.com/assets/Datasheets/ZXCT1009.pdf

Quote
A sense resistor and a voltage divider on the VBUS line, to the ADC of the STM32?
VBUS line is not exact 5V, so you would need to measure VBUS before and after current shunt and then substract values. shunt + 2 divider = 5 parts

If the rest of your circuit is also 3.3V, you may monitor current after LDO.   

« Last Edit: February 04, 2021, 04:39:37 pm by mvs »
 

Offline JJallingTopic starter

  • Supporter
  • ****
  • Posts: 246
  • Country: dk
Re: Simple current detection
« Reply #3 on: February 04, 2021, 05:10:06 pm »
Thank you, both of you.

I'll use a CSA, but I have one question; won't I have problems, since my circuit is 3.3v and I want to measure on the 5V circuit?
Or should I just supply the CSA from the 3.3v line, and use the voltage reference in the STM32 to supply the CSA reference?

If the rest of your circuit is also 3.3V, you may monitor current after LDO.   
It's not the 3.3v circuit I want to measure, but whatever is connected to the VBUS, but thanks.

BR Jonas
 

Offline JJallingTopic starter

  • Supporter
  • ****
  • Posts: 246
  • Country: dk
Re: Simple current detection
« Reply #4 on: February 04, 2021, 05:24:46 pm »
Thank you, both of you.

I'll use a CSA, but I have one question; won't I have problems, since my circuit is 3.3v and I want to measure on the 5V circuit?
Or should I just supply the CSA from the 3.3v line, and use the voltage reference in the STM32 to supply the CSA reference?

If the rest of your circuit is also 3.3V, you may monitor current after LDO.   
It's not the 3.3v circuit I want to measure, but whatever is connected to the VBUS, but thanks.

BR Jonas

Well, reading the datasheet answers my question :palm:

BR Jonas
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Simple current detection
« Reply #5 on: February 05, 2021, 09:36:15 am »
isn't that part discontinued?
 

Offline JJallingTopic starter

  • Supporter
  • ****
  • Posts: 246
  • Country: dk
Re: Simple current detection
« Reply #6 on: February 05, 2021, 09:39:03 am »
Hello Terry,

I have picked INA180 - it does what I need :)

Thanks again,

BR Jonas
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf