Author Topic: Possible to build a switching circuit based on amperage instead of voltage?  (Read 484 times)

0 Members and 1 Guest are viewing this topic.

Offline MarmottaTopic starter

  • Contributor
  • Posts: 37
  • Country: gb
So, hopefully I can explain what I'm attempting to do without a schematic; if not I'll knock something up. I have a portable device that charges 5V via a USB-C port, but otherwise runs off a 3.7V battery. I have a sub-board installed in the device that runs on 5V that I want to power via the same USB-C port and from which diagnostic information can be sent to a PC. However, I only want this sub-board to be powered on when the portable device is connected to a PC, as its only purpose is to gather diagnostic information; I don't want it powered on when the device is charging from a 5V USB phone charger or similar.

The only thing that I thought might distinguish a PC USB port from a wall charger is the USB port might have limited amperage of say 0.5-0.9 amps compared to a wall charger's 2A or so? Or would this be dependent on whatever amperage the device needs to charge regardless? I don't know the default charge rate, so it might just charge at 5V 0.5A with whatever charger. Is there such a thing as a MOSFET switch or something that would work on amperage rather than voltage or is it the sort of metric that would fluctuate too much for a reliable switch?

Thanks for any answers. This was just a possibility that came to mind, so no idea how feasible it might be. And if anyone has any other suggestions other then installing a physical switch, I'd be more than happy to hear them.
« Last Edit: April 17, 2023, 08:59:14 pm by Marmotta »
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1354
  • Country: us
There is no way to determine how much current a power source is capable of unless you try to pull a current from it until the voltage drops. It's not something you want to do and some power source can be damaged by drawing too much current from it.
 

Offline Algoma

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: ca
Your sub board has a micro controller?  Most can have an ultra low power sleep state you can set, unless its woken up by an data interrupt from the USB port's data pins. (Your PC software). Most 5V chargers tend to be pretty passive on their USB data pins, and the sub board simply impliments a timeout deep sleep state without any active communications.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5135
  • Country: ro
  • .
Standalone chargers will usually mess with the data pins in the usb connector, D- and D+ ... they're either connected together, or there's some resistors between the pins and ground or pin and voltage, or there's an IC inside the charger which messes around with the data pins to support multiple charging standards (usb pd, samsung, iphone, etc etc)

So I suppose you could try to see if there's some kind of "handshake" with the PC, some query to identify or something, and that would tell you it's an actual computer and not a charger.

You could have a resistor (for example 0.01 ohm resistor) in series with the voltage input and measure the voltage drop across the resistor, and you can figure out the current this way.

There are also some chips which have multiple inputs and one output and automatically switch between inputs according to some rules or according to input priority
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2504
  • Country: gb
  • Recovering Electrical Engineer
Amperage Alaska?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf