How to Use an Allegro ACS758 Current Sensor with Arduino for 50A to 200A

How to Use an Allegro ACS758 Current Sensor with Arduino for 50A to 200A


Current measurement in high-capacity applications can be challenging, but the Allegro ACS758 current sensor simplifies this task. This sensor can handle current levels from 50A to 200A, providing a reliable solution for various projects. In this tutorial, we will explore how to connect the ACS758 to an Arduino and read current values accurately.
The outcome of this project is the ability to measure current flowing through a load, displaying the results on the serial monitor. The ACS758 uses Hall effect sensing technology to convert current into a proportional voltage that can be read by the Arduino, allowing for easy monitoring of current levels. Be sure to check the video for additional insights (in video at 01:15).

Hardware Explained

The main component in this project is the Allegro ACS758 current sensor. This sensor operates on the principle of the Hall effect, which allows it to measure the magnetic field generated by the current flowing through a conductor. It produces an output voltage proportional to the current, enabling the Arduino to read and interpret these values. The ACS758 has several variants, with the "100B" indicating that it can measure up to 100A. It features bi-directional current measurement, allowing for accurate readings regardless of the current direction. The sensor requires a power supply of 3.3V or 5V, which powers its internal circuitry, including an operational amplifier that processes the Hall effect signal.

Datasheet Details

ManufacturerAllegro Microsystems
Part numberACS758LCB-100B
Logic/IO voltage3.3 V / 5 V
Supply voltage4.5 V - 5.5 V
Output current (per channel)100 A
Peak current (per channel)200 A
PWM frequency guidanceN/A
Input logic thresholdsTTL compatible
Voltage drop / RDS(on) / saturation0.1 V @ 100 A
Thermal limitsOperating temperature: -40 °C to 125 °C
Package5-pin package
Notes / variantsAvailable in different current ratings (50A, 100A, 150A, 200A)

  • Ensure proper wiring to avoid voltage drop due to resistance.
  • Use appropriate gauge wire for high current applications to prevent overheating.
  • Keep the sensor within specified temperature limits for accurate readings.
  • Calibrate the sensor output based on the specific model used.
  • Consider using filtering capacitors to stabilize readings if necessary.

Wiring Instructions

Arduino-wiring-for-ACS758-Current-sensor
To wire the ACS758 current sensor to your Arduino, begin by connecting the sensor's VCC pin to the 5V output of the Arduino. Next, connect the GND pin of the sensor to the Arduino's ground. The output of the sensor, which provides the voltage proportional to the measured current, can be connected to the analog input pin on the Arduino, typically labeled as A0. Ensure that the load you wish to measure is connected in series with the sensor. The current path should flow through the sensor so that it can accurately measure the current passing through it. The sensor has two current input pins; connect your load's positive wire to one of these pins and the other pin to your power supply's positive terminal. The negative side of the power supply should connect to the load's negative terminal. This setup allows the sensor to measure the current flowing to the load.

Code Examples & Walkthrough

The Arduino code for reading values from the ACS758 sensor is straightforward. Below is an excerpt from the advanced code that initializes the sensor and reads the voltage:

#define VIN A0 // define the Arduino pin A0 as voltage input (V in)
const float VCC = 5.0; // supply voltage
const float FACTOR = 20.0 / 1000; // sensitivity for the ACS758-100B
This code defines the analog input pin and sets the supply voltage. It also calculates the sensitivity factor based on the model used, which is essential for accurate current readings. Another important section of the code is the loop function, which continuously reads the voltage from the sensor:

void loop() {
  float voltage_raw = (5.0 / 1023.0) * analogRead(VIN); // Read the voltage from sensor
  float current = (voltage_raw - (VCC * 0.5)) / FACTOR; // Calculate current
  Serial.print("Current: ");
  Serial.println(current, 2); // Print current value
}
In this part, the code reads the voltage from the sensor, adjusts it based on the quiescent output voltage, and calculates the current using the defined sensitivity factor. The current value is then printed to the serial monitor. For a complete understanding of the code structure and functionality, please refer to the full code loaded below the article.

Demonstration / What to Expect

Once everything is wired correctly and the code is uploaded, you should see current values displayed on the serial monitor. The readings will update every half second as defined in the code. If the current is below the cutoff limit set in the code, you will see a "No Current" message displayed. This cutoff helps filter out noise and small variations in current readings. Be cautious of reversed polarity connections, as this can damage the sensor. Always ensure that the sensor is correctly wired in series with the load, and monitor the output to confirm accurate readings. The video provides additional context and demonstrations (in video at 12:30).

画像

Allegro ACS758 current sensor with Arduino
Allegro ACS758 Current Sensor with Arduino
Arduino-wiring-for-ACS758-Current-sensor
Arduino-wiring-for-ACS758-Current-sensor
ACS758-sensor-0
ACS758-sensor-0
ACS758-sensor-1
ACS758-sensor-1
ACS758-sensor-3
ACS758-sensor-3
ACS758-sensor-4
ACS758-sensor-4
ACS758-sensor-5-schematic
ACS758-sensor-5-schematic
100-Advanced Arduino code for the Allegro ACS758 current sensor
言語: C++
101-Arduino code for Allegro ACS758 current sensor (basic)
言語: C++
102-Advanced Arduino code for four Allegro ACS758 current sensors
言語: C++
コピーしました!

必要かもしれないもの

リソースと参考文献

まだリソースはありません。

ファイル📁

他のファイル