Giter VIP home page Giter VIP logo

cs5490's People

Contributors

mauriziomalaspina avatar per1234 avatar tiagolobao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cs5490's Issues

Problem with Rogowski Coil and ESP32

Hello,
In one of my projects I need to use Rogowski Coil but I have trouble with it. In datasheet (https://statics.cirrus.com/pubs/proDatasheet/CS5490_F3.pdf) I’ve found information about use of this coil to get measurments of AC Current and voltage.
In this datasheet on Page 16 AD 4.7 I’ve found information about settings of coil. I use function: CS5490::write(Page, Address,Value) to write on Page 16, Address 0, value = BIN, 0001 0000 0000 0010 0001 1010, HEX:10 021A
I tested this code many times with both register write and without it but every time I get same response:

Vac RMS: 236.35 [V] @ 49.99 Hz
Iac RMS: 0.0258 [A]
PF: 0.4204
Active power: 2.5540 W
Reactive power: 3.1723 VAR
Apparent power: 6.0758 VA

RMS seems ok, HZ too. From IacRMS I’ve got a lot of trash in low current but in PF value when I connect somehing to outlet - value drops to 0.1 when it should indicate around 0.9 - ~1.0.
After this other value cant be good and it returns VAR/VAC with fake values.

I tested this with CS5490_AC_Current_Gain_tuning_demo, my code with short configuration and reading value in loop with 2 seconds delay in contConv and haltConv where basic parameter is:

#define R_SHUNT_OHM 0.000416 // <- from datasheet of PA3202NL Rogowski Coil (https://pl.mouser.com/datasheet/2/336/plei_s_a0003555710_1-2281160.pdf) because at 50 HZ this coil have drop of 416uV/a
#define V_ALFA (1000.0/1689000.0) // Resistor partition ratio on V input: on CDB5490U 4 * 422kOhm + 1kOhm
#define SYS_GAIN 1.25
#define V_FS 0.6
#define V_FS_RMS_V 0.17676 // 250mVpp
#define V_MAX_RMS (V_FS_RMS_V/V_ALFA)
#define I_FS 0.6
#define I_FS_RMS_V 0.17676 // 250mVpp with GAIN 10x, otherwise with GAIN 50x 50mVpp --> 0.3535 Vrms
#define I_MAX_RMS_A (I_FS_RMS_V/R_SHUNT_OHM)
#define P_FS 0.36
#define P_COEFF ((V_MAX_RMS I_MAX_RMS_A) / (P_FS SYS_GAIN * SYS_GAIN))
#define SAMPLE_COUNT_DEFAULT 4000 // Number of sample used to compute the output low rate computation (with quartz 4.096MHz --> 1 measure/s).

Im stuck at this moment, earlier I used a resistance measure of current ant that solution did work properly but now I need to use a Rogowski coil which causes described problem.
Have you got any idea what could be wrong with this and how to overcome the problem?

ESP32 support is too specific for boards

The conditional compile flags for ESP32 in the library are too specific for certain boards. This necessitates changing the library too much to work on a different boards. Ideally the library should take a Serial port instance instantiated by application code to work with the board under test, or at least use generic ESP32 conditional compile rather than board specific ones.

CS5490 arduino connection

Hello, firstly i want to thank you for doing such useful library. We are trying to connect cs5490 to arduino and measure voltage values. We connect them with the typical connection diagram (https://statics.cirrus.com/pubs/proDatasheet/CS5490_F3.pdf -> page 55) from datasheet of CS5490. Since we are just trying to measure DC voltage value we didn't connect IIN+, IIN-, DO and RESET. We uploaded to arduino your On_Chip_Calibration.ino file. However we just see 0 value. So we think that we were just communicating with your library actually and never start CS5490 to operate. How can we measure voltage and how can we know that we are communicating with CS5490 because we couldn't figure it out.

Thanks again
Have a good day

CS5490 Energy Meter Circuit Design Questions

Hello, firstly I would like to thank you for the library you created and post you shared on the energy meter you designed, you helped us a great deal with those. On to the topic, We are trying to create a smart plug much like yours and using cs5490 for the measurement part.
While trying to understand the board design you shared, I failed to understand a few points so I wanted to ask you about it,
image

1-Voltage pins seem to have both ends on ground (N and ground), shouldn't one of them be on line(L)?
2-The ground you placed between R4 shunt resistor and F1 20A fuse, was it to protect the board in case there is no load or does it have another function that I could not comprehend
3-When we measure voltage values we multiply it with a value based on the voltage divider. But for we do not know that how can we calculate the factor that is multiplied with current measurements. If we are using a 0.01-ohm shunt resistor, then how the calculation should be.

temperature offset conversion

Hello Tiago,
I’am using your library in my wifi energy meter project. Great work, saved me a lot of time dealing with cs5490. But I have an issue with the temperature offset. Reading the cs5490 datasheet I found “… with the binary point to the right of bit 16.”, but in the library you have “toBinary(23,MSBsigned,value);”. Can you check this.

ESP 32

Enhance code for ESP32 use:

  • Remove Serial flush (It causes bugs)
  • Replace Software serial to Hardware Serial

Comment Inconsistency

In the "Measurements" Section, the last item : (getTime) is correctly expressed as : "read Page 16, Address 61"

but the comment states : "Page 16, Address 49"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.