-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emonlib+Esp32+ADS1115 outputting inconsistant data #61
Comments
i hope this proble get solved |
Finally i got it to work, thanks to all contributes here and on other forums. For who is interesting hereby my code: // In this example we will use an ADS1115 breakout board instead of the Arduino's local analog inputs #include "EmonLib.h" // Include Emon Library //Adafruit_ADS1115 ads; // Create an instance of the ADS1115 object ads.begin(); emon1.inputPinReader = ads1115PinReader; // Replace the default pin reader with the customized ads pin reader void loop() display.drawString(0, 15, "Ch2: "); display.drawString(0, 30, "Ch3: "); display.drawString(0, 45, "Ch4: "); |
thanks for sharing @persistive How did you connect the SCT013-15 CT to the ADS1015? Any other components needed? Any chance you have a fritzing sketch? Looks like the SCT-013 has a mini jack plug, I guess a breadboard stereo audio jack would do? |
thanks @persistive bytheway, it's worked! NodemCU with ADS1115, but strangely it worked when I used "Adafruit_ADS1015 ads;", i don't know why ... |
I use the ADS1015 because the ADCs on the ESP are not reliable. Not only are the ADCs not lineair, they also are quite sensitive for noise. Using the (cheap) ADS1015 will give a good lineair signal. Do not use the ADS1115, although the higher bandwith (16 bits) looks beter then the 12 bits of the ADC1015, the 1115 is very slow resulting in slow updates of your readings. Furthermore the 16 bits is really 15 bits because you use it in single ended mode. |
What arduino package do you use for reading the ADS? Could be the bottleneck as well? I have good results with https://github.com/wollewald/ADS1115_WE |
I use the Adafruit_ADS1X15-master library. Using the ADS1015 is much faster in my setup. According adafruit: These two boards are very similar, differing only in resolution and speed. The ADS1115 has higher resolution and the ADS1015 has a higher sample rate. |
Hello.. I'm trying to implement it, but I have an error.. 'class EnergyMonitor' has no member named 'inputPinReader' I'm not finding the problem. EnergyMonitor emon1; int ads1115PinReader(int _pin){ void setup(){ void loop(){ Serial.print("Current: "); |
I believe I have a problem with EmonLib.. now I used.. https://github.com/PaulWieland/EmonLib ...and I'm still having problems.. Can you share Adafruit and EmonLib library? |
I did get it to work, by rewriting the emonlib library, but it was crontoversly to say at least. But it works perfectly, it still is measuring the current.
The reason I used the ADS1115 was indeed the ESP. I used the Nodemcu board and could use the extra current sensors.
Originally posted by @SybrenV in #23 (comment)
How were you able to get it working properly??
I have the hardware implemented, and under standard testing (only using an ADS1115 based sketch) the values work fine. However, when using the Emonlib w/ ADS support that Paul provided, I get invalid data.
I have changed the files to EmonLib_I2C considering that's what it's for. This way I don't get conflicts with ArduinoIDE.
Unfortunately, this is the output I get:
It just slowly goes cycles down to "0" and then stays there. It doesn't matter if I have a current load or not.
And no, I don't have an external voltage reading of the mains line. It shouldn't matter for reading "current_only", correct? It would only be used during realpower calculations I would think.
But if I run the ADC only code, I get these values:
Code:
The text was updated successfully, but these errors were encountered: