Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peff74/acs712_esp8266
ESP8266 arduino script for ACS712 to measure AC current
https://github.com/peff74/acs712_esp8266
ac acs712 arduino beginner-friendly current esp8266 sensor
Last synced: 4 days ago
JSON representation
ESP8266 arduino script for ACS712 to measure AC current
- Host: GitHub
- URL: https://github.com/peff74/acs712_esp8266
- Owner: peff74
- Created: 2024-05-31T10:01:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-11-06T23:12:07.000Z (10 days ago)
- Last Synced: 2024-11-07T00:26:39.386Z (10 days ago)
- Topics: ac, acs712, arduino, beginner-friendly, current, esp8266, sensor
- Language: C++
- Homepage:
- Size: 1.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AC Current with ACS712 and ESP8266 D1 mini!
There are a few pitfalls, but if you know them, it works well.
You have to adjust the voltage divider, pay attention to the read speed of the ACD and adjust the noise suppression.
![ACS712 logo](https://github.com/peff74/ACS712_ESP8266/blob/main/8266_ACS712.jpg)# Why ACS712
![ACS712 logo](https://github.com/peff74/ACS712_ESP8266/blob/main/ACS712-modul-5A-20A-30A.webp)
- cheap
- small
- available everywhere
- safe, due to galvanic separation## Using the AD converter of the ESP8266 for the ACs712
It's not difficult at all, especially if you use the WeMos D1 mini.
The D1 mini already has an integrated voltage divider.
So you are not limited to the 1.0V of the ESP8266 ADC.The voltage divider of the D1 mini is designed for **3.3V**.
Now we just have to extend it so that it works with the **5V** of the ACS712.
We do this by simply connecting a **180k resistor** in series with the A0 input## The WiFi pitfall
**Many measurements in a short time can lead to problems with the WiFi!!**Because:
The ADC is used on the 8266 by WiFi to test the signal level, too.
Hard use of analogRead(A0) influences the readings of the WiFi RD level.
This can be set with the "Delay_Time"
The value 2 works when WiFi is simply connected.
If you want to work with the WiFiEventHandler, e.g. to detect a disconnect, the value should better be 4,
because the WiFiEventHandler is no longer triggered incorrectly.
"do_measurements" should then be reduced to 25.
Of course, this reduces the accuracy#define Delay_Time 2
## Correct scaling value for the different models
ACS712 5A module --> scaling: 185 mV/AmpACS712 20A module --> scaling: 100 mV/Amp
ACS712 30A module --> scaling: 66 mV/Amp
#define Scaling 185.0
# filter out the noise
Because we record all the values around the measuring point
in every series of measurements
we can filter out the values that are most off the mark.Interference is mainly caused by current-carrying cables next to the line to A0.
However, bad power supply units can also play their part#define Noise_Filter 4
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fpeff74%2FACS712_ESP8266&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false)](https://hits.seeyoufarm.com)