current sensing auto switch shunt resistor - Page 1
Forum section: electronics / projects

author: shaling
author_rank: Contributor
timestamp: January 18, 2021, 09:55:31 pm
content: Hi,I have arduinos with RFM69 modules. These sleep at ~2uA and when sending data, consume up to 250mA. I'm trying to make a current sense device to measure dynamically sleep currents down to uA, and that will either bypass the shunt or switch to another smaller shunt for larger currents automatically.A user on this forum previously suggested to use a MOSFET that can switch at a precise voltage, say 33mV if using a x100 current sense amplifier with 3.3V rail. I've designed this in, but don't know what will happen when uA shunt gets bypassed. Will the MOSFET now turn off, then shunt voltage builds up, then MOSFET on again etc.? Will it oscillate but still limit voltage drop to the desired 33mV? I've attached a schematic. I will read the voltage out via an ADC and arduino to display on OLED. Either battery powered or from isolated 5V supply. Any help much appreciated.Thanks, Shailen.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: January 18, 2021, 11:33:05 pm
content: Jumping Gnd, especially during transmission, is terrible. The shunt switching circuit will be fast enough, it is quite possible that it will repeat even the consumption of the carrier frequency of the transmitter.At a minimum, you need to make a temporary inertia to switch.But it is better to leave a permanent shunt and scale its voltage.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: January 18, 2021, 11:56:47 pm
content: Some ideas:You can put two shunt resistors in series, for example 1 Ohm and 1k Ohm, and then put a (skottky) diode over the 1k resistor. Then use the 1k resistor for low current measuremets, and the other resistor for higher currents.It's relatively easy to build a power supply that can deliver upto 5V 500mA, and you can integrate such shunt resistors in the power supply and compensate for the voltage drop over them.Or build a real coulomb counter. Charge a capacitor to a high voltage, put in a MOSfet in series to regulate it to a low voltage, and then monitor the voltage changes. This is especially useful to get accurate results over longer measurements.Throw in some microcontroller to make sense of the measurements and output them to some logging device (PC, EEprom, whatever)Could be quite a fun project to design and build. I sort of suspect projects like that already exist.

author: rtm
author_rank: Contributor
timestamp: January 19, 2021, 01:15:51 am
content: I think you have too big a range difference. Basically it is 10,000 to 1 (100 / 0.01). This means that at your transition voltage of about 30mV across the 100 ohm shunt, you will see a change to 0.003mV on the 0.01 Ohm shunt. In order for the circuit not to oscillate, it would need a hysteresis of at least almost 30 mV!! (almost your entire range).One idea would be maybe to use the output of the INA286 to drive your circuit that turns the FET on and off. When the output gets near the positive rail, turn ON the FET. When it gets near the negative rail, turn OFF the FET. Thus you would keep the output of the current sense circuit in range at all times.However, with this 10,000 to 1 range your low threshold would have to be below 0.3mV and your upper threshold above 3.0 volts. Possible, but not very practical.I suggest using at least 3 shunts, or reducing the overall current range you can measure.

author: shaling
author_rank: Contributor
timestamp: January 19, 2021, 10:50:24 pm
content: I've reworked this based an your comments.I now have two current sense amplifiers, one for each shunt, and use the output of the higher shunt amplifier to bypass the lower one.With different shunt resistors and amplifier gains, I think I can cover 1uA to 1A.Would this work?Thanks.

author: rtm
author_rank: Contributor
timestamp: January 19, 2021, 11:44:56 pm
content: Quote from: shaling on January 19, 2021, 10:50:24 pmThat looks like it should work to me. The only thing is to make sure you are aware you will not get the full 3.3V range at the output of the INA devices. From the data sheet you will loose a maximum of 0.4V at the high side and 0.04V at the low side. Thus the output of the INA device will only swing from 0.04V to 2.9V guaranteed from a 3.3V power supply rail. This will of course affect your overall measurement ranges.

author: ledtester
author_rank: Super Contributor
timestamp: January 20, 2021, 01:37:24 am
content: For measuring spiky kinds of current loads you might be interested in "BattLab-One" which Dave did an episode on:https://bluebird-labs.com/https://youtu.be/-nwCYfff6Hc

author: prasimix
author_rank: Unknown
timestamp: January 20, 2021, 06:53:27 am
content: Two open source project worth considering:https://github.com/yu3ma/mikroAmpMeterhttps://rocketlogger.ethz.ch/