Skip to content
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

How to add attenuation? #4

Closed
kgalilio opened this issue Nov 12, 2023 · 1 comment
Closed

How to add attenuation? #4

kgalilio opened this issue Nov 12, 2023 · 1 comment

Comments

@kgalilio
Copy link

By default, the esp32 adc is capped at 1.1V. Trying to measure a higher value requires higher attenuation.
I know how to set the attenuation using adc platform in esphome, but how can I configure it in the custom component?

@marianomd
Copy link
Owner

You have to customize acs712_component.h.

Check this line:

 ACS712 *ACS = new ACS712(A0, 3.3, 1023, 66);

Change the pin if needed, as well as 3.3 to 1.1V.

You can also tune the mV per ampere of your setup (the value 66) and the max ADC value (1023).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants