capella-ben / emon_esp32

Implementaion of emonlib for esp32
GNU General Public License v3.0
8 stars 1 forks source link

In software Low Pass Filter #3

Open MrMaximo opened 4 years ago

MrMaximo commented 4 years ago

At line 75, there is a digital LP filter that was copied from the original library. offsetI = (offsetI + (sample-offsetI)/1024); However, the original microcontroler is a atmgea328p with a 10-bit resolution ADC, and this is the reason of a 1024 in the function, but i'm not sure. Using ESP32, shouldn't that be 4096?

amin1985 commented 4 years ago

for me the current value was so wrong. even when there is no current , it shows 2 amp(so there is an issue with offset filter) .esp32 adc is 12 bits. so 4096 is the currect value. then i replaced the ICAL from 90.9 to 1 and now every thing is fine for me(sensor:SCT013-100)