-->
Page 4 of 6

Re: Integrate EmonLib (energy monitor) library to ESP

PostPosted: Fri May 29, 2015 11:16 am
by juanpintom
I finally decided to acomplish this with an ATTINY85, maybe it's simple to do on ESP directly but the 0-1v Range on ADC limits the accuracy of readings, here you have a simple example and guide to connect and get this working with an Attiny85 connected to ESP12:

https://github.com/juanpintom/Souliss_ESP_Examples/wiki

If anyone wants to integrate emolib directly on the ESP is really welcome! :P

Regards

Re: Integrate EmonLib (energy monitor) library to ESP

PostPosted: Sat Jul 04, 2015 4:42 am
by TylerDurden
I don't see how the Attiny should be more accurate, just because it uses 0-3,3V as measurement range.
As long as the current transformer and the burden resistor produce a 0-1V output over the measurement range the resolution should be the same.

Re: Integrate EmonLib (energy monitor) library to ESP

PostPosted: Sat Jul 04, 2015 10:05 am
by juanpintom
Yes, probably you're right, but for now am working with the Attiny why the code of Emonlib must be modified too and I've no time, but is planned :) If you get it emolib working on ESP and ADC PIN please share your results :)

Regards!

Re: Integrate EmonLib (energy monitor) library to ESP

PostPosted: Wed Jul 15, 2015 10:17 am
by gi0nzi
Hi,
I had work on it and at first I was stuck in the calcIrms function due to the SQRT function tlead ESP to crash and reboot, because of some problem in its math library when you program via the ArduinoIDE.
to overcame the issue, I implemented an approximated method to calculate the squareroot and it works fine.
that's the link where i took the algotithm:
http://www.codeproject.com/Articles/699 ... on-Precisi

hoping can be usefull