I want to sense the current through a solenoid when it is ON. Ideally I would want this for testing purposes and overcurrent protection. As I have a free ADC pin in my microcontroller, I came up with the approach below. I don't expect a current greater than 500 mA, and the coil will be given a single pulse, no PWM. Is this a good idea? I'm looking for a simple solution, i.e., not extra ICs or amplifiers.
What you draw is right, you are almost there. Here is what you have to consider: what voltage drop do you expect on R16?
V = IR, right? So if V is relatively high, for example 2V, the VGS of the gate pulse will be affected. Not to mention the power on the resistor, which you also have to consider.
So what people usually do is selecting a low resistance for current sense resistor. Maybe 0.1R or 0.01R, depending on your current. And then you need to amplify the IR before putting it into your ADC.
Dont panic because of the additional OPAMP. A simple one would cost 10-20 cents, and a few resistors around.
If the current is high, another good idea would be to use a differential amplifier, as the GND point near the resistor might not be at exact same potential as the amplifier's GND, due to imperfections of the circuit (non-zero resistance).
not really, voltage drop over R16 would be kinda low for ADC sense, it would be on edges of noise. Personally I would go with an additional transistor , it will open by Vdrop on R16, and give you a logical signal '0' if curr over. '1' - if OK; so npn, B-> R16,Q1 ; E-> ground, C- resistor and Vsuppl, another resistor as divider in parallel C and E of transistor, to make logical "1" Voltage. When transistor "ON" it shorted that resistor making logical "0"