The circuit
The goal
It's to measure the value of the current peak during a drive spin-up without expensive tools, like an oscilloscope for example. The budget is set at $15 max.
The circuit diagram
How it works
Important: the circuit needs to be isolated from everything else than the shunt resistor in the server, a plastic case is a good idea. Also, you can't power it from the server PSU, you need an isolated PSU, that's why we use 9 V batteries.
The 3.3 k resistor, diode, the 1 k and 510 Ohms resistors and the LED are here to create two virtual grounds, I'll explain why a little further down.
Rs is the shunt resistor used to measure the current. It's only 20 mOhms to avoid a too large voltage drop (because a drive will not be happy if the 12 V is only 10 V for example).
It is created by soldering a length of wire in series with the 12 V wire of a molex to SATA adapter (yep, you need to cut the yellow wire to solder your shunt, so don't use an adapter you care too much about :))
With 24 AWG wire L needs to be equal to 24.4 cm. With 22 AWG wire L needs to be equal to 38.8 cm. If you use another gauge then you can calculate the length L with
this calculator (put the wire diameter and adjust the length until your are very close to 20 mOhm).
I recommend to keep the connections between Rs and the circuit relatively short (let's say 20 cm max) and to use a twisted pair because the signal is very small so you want to limit the noise.
Then there's a low-pass filter formed by the 1 k resistor and the 100 nF capacitor to filter any high frequency noise.
After that there's the op-amp configured as a non-inverting amplifier with a gain of 50. Note that there's a 100 nF bypass capacitor who goes between the power pins of the op-amp which is not represented on the diagram. You can omit it but it's not recommended.
Finally there's a diode and a capacitor (it's called a peak detector) to memorize the peak value so you have the time to read it (and a crappy DMM has the time to settle).
The output is 1 V/A so for example if you read 2.61 V then you now it's equal to 2.61 A.
So now, why we need two virtual grounds? well, the diode used in the peak detector isn't perfect so it has a forward voltage. The second virtual ground is used to cancel this voltage.
Ok, but why we need a virtual ground in the first place? because the op-amp isn't perfect too and it can't work with its inputs near the rail voltages (that's why many circuits with op-amp use virtual grounds or split supplies).
The BOM
- 1x 510 Ohms resistor
- 4x 1 kOhms resistors
- 1x 3.3 kOhms resistor
- 1x 51 kOhms resistor
- 2x 100 nF film capacitors
- 1x 100 µF (16 V minimum) electrolytic capacitor
- 2x 1N4004 diodes
- 1x 5 mm LED blue or white
- 1x LM741
- 1 foot of 24 AWG (or 2 feet of 22 AWG) solid core wire (CAT5(e) cable is very good for this and you've probably already have some on a shelf)
- 1x molex to SATA adapter
- 2x 9 V batteries
- 1x DMM (even a crappy $5 one)
- Some way to assemble the thing (breadboard, stripeboard, homemade PCB, deadbug circuit, ...)
Miscellaneous
Important: the circuit needs to be isolated from everything else than the shunt resistor in the server, a plastic case is a good idea. Also, you can't power it from the server PSU, you need an isolated PSU, that's why we use 9 V batteries.
If you use 5 % resistors and you are careful in the making of the shunt resistor then the circuit precision will be (better than) 5 %.
Note that you can use two 1 kOhms resistors in parallel instead of the 510 Ohms resistor and three 1 kOhms resistors in series instead of the 3.3 kOhms resistor, that way you just need a batch of 1 kOhms resistors and one 51 kOhms resistor.
Of course you can add a shunt on the +5 V rail if you want to measure the current on this rail.