Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 301 characters in body; edited title
Source Link
ocrdu
  • 9.3k
  • 23
  • 32
  • 42

acs71020 ACS71020 Connecting and reading voltage properly

I am using an ACS71020ACS71020 3.3V3 V I2C version hooked up to an ESP32. I have connected the IC as proposed in the datasheet. RsenseRsense used is 1.8k ohm8 kΩ as proposed in the evaluation board user manual for 230-240 VRMSVRMS. 

With connecteda load iconnected I get reasonable results for IrmsIRMS when reading register 0x20, but Vrms areVRMS is much lower than expected, and iI guess as a result the P rmsRMS is also not correct.   

Proposed schematic   

enter image description here *Above

Above is my implementation (I2C pull-ups are present) It.

It is also stated that the maximum voltage for the VINPVINP pin is 0.275 V. I I measured RsenseRsense with multi metera multimeter and got something around 0.100 V rmsRMS (Whichwhich will not be close to 0.275 V in aplitudeamplitude). So i

I thought that might be an issue and I tried to recreate the scenario in LtSpice  :

simulation. 

And indeed it showsshowed that the the voltage across R5 would be around 0.100 VrmsVRMS. WasI was not sure of the role of R3 and R5  , thereforeso I tried to removeremoving them and got ~0.290 V max amplitude ,amplitude; changing RsenseRsense to 1.7k7 kΩ would yield ~0.275 V max amplitude exactly. 

I have removed R3 and R5 from my PCB, but iI still get resultsgot pretty similar as with them.results (willI will attach resultthe results later,when i when I get my hands on the test pcbPCB again)

Regarding the code, maybe iI am doing something wrong there as well. But, but as far as I understand the basic flow would be. Read the values from VRMS IRMS registers. Transform them from Q number() format to Float and then Multiply Vrms by 325(Full scale voltage,or should it by 230 ? ) and Irms by 30 as i have a 30 amps AC71020 version.be:

  • Read the values from the VRMS and IRMS registers;
  • Transform them from Q number() format to float;
  • Multiply VRMS by 325 (full-scale voltage, or should it 230?) and IRMS by 30 as I have a 30 A AC71020 version.

I expect that the values would oscillate based on at which time of the cycle they are being read by the ESP32,therefore therefore they should by averaged.

