Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
community.blynk.cc
READING AC VOLTAGE…
Right now I have it configured, the red power light is on and it’s
“Out” is plugged into A0. Why am I getting Voltage Readings of
3530.27 and Amps of 15.61 with nothing running across the bus
terminals? If no AC line voltage is connected across the terminals
wouldn’t you expect to get something close to “0” ??
1 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
**#include <Blynk.h>**
**#include <ArduinoOTA.h>**
**#include <ESP8266WiFi.h>**
**#include <BlynkSimpleEsp8266.h>**
**#include <SimpleTimer.h>**
char auth[] =
"023a64434af9***********************";
const char* ssid = "********************";
const char* password = "*************";
2 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
SimpleTimer ACcheck;
void setup() {
#ifdef SERIAL_EN
Serial.begin(SERIAL_BAUD);
#endif
Serial.println();
Serial.println("Serial Comm's Started");
WiFi.mode(WIFI_STA);
Blynk.begin(auth, ssid, password);
while (Blynk.connect() == false) {}
ArduinoOTA.setHostname("AC_Voltage");
Serial.println("");
Serial.println("");
delay(10);
Serial.println(WiFi.status());
Serial.println("");
Serial.println("");
Serial.print("\tAssigned Local IP:\t\t");
Serial.println(WiFi.localIP());
if (WiFi.status() == WL_CONNECTED) {
Serial.println("\tWiFi C O N N E C T E D
!!!.");
Serial.println("");
3 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
Serial.println("");
Serial.println("\tWifi Started");
}
else {
Serial.println("\tWiFi P R O B L E M" );
}
Serial.println("");
Serial.println("\tOTA Starting");
ArduinoOTA.begin();
Serial.println("");
Serial.println("\tACcheck Starting");
Serial.println("");
Serial.println("\tComm's Complete");
Serial.println("");
Serial.println("");
readACS712();
Serial.print("\tVoltage ");
Serial.println(Voltage);
Serial.print("\tAmps ");
Serial.println(Amps);
void loop() {
ArduinoOTA.handle();
4 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
ACcheck.run();
Blynk.run();
void readACS712() {
Voltage = (analogRead(A0) / 1024.0) * 5000;
if (Voltage <= 2500) {
Blynk.virtualWrite(V1, 0);
Voltage = 2500;
Amps = 0;
} else {
Blynk.virtualWrite(V1, 255);
Amps = ((Voltage - ACSoffset) / mVperAmp);
Blynk.virtualWrite(V2, Amps);
}
}
created
Mar '17
last reply
Jul 6
69
replies
5 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
9.9k
views
users
likes
10
links
Frequent Posters
Popular Links
6 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
@Lane0138, you didn't specified what proto board are you using,
but what you should consider, that acs712 sensors are 5v
devices, but esp is 3.3v
so, this can be the first problem. the second, that acs712 can
measure current in both direction, and the output range is 0-5v.
so, when no current flowing, it should be around 2.5v (0-2.5v is
one direction, 2.5-5v is other direction)
maybe you should post a photo or link with your acs module, but
i'm pretty sure you are trying to use a 5v version with 3.3v mcu...
That's funny... that was one of the videos I re-watched when I saw
this post. Julian Ilett is one of my favorite subscribed channels... I
particularly like his "Postbag!!" videos... he buys all the cheap
China toys I can't
7 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
i also watch some of his videos. this one is really useful regarding
the presentation of the acs712 module and working principle,
however the code seems a bit over complicated to me...
i use this:
#define ACS A0
#define SENSITIVITY 66
#define SAMPLING 100.0
void setup() {
Serial.begin(115200);
pinMode(ACS, INPUT);
}
void loop() {
float avgAmps;
8 of 9 02/11/2018 11:38
[SOLVED] ACS712 Voltage & Amps -- Ghost Readings! - Solved about:reader?url=https://community.blynk.cc/t/solved-acs712-voltage...
Serial.println(Amps);
delay(1);
}
9 of 9 02/11/2018 11:38