Current Sensor

17
Introduction This project attempts to provide a brief review of the current sensing techniques underlying 2 common types of current sensors: the conventional DC current sensor and the hall- effect sensor. The DC current sensor used in this project is an INA219 High Side DC Current Sensor Breakout and the Hall Effect sensor used is an ACS712 Low Current Sensor Board. Step 1: Hardware List Arduino Uno 1 -- To process the signals from the sensors ACS 712 Hall Effect Current sensor 1 -- To measure the current INA219 High Side DC Current Sensor 1 -- To measure the current Arduino Motor Shield Rev3 1 -- To manipulate Motors Breadboard 1 To provide a convenient workspace for the circuit DC Motor 1 -- Acts as a load in the tested circuit Batteries 4 -- To provide voltage in the circuit that is being tested Battery case 1 -- To hold the Batteries Computer 1 -- To view the data

Transcript of Current Sensor

Introduction

This project attempts to provide a brief review of the currentsensing techniques underlying 2 common types of currentsensors: the conventional DC current sensor and the hall-effect sensor. The DC current sensor used in this project isan INA219 High Side DC Current Sensor Breakout and the HallEffect sensor used is an ACS712 Low Current Sensor Board.

Step 1: Hardware List

Arduino Uno 1 -- To process the signals from the sensors ACS 712 Hall Effect Current sensor 1 -- To measure the

current INA219 High Side DC Current Sensor 1 -- To measure the

current Arduino Motor Shield Rev3 1 -- To manipulate Motors Breadboard 1 To provide a convenient workspace for the

circuit DC Motor 1 -- Acts as a load in the tested circuit Batteries 4 -- To provide voltage in the circuit that is

being tested Battery case 1 -- To hold the Batteries Computer 1 -- To view the data

Capacitor (probably) 1 -- To moderate the current spikescaused by the motor

Wires 12+ -- To connect parts

Step 2: How the Breadboard works

When the breadboard is held vertically as shown in the figureabove, the positive and the negative lines run vertically onthe sides, not connecting to anything else but the ports onthe lines themselves. The middle part of the breadboard ishorizontally connected (a-b-c-d-e and f-g-h-i-j). However, thevalley running through the center of the board divides thehorizontal lines into two sections. There are no verticallinks in the middle.

Step 3: Procedure

1. Gather the breadboard, Arduino Uno, and the Arduino MotorShield.

2. Fit the Arduino Motor Shield on top of the Arduino Unomicro-controller appropriately.

Step 4: High Side DC Current Sensor INA_219

1. Connect the 5 volt pin of the Motor Shield to row A,column 1, notated as (A, 1), of the breadboard.

2. Connect the ground pin to the breadboard’sground/negative line.

3. Connect the SCL (Clock Line) pin of the Arduino to (A, 3)4. Connect the SDA (Data Line) pin of the Arduino to (A, 4)5. Lastly, connect a wire from the ground line of the board

to (A, 2). This will complete the circuit to providepower supply to the sensor

Step 5:

1. Place the sensor in the breadboard to link the first fourterminals of the sensor to the connections made before.

2. Connect V+ to the positive terminal of the power supply(batteries) for the circuit under test.

3. Connect V- to the positive terminal of the load (however,motors can operate in both the directions of thecurrent). This puts the sense resistor in-line with thecircuit.

4. Finally, connect a wire from the negative terminal of thepower supply to GND. This allows the sensor to measurethe load voltage as well as the load current.

Step 6:

Ultimately place the motor to complete the test circuit. Theterminals can attached in any direction as it will only changewhether the motor spins clockwise or counter clockwise.

NOTE: Noisy loads such as DC motors can cause sharpcurrent draw and cause the sensor to reset. To avoid this,include a bidirectional capacitor parallel to the load todecouple it from the power supply.

Step 7: Hall-Effect Sensor ACS_712

1. Connect 2 breadboards together side to side with eachother.

2. Then connect the hall-effect sensor vertically acrosseach power line of the breadboard as shown in the figureabove.

Step 8:

1. Connect the 5v pin of the hall-effect sensor directly tothe 5v pin of the Arduino.

2. Connect the GND pin of the sensor directly to thecorresponding pin of the Arduino.

Step 9:

1. Connect the IP+ pin of the sensor to the power line.2. Connect the IP- pin to either terminal of the DC motor.3. Connect the other terminal of the motor to the power

supply.

Step 10:

Connect the batteries to their appropriate place in the powersupply line.

Step 11: Software: Adafruit_INA219

To store the serial output as processable data we needdownload CoolTerm. To download the software, goto http://freeware.the-meiers.org/. Then, extract the CoolTermfolder to the desired location.

Step 12: Libraries

To utilize the the current sensor using the Arduino, downloadthe INA219 librariesfrom https://github.com/adafruit/Adafruit_INA219.

Step 13:

Then extract the folder inside the zip file into the librariesfolder of Arduino.

Step 14: Code: GetCurrent

Use GetCurrent.ino to operate the Arduino and to receive thesignals generated by the micro-controller.

Remember to change the interval (milliseconds) to change thefrequency of measurements.

GetCurrent.ino1 KB

Step 15:

Click ‘Upload’ ( → ) on the top left corner of the window toinitiate the program on the micro-controller.

Step 16: CoolTerm

Open CoolTerm in order to obtain the data from the Serialport. Then click ‘Connect’ to link the software to the ArduinoUno micro-controller.

Step 17:

Then go to Connection > Capture to Textfile > Start OR PressCtrl + R to start recording the data

Step 18:

Save the resulting textfile to any convenient destination.

Step 19:

Then go to Connection > Capture to Textfile > Start OR PressCtrl + Shift + R to Stop recording data.

Step 20:

Then click on Disconnect to safely disengage the micro-controller from the PC.

Step 21: Excel

1. Open a new Excel file to save the data in an operationalformat.

2. Then go to Data > From Text to transfer data from thetext file into Excel

3.

Step 22:

Import the file that was saved before and then Click ‘Import’.

Step 23:

Click Finish in the dialogue box that appears.

Step 24:

Click whichever cell you want the table’s top-left corner tobe on and then click ‘OK’.

Step 25:

Add labels on the top of each column.

Step 26: The End.

Use the table as you want to!