Sei sulla pagina 1di 3

1x LT1495

1x 470kOhm resistors for RB


2x 10kOhm resistors for RA
1x 2N3904 transistors
1x 22nf capacitor for C

Current measurment

The current is measured by measuring the voltage drop across a low resistance. This
voltage is amplified by the LT1495 op amp and the 2N3904 transistor. The amplified
output voltage is connected to an Arduino analog input.

The range of current that can be measured by the circuit is defined by Rsens, RA,
RB and the Arduino analog reference voltage.

The Voltage out from the current sensing circuit is given by:

Note: I will add a worked example here soon.


Software
The Arduino Sketch

The Arduino along with the Arduino sketch reads in the ADC value that corresponds
to the voltage at the analog input pin. It then converts the ADC value to a current
value. The current sensor DC library is intended to make all this a little more
straightforward. The main commands to get the sensor running are:

Include the library:

#include "CurrentSensorDC.h"

Create a DC sensor: nameOfSensor(analog input pin, calibration value m, calibration


value c):

CurrentSensorDC sensorA( 0 , 1.0 , 0.0 );

Returns the current value as a floating point number:

sensorA.getCurrent();

Download the CurrentSensorDC library here: CurrentSensorDC.tar.gz

Download the Arduino Sketch here: CurrentSensorDCExample.tar.gz

Copy the library to your Arduino/Libraries folder then compile and upload the
Sketch to the Arduino.

If you now go to the Arduino Serial monitor you should see a stream of floating
point values.

At this point, the program is not calibrated, the output corresponds to the ADC
value. Tto see current values, the next step is:
Calibration
2 point calibration procedure.

1) Take a reading from the Arduino monitor and reference meter (digital multimeter
dmm) at 0 current.

For example: Emon: 1.70 dmm: 0.00A

2) Take a reading from Arduino monitor and reference meter (dmm) at a current value
close to the maximum current you intend to measure.

For example: Emon: 182.5 dmm: 8.08A

3) Use the equation of a straight line (y=mx + c) to find the calibration.

y1 = dmm 0 current. y2 = dmm max current.

x1 = emon value at 0 current x2 = emon value at max current

y1 = mx1 + c : y2 = mx2 + c

Rearranging to find m and c:

m = (y2 � y1) / (x2 � x1) and c = y1 � mx1

With the example values from set one and two the calibration values are:

m = 0.044690265 : c = -0.075973451

4) Insert the calibration values into the Arduino sketch at the following lines:

CurrentSensorDC sensorA(0, m , c );

If all is well, you should now read current!


Accuracy

I obtained the following accuracy below with circuit configured for 0 to 46Amps,
but test range 0 - 10A due to max 10A range of DMM.

I tested 8 points along the 0 to 10A range, by no means a comprehensive test, but a
useful indication of accuracy nonetheless.

Standard deviation of the error: 0.01A

Maximum error: 0.02A

Further Development

It would be good to explore use of the cheaper shunts linked above.


Further Reading

The LT1495 circuit above is adapted from the linear technologies application notes
on DC current sensing that can be found here (There's also a lot of other
interesting info there too):
http://www.linear.com/ad/current_sense

Article on high versus low side current sensing:

Low-side vs. high-side current sensing by Arpit Mehta

Potrebbero piacerti anche