The ACS712 is a popular current sensor module that can be interfaced with an Arduino to measure current in a circuit. Here's a step-by-step guide on how to connect and interface the ACS712 with an Arduino:
ACS712 with Arduino in Proteus |
Materials Needed:
Arduino board (e.g., Arduino Uno)
ACS712 current sensor module (choose the appropriate model based on your current measurement requirements)
Jumper wires
Breadboard (optional)
ACS712 current sensor module (choose the appropriate model based on your current measurement requirements)
Jumper wires
Breadboard (optional)
Connection Steps:
Connect ACS712 to Arduino:
The ACS712 module typically has three pins: VCC, OUT, and GND.
Connect the VCC pin to the 5V output on the Arduino.
Connect the GND pin to the ground (GND) on the Arduino.
Connect the OUT pin to one of the analog input pins on the Arduino (e.g., A0).
Connect the VCC pin to the 5V output on the Arduino.
Connect the GND pin to the ground (GND) on the Arduino.
Connect the OUT pin to one of the analog input pins on the Arduino (e.g., A0).
Power Supply:
Connect the power supply of the circuit you want to measure to the ACS712
module. This is the circuit for which you want to measure the current.
Code:
Write a simple Arduino sketch to read the analog input from the ACS712 module and convert it to current values. Here's a basic example:
const int analogInPin = A0; // Analog input pinconst float sensitivity = 0.185; // Sensitivity factor for ACS712-05 (185 mV/A)
void setup() { Serial.begin(9600); // Initialize serial communication}
void loop() { int sensorValue = analogRead(analogInPin); float current = ((sensorValue - 512) * (5.0 / 1023.0)) / sensitivity;
Serial.print("Current (ACS712-05): "); Serial.print(current); Serial.println(" A");
delay(1000); // Delay for readability (adjust as needed)}
Upload the Code:
Connect your Arduino to your computer and upload the code using the Arduino IDE.Monitor the Output:
Open the Arduino Serial Monitor (Tools -> Serial Monitor) to view the current readings in milliamps.Notes:
The ACS712 current sensor modules come in different variants, and each
variant has its own sensitivity factor, which determines the relationship
between the output voltage and the input current. The sensitivity factor is
typically specified in millivolts per ampere (mV/A).
ACS712-05:
Sensitivity Factor: 185 mV/A
ACS712-20:
Sensitivity Factor: 100 mV/A
Sensitivity Factor: 100 mV/A
ACS712-30:
Sensitivity Factor: 66 mV/A
To find the sensitivity factor for your ACS712 module, locate and download the datasheet from the manufacturer's website.
Below, I'll provide an
example of the sensitivity factor model for the ACS712-05 variant:
ACS712-05 Sensitivity Factor Model:
Vout = Vcc/2 + Sensitivity x I
Where:- Vcc/2 is the mid-scale voltage, typically half of the supply voltage.
- Sensitivity is the sensitivity factor in mV/A (185 mV/A for ACS712-05).
- I is the current flowing through the sensor in amperes.
Let's say you have a current of 2 amperes flowing through the ACS712-05 sensor connected to a 5V supply voltage. Using the formula:
Vout = 5V/2 + (185 mV/A x 2 A)
Vout = 2.5V + 370 mV
Vout = 2.87V
In this example, the output voltage would be approximately 2.87 volts.
Take necessary precautions when working with high-current circuits to
avoid damage to the sensor or Arduino.
Proteus Simulation
Here's a step-by-step guide on how to simulate the ACS712 module in Proteus:
To make the ASC712 Current Sensor a seamless part of your Proteus simulations, follow these simple steps to download and install the corresponding library. You'll find the download link below for quick access. The integration process is user-friendly, requiring just a few clicks to incorporate the ASC712 Current Sensor into your circuit and observe how it interacts with other components during simulation.
Once you've opened the ASC712 Current Sensor Library .zip file, you'll come across two folders:
1. LIB
2. MODELS
Now, locate your Proteus library folder on your computer. Depending on your Proteus software version, the default location for the library folder may differ. In Proteus 8 Professional, it's commonly found at:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\LIBRARY
Inside the Proteus Library Folder, simply paste the files from the LIB Folder (these are the ones you extracted from the ASC712 Current Sensor Library Zip file).
Next, head to the Proteus Model folder, usually situated in the same place as the Library Folder:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\MODELS
To make the ASC712 Current Sensor a seamless part of your Proteus simulations, follow these simple steps to download and install the corresponding library. You'll find the download link below for quick access. The integration process is user-friendly, requiring just a few clicks to incorporate the ASC712 Current Sensor into your circuit and observe how it interacts with other components during simulation.
Once you've opened the ASC712 Current Sensor Library .zip file, you'll come across two folders:
1. LIB
2. MODELS
Now, locate your Proteus library folder on your computer. Depending on your Proteus software version, the default location for the library folder may differ. In Proteus 8 Professional, it's commonly found at:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\LIBRARY
Proteus Library Folder Location |
Inside the Proteus Library Folder, simply paste the files from the LIB Folder (these are the ones you extracted from the ASC712 Current Sensor Library Zip file).
Next, head to the Proteus Model folder, usually situated in the same place as the Library Folder:
C:\Program Files (x86)\Labcenter Electronics\Proteus 8 Professional\DATA\MODELS
Within the Proteus Model Folder, paste the files from the MODELS folder (these are also from the ASC712 Current Sensor Library Zip file).
NOTE....⚠⚠⚠
For certain versions of Proteus, you might locate the DATA folder here:C:\ProgramData\Labcenter Electronics\Proteus 8 Professional\DATA
Keep in mind that sometimes this folder (ProgramData) is hidden, so you may need to unhide it to access the specified location.
Proteus DATA Folder Location |
Once you've added these files, restart Proteus. You'll now find the ASC712 Current Sensor right there in the Pick Device Window. It's ready for easy selection and integration into your simulation projects.
Download the Library: The ACS712 Modules Library for Proteus is available for download here.
Proteus Library : ACS712 Current Sensor Module
ZIP Password : ArduinoMagix
ZIP Password : ArduinoMagix
How to install and use these Modules in Proteus: You can watch this video for a better understanding.