Possible to build a switching circuit based on amperage instead of voltage? - Page 1
Forum section: electronics / beginners

author: Marmotta
author_rank: Contributor
timestamp: April 17, 2023, 08:50:24 pm
content: 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.

author: BeBuLamar
author_rank: Super Contributor
timestamp: April 17, 2023, 08:56:09 pm
content: 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.

author: Algoma
author_rank: Frequent Contributor
timestamp: April 17, 2023, 09:07:40 pm
content: 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.

author: mariush
author_rank: Super Contributor
timestamp: April 17, 2023, 09:15:28 pm
content: 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

author: Terry Bites
author_rank: Super Contributor
timestamp: April 19, 2023, 04:03:32 pm
content: Amperage Alaska?