| Electronics > Projects, Designs, and Technical Stuff |
| Current sensing |
| (1/2) > >> |
| GromBeestje:
I am trying to design an USB power outlet with current monitoring. See the attached schematic. I have places a current sense resistor on the low side, and a fuse on the high side. I am amplifying the voltage across the current sense resistors with an opamp. I intend the feed the output voltage of the opamp to an ADC of a microcontroller, and display the current on some display. But that's a part for later, for now, I am focussing on getting the current sensing part working. I am using a 1K5 in stead of a 10K for R7 and R8. I am using a TP2604 in stead of a LM358. I am running into an offset problem: Initial offsets ain't a problem, as I can compensate for that, but the problem is the right channel, where the output only starts changing after a certain current is flowing. Current (mA)Left port (mV)Right port (mV)013,773,82313,791,64513,7109,66630,0126,48746,7142,310762,9158,0 When first running into problems, I've tried to change the resistor values (my initial design has 900K for R5 and R6, thinking this was too high) Then I tried replacing the opamp. My LM358 was from eBay, so I replaced it to rule out it's a fake. Is there anything to look for to fix this problem. I'm thinking I possibly need a different type of opamp to operate so close to ground. I realise it only mentions real-to-real output, but doesn't say so about input. Might that be the source of this issue? If so, how to select a suitable opamp, what are the parameters to pay attention to? Edit: fix table formatting |
| OwO:
You probably want to sense the voltage across the CSR differentially because any currents flowing in the ground path between the opamp and the CSR will lead to errors. I would choose an op-amp with a lower offset voltage or a purpose built current sense amplifier like the INA199/TP199. If you really must use an op-amp you can bias the + input (while wiring it as a differential amplifier) to avoid saturation near 0V. GS8333 is a low cost option with rail-to-rail I/O and low input offset voltage. |
| GromBeestje:
The TP199 looks promising. I didn't look at the INA199 datasheet as TI's website is down for maintenance, but as the TP199 datasheet mentions its a drop-in replacement for INA199, they'll be similar. I'll design a new PCB and order some. However, I've still two opamp laying around that would fit the current design: TLC2272. This one mentions "Common-Mode Input Voltage Range Includes Negative Rail" and "Low Input Offset Voltage (950 µV)" GS8552: This one mentions "Rail-to-Rail Input / Output" and "Low Offset Voltage: 30µV" Is it worth trying one of these, or should I go on with the new layout straight away? I have attached the PCB layout. There is a ground plane on one side and a power plane on the other. Is this a potential source of error? |
| OwO:
Depends how low of a current you want to measure. Assuming 10mA, 10mA * 0.01ohm = 0.2mV. So you need an op-amp with input offset < 0.2mV to guarantee that 10mA will kick it out of saturation. Alternatively increase your sense resistance or bias the op-amp (requires 2 resistors, one series and one shunt to Vcc on the in+ pin). PCB layout isn't using kelvin connections to the CSR, but whether this is a problem or not is easy to check; simply check for "crosstalk" between the channels (see whether current on channel 1 affects channel 2). |
| fcb:
Depending on what you are trying to acheive budget wise, there are some quite tasty all-in-one IC's around. The TI INA220 is quite cheap and will do lowside/highside and monitor voltage as well (it also has built in ADC and some maths processing) and I2C (4 addresses). As others have said, you definatly want to use differential connections to your current sense resistor, you could correct the offset in firmware also. Don't go too low with your sense resistor else you'll end up needing alot of gain and that will compound the offset issue, and test at different temperatures - offsets on opamps can change radically over temperature. |
| Navigation |
| Message Index |
| Next page |