
Allegro ACS758 Current Sensor with LCD and Overcurrent Protection for Arduino
This project demonstrates how to build an overcurrent protection system using an Allegro ACS758 current sensor, an LCD1602 display, and a relay. This system is invaluable for protecting sensitive electronics from damage due to excessive current draw. The ACS758 measures current, the LCD displays the current and system status, and the relay disconnects the load when the current exceeds a preset threshold.
This project is useful in a wide variety of applications, including:
- Protecting power supplies from overload
- Monitoring current draw in battery-powered devices
- Creating a safety mechanism for high-current loads
- Building a current-controlled switching system
Hardware/Components
To build this project, you will need the following components (in video at 00:10):
- Arduino Uno (or compatible)
- Allegro ACS758 Current Sensor (capable of measuring up to 200A)
- LCD 1602 with I2C module
- Relay (rated appropriately for the load)
- 1N4001 Diode (for relay protection)
- 2N3904 Transistor
- 1kΩ Resistor
- Jumper wires
- Breadboard (optional, but recommended)
- Power supply (for the load and the 12V relay)
Wiring Guide
The wiring is described in detail in the video (in video at 01:30). The connection of the LCD 1602 with the I2C module to the Arduino is also explained. The relay circuit is described in detail, including the use of a 1N4001 diode for protection (in video at 03:02). The relay is placed between the current sensor and the load (in video at 06:59). The current passes through the sensor and the relay, allowing precise current monitoring and protection.
%%WIRING%%
Code Explanation
The Arduino code is responsible for reading the current from the ACS758 sensor, displaying it on the LCD, and controlling the relay for overcurrent protection. The key configurable parameters in the code are:
const int relayPin = 2; // Relay control pin
const float maxCurrent = 15.00; // Maximum allowable current (in Amperes)
int maxCurrentWait = 6000; // Wait time (in milliseconds) after exceeding maxCurrent
float minCurrent = 1.00; // Minimum current to be considered (in Amperes)
const int model = 2; // ACS758 model selection (refer to code comments for model numbers)
The model
variable selects the specific ACS758 model used, affecting the sensitivity and quiescent voltage calculations. The maxCurrent
and minCurrent
variables define the thresholds for overcurrent protection and minimum current readings, respectively. maxCurrentWait
sets the delay before the relay re-engages after an overcurrent event. The relayPin
variable specifies the Arduino pin connected to the relay.
Live Project/Demonstration
The video (in video at 10:28) shows a live demonstration of the project. The demonstration clearly illustrates the functionality of the overcurrent protection system. The current is gradually increased until it reaches the set limit (15A in this case), at which point the relay disconnects the load. The video also demonstrates how the system handles different current levels and the accuracy of the current measurement (in video at 10:30).
Chapters
- [00:06] Introduction and Project Overview
- [00:38] Prior Knowledge and Resources
- [01:30] Wiring Explanation
- [02:56] Relay Circuit Schematic
- [07:07] Code Explanation and Configuration
- [10:28] Live Demonstration
- [12:28] Second Demonstration (Higher Current Limit)
- [13:26] Conclusion
Related Links
- Measuring 50A to 200A using Allegro ACS770 Current Sensor with Robojax Arduino Library
- Allegro ACS758 Current Sensor: Video and Code
- Download datasheet for Allegro ACS758 current sensor
- Purchase LCD1602 display from Amazon USA
- Purchase LCD1602 display from Amazon Canada
- Purchase LCD1602 display from Banggood
- Purchase LCD1602 display from Amazon Europe
- Purchase an LCD1602 from AliExpress
- Purchase 10pcs LCD1602-I2C from AliExpress
- ACS758 Current Sensor on Amazon USA
- ACS758 Current Sensor on Amazon Canada
Comments will be displayed here.