void acs171020_read_2_15Bytes(byte address) {
  uint16_t Irms;
  uint16_t Vrms;
  byte buff[4];
  Wire.beginTransmission(0x66);
  Wire.write( 0x20);
  Wire.endTransmission();
  Wire.requestFrom(0x66, 4);
  int nrrr = 0;
  while (Wire.available())   // slave may send less than requested
  {
    char c = Wire.read();    // receive a byte as character
    buff[nrrr++] = c;
  }

  Vrms = (buff[1] << 8) + buff[0];
  bitClear(Vrms, 15);
  Irms = (buff[3] << 8) + buff[2];
  bitClear(Irms, 15);

  float testVRM =  ((float)Vrms) * 0.00003051757; //or /32768.0
  float testVRMMM = qToFloat<uint16_t>(Vrms, 15);

  // both give same value
 testVRMMM = testVRMMM *325;

 float testIRM = qToFloat<uint16_t>(Irms, 14);// ((float)Irms) * 0.00006103515;

  float testIRMS =  ((float)Irms) * 0.00006103515; //or /32768.0
  testIRMS = testIRMS * 30;
    void acs171020_read_2_15Bytes(byte address) {
      uint16_t Irms;
      uint16_t Vrms;
      byte buff[4];
      Wire.beginTransmission(0x66);
      Wire.write( 0x20);
      Wire.endTransmission();
      Wire.requestFrom(0x66, 4);
      int nrrr = 0;
      while (Wire.available()) {   // slave may send less than requested
        char c = Wire.read();    // receive a byte as character
        buff[nrrr++] = c;
      }
    
      Vrms = (buff[1] << 8) + buff[0];
      bitClear(Vrms, 15);
      Irms = (buff[3] << 8) + buff[2];
      bitClear(Irms, 15);
    
      float testVRM =  ((float)Vrms) * 0.00003051757; //or /32768.0
      float testVRMMM = qToFloat<uint16_t>(Vrms, 15);

      // both give same value
     testVRMMM = testVRMMM *325;

     float testIRM = qToFloat<uint16_t>(Irms, 14); // ((float)Irms) * 0.00006103515;

     float testIRMS =  ((float)Irms) * 0.00006103515; //or /32768.0
     testIRMS = testIRMS * 30;

To sum up : Are 2two 1 mega ohm resistors really needed on the VINNVIN line  ? Am Am I missing something crucial in the code part?

UPDATE: OkOK, in order to improve improve performance a bit and let the IC to actualy do it'sits job, I have enabled the customer mode and set in the register 0x1C to make an average of 62 samples per minute. Then I read 0x27 once a second. The Q to float value is now ~0.3121337891 so to get 230 the full scale-scale voltage should be then considered to be 736.86351184 V. Where does this number come from, how can iI verify it  ?

acs71020 Connecting and reading voltage properly

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct.  Proposed schematic  enter image description here *Above is my implementation (I2C pull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 V rms(Which will not be close to 0.275 V in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice  simulation. And indeed it shows that the the voltage across R5 would be around 0.100 Vrms. Was not sure of the role of R3 and R5  , therefore tried to remove them and got ~0.290 V max amplitude , changing Rsense to 1.7k would yield ~0.275 V max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

Regarding the code, maybe i am doing something wrong as well. But as far as I understand the basic flow would be. Read the values from VRMS IRMS registers. Transform them from Q number() format to Float and then Multiply Vrms by 325(Full scale voltage,or should it by 230 ? ) and Irms by 30 as i have a 30 amps AC71020 version. I expect that the values would oscillate based on which time of cycle they are being read by ESP32,therefore they should by averaged.

void acs171020_read_2_15Bytes(byte address) {
  uint16_t Irms;
  uint16_t Vrms;
  byte buff[4];
  Wire.beginTransmission(0x66);
  Wire.write( 0x20);
  Wire.endTransmission();
  Wire.requestFrom(0x66, 4);
  int nrrr = 0;
  while (Wire.available())   // slave may send less than requested
  {
    char c = Wire.read();    // receive a byte as character
    buff[nrrr++] = c;
  }

  Vrms = (buff[1] << 8) + buff[0];
  bitClear(Vrms, 15);
  Irms = (buff[3] << 8) + buff[2];
  bitClear(Irms, 15);

  float testVRM =  ((float)Vrms) * 0.00003051757; //or /32768.0
  float testVRMMM = qToFloat<uint16_t>(Vrms, 15);

  // both give same value
 testVRMMM = testVRMMM *325;

 float testIRM = qToFloat<uint16_t>(Irms, 14);// ((float)Irms) * 0.00006103515;

  float testIRMS =  ((float)Irms) * 0.00006103515; //or /32768.0
  testIRMS = testIRMS * 30;

To sum up : Are 2 1 mega ohm resistors really needed on the VINN line  ? Am I missing something crucial in the code part?

UPDATE: Ok, in order to improve improve performance a bit and let the IC to actualy do it's job, I have enabled the customer mode and set in the register 0x1C to make an average of 62 samples per minute. Then I read 0x27 once a second. The Q to float value is now ~0.3121337891 so to get 230 the full scale voltage should be then considered 736.86351184 V. Where does this number come from, how can i verify it  ?

ACS71020 Connecting and reading voltage properly

I am using an ACS71020 3.3 V I2C version hooked up to an ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8 kΩ as proposed in the evaluation board user manual for 230-240 VRMS. 

With a load connected I get reasonable results for IRMS when reading register 0x20, but VRMS is much lower than expected, and I guess as a result PRMS is also not correct. 

Proposed schematic 

enter image description here

Above is my implementation (I2C pull-ups are present).

It is also stated that the maximum voltage for the VINP pin is 0.275 V. I measured Rsense with a multimeter and got something around 0.100 VRMS (which will not be close to 0.275 V in amplitude).

I thought that might be an issue and I tried to recreate the scenario in LtSpice:

simulation. 

And indeed it showed that the the voltage across R5 would be around 0.100 VRMS. I was not sure of the role of R3 and R5, so I tried removing them and got ~0.290 V max amplitude; changing Rsense to 1.7 kΩ would yield ~0.275 V max amplitude exactly. 

I removed R3 and R5 from my PCB, but I still got pretty similar results (I will attach the results later, when I get my hands on the test PCB again)

Regarding the code, maybe I am doing something wrong there as well, but as far as I understand the basic flow should be:

  • Read the values from the VRMS and IRMS registers;
  • Transform them from Q number() format to float;
  • Multiply VRMS by 325 (full-scale voltage, or should it 230?) and IRMS by 30 as I have a 30 A AC71020 version.

I expect that the values would oscillate based on at which time of the cycle they are being read by the ESP32, therefore they should by averaged.

    void acs171020_read_2_15Bytes(byte address) {
      uint16_t Irms;
      uint16_t Vrms;
      byte buff[4];
      Wire.beginTransmission(0x66);
      Wire.write( 0x20);
      Wire.endTransmission();
      Wire.requestFrom(0x66, 4);
      int nrrr = 0;
      while (Wire.available()) {   // slave may send less than requested
        char c = Wire.read();    // receive a byte as character
        buff[nrrr++] = c;
      }
    
      Vrms = (buff[1] << 8) + buff[0];
      bitClear(Vrms, 15);
      Irms = (buff[3] << 8) + buff[2];
      bitClear(Irms, 15);
    
      float testVRM =  ((float)Vrms) * 0.00003051757; //or /32768.0
      float testVRMMM = qToFloat<uint16_t>(Vrms, 15);

      // both give same value
     testVRMMM = testVRMMM *325;

     float testIRM = qToFloat<uint16_t>(Irms, 14); // ((float)Irms) * 0.00006103515;

     float testIRMS =  ((float)Irms) * 0.00006103515; //or /32768.0
     testIRMS = testIRMS * 30;

To sum up : Are two 1 resistors really needed on the VIN line? Am I missing something crucial in the code part?

UPDATE: OK, in order to improve improve performance a bit and let the IC actualy do its job, I have enabled the customer mode and set the register 0x1C to make an average of 62 samples per minute. Then I read 0x27 once a second. The Q to float value is now ~0.3121337891 so to get 230 the full-scale voltage should then considered to be 736.86351184 V. Where does this number come from, how can I verify it?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 427 characters in body
Source Link
Miaso
  • 11
  • 3

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. [![Proposed schematic][1]][1]Proposed schematic [![enter image description here][2]][2]enter image description here *Above is my implementation (I2C pull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 V rms(Which will not be close to 0.275 V in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice [![simulation][3]][3]simulation. And indeed it shows that the the voltage across R5 would be around 0.100 Vrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 V max amplitude , changing Rsense to 1.7k would yield ~0.275 V max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

To sum up : Are 2 1 mega ohm resistors really needed on the VINN line ? Am I missing something crucial in the code part? [1]: https://i.sstatic.net/kC6AC.png [2]: https://i.sstatic.net/fUec9.png

UPDATE: [3]:Ok, in order to improve improve performance a bit and let the IC to actualy do it's job, I have enabled the customer mode and set in the register 0x1C to make an average of 62 samples per minute. Then I read 0x27 once a second. The Q to float value is now ~0.3121337891 so to get 230 the full scale voltage should be then considered 736.86351184 V. Where does this number come from, how can i verify it https://i.sstatic.net/6VLUU.png?

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. [![Proposed schematic][1]][1] [![enter image description here][2]][2] *Above is my implementation (I2C pull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 V rms(Which will not be close to 0.275 V in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice [![simulation][3]][3]. And indeed it shows that the the voltage across R5 would be around 0.100 Vrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 V max amplitude , changing Rsense to 1.7k would yield ~0.275 V max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

To sum up : Are 2 1 mega ohm resistors really needed on the VINN line ? Am I missing something crucial in the code part? [1]: https://i.sstatic.net/kC6AC.png [2]: https://i.sstatic.net/fUec9.png [3]: https://i.sstatic.net/6VLUU.png

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. Proposed schematic enter image description here *Above is my implementation (I2C pull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 V rms(Which will not be close to 0.275 V in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice simulation. And indeed it shows that the the voltage across R5 would be around 0.100 Vrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 V max amplitude , changing Rsense to 1.7k would yield ~0.275 V max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

To sum up : Are 2 1 mega ohm resistors really needed on the VINN line ? Am I missing something crucial in the code part?

UPDATE: Ok, in order to improve improve performance a bit and let the IC to actualy do it's job, I have enabled the customer mode and set in the register 0x1C to make an average of 62 samples per minute. Then I read 0x27 once a second. The Q to float value is now ~0.3121337891 so to get 230 the full scale voltage should be then considered 736.86351184 V. Where does this number come from, how can i verify it ?

deleted 3 characters in body
Source Link
Miaso
  • 11
  • 3

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. [![Proposed schematic][1]][1] [![enter image description here][2]][2] *Above is my implementation (I2C pullupspull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 mVV rms(Which will not be close to 0.275 mV Peak to PeakV in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice [![simulation][3]][3]. And indeed it shows that the the voltage across R5 would be around 0.100 mVrmsVrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 mV peak to peakV max amplitude , changing Rsense to 1.7k would yield ~0.275 mV peak to peakV max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. [![Proposed schematic][1]][1] [![enter image description here][2]][2] *Above is my implementation (I2C pullups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 mV rms(Which will not be close to 0.275 mV Peak to Peak). So i thought that might be an issue and tried to recreate the scenario in LtSpice [![simulation][3]][3]. And indeed it shows that the the voltage across R5 would be around 0.100 mVrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 mV peak to peak , changing Rsense to 1.7k would yield ~0.275 mV peak to peak exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

I am using an ACS71020 3.3V I2C version hooked up to ESP32. I have connected the IC as proposed in the datasheet. Rsense used is 1.8k ohm as proposed in the evaluation board user manual for 230-240 VRMS. With connected load i get reasonable results for Irms when reading register 0x20, but Vrms are much lower than expected, and i guess as a result the P rms is also not correct. [![Proposed schematic][1]][1] [![enter image description here][2]][2] *Above is my implementation (I2C pull-ups are present) It is also stated that maximum voltage for the VINP pin is 0.275. I measured Rsense with multi meter and got something around 0.100 V rms(Which will not be close to 0.275 V in aplitude). So i thought that might be an issue and tried to recreate the scenario in LtSpice [![simulation][3]][3]. And indeed it shows that the the voltage across R5 would be around 0.100 Vrms. Was not sure of the role of R3 and R5 , therefore tried to remove them and got ~0.290 V max amplitude , changing Rsense to 1.7k would yield ~0.275 V max amplitude exactly. I have removed R3 and R5 from my PCB, but i still get results pretty similar as with them.(will attach result later,when i get my hands on test pcb again)

Source Link
Miaso
  • 11
  • 3
Loading