Skip to content

Adding Watts to RMS example #6

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

Closed
ncohen17 opened this issue May 17, 2022 · 7 comments · Fixed by #7
Closed

Adding Watts to RMS example #6

ncohen17 opened this issue May 17, 2022 · 7 comments · Fixed by #7
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ncohen17
Copy link

Hi,

I wanted to know if it would be possible for you to add the Watts (Power) readings to the recently added Example 4 RMS voltage and current. so that it would be possible to read RMS values of voltage, current and power like in Example 1.

Best Regards
Netanel

@PaulZC
Copy link
Collaborator

PaulZC commented May 17, 2022

Hi @ncohen17 ,

It will take us some time to do this. I will need to set up my ACS37800 test bed with AC source and load. And I do not have time to do that right now.

If you want to have a go at this yourself, you will need to replicate readRMS and adapt it so it reads ACS37800_REGISTER_VOLATILE_21 into a ACS37800_REGISTER_21_t struct and then extracts pactive and pimag. There is also papparent in ACS37800_REGISTER_VOLATILE_22.

If you get it working, please send us a Pull Request.

Best wishes,
Paul

@PaulZC PaulZC added enhancement New feature or request help wanted Extra attention is needed labels May 17, 2022
@ncohen17
Copy link
Author

Hi @PaulZC

Thanks for your reply.

I don't know nor have the experience to do it.

I would prefer to wait for you when you find the time.

When do you think you could have time to check it out and implement that feautre ?

Looking forward to hearing from you

Best Regards
Netanel

@ncohen17
Copy link
Author

Hi @PaulZC ,

would it work if I make a simple equation in the existing example 4 code.

watts = volts x amps

Let me know your thoughts about this.

Looking forward to hearing from you

Best Regards
Netanel

@PaulZC
Copy link
Collaborator

PaulZC commented May 18, 2022

Hi Netanel,

Calculating the V.A will give a good indication of the power drawn by the load, but it does not provide the full picture.

AC loads can be 'reactive' (inductive usually) and the current is out of phase with the voltage. To get the full picture, you need to know the Real, Reactive and Apparent Power:

https://en.wikipedia.org/wiki/Power_factor

The ACS37800 uses the terms Active, Imaginary and Apparent.

I am working on a lot of other projects at the moment. I will try and add this feature for you, but it will not be soon. Why not try and improve your coding skills and have a go yourself? ;-)

Best wishes,
Paul

@PaulZC PaulZC linked a pull request May 25, 2022 that will close this issue
@PaulZC
Copy link
Collaborator

PaulZC commented May 25, 2022

Hi Netanel (@ncohen17 ),

I have added this in v1.0.5. Please update your library and give the new Example5 a try.

Best wishes,
Paul

@PaulZC PaulZC closed this as completed in #7 May 25, 2022
@ncohen17
Copy link
Author

ncohen17 commented Feb 19, 2025

Hi @PaulZC ,

I wanted to know if there is a way to read overall energy load consumption in kWh directly from the ACS37800 or would that need to be done using a separate calculation ?

Looking forward to hearing from you

Best Regards
Netanel

@PaulZC
Copy link
Collaborator

PaulZC commented Feb 19, 2025

Hi Netanel (@ncohen17 ),

The ACS37800 has no built-in timing / clock / AC-cycle-counting functionality. It cannot measure energy use over time...

You could configure one of the DIO pins as "zero-crossing detection", connect it to an interrupt pin on your microcontroller, and use that to measure time (based on the AC frequency). But most microcontrollers have some form of built-in RTC which would be much easier to use.

Best wishes,
Paul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants