Me and my team are developing aan LED light controller for street lightninglighting applications. We
We are trying to measure current draw, voltage and power consumption using Allegro's ACS71020 but the readings don't seem to make any sense. We have achieved a successful communication using I2C, since we can write and read multiples registers. For example, we changed the default slave address to 0x45, and to do that we had to write the customer code to a specific register, and then set 0x45 address (which involves another write operation). After that, we read the register that holds the I2C slave address and it appears changed. So we take from that that we're reading and writing successfully. We're
We're testing this IC using the evaluation board ASEK71020KMAB-090B3-I2C. We're using two different step-down circuits (recommended by the chip documentation), which are shown in the schematics attached (let's call circuit 1 to the purely resistive one, and circuit 2 to the one with capacitors).
v=(RXData1*256+RXData[0])/0x8000 ; i=(RXData3*256+RXData2)/0x4000 ;
v=(RXData[1]*256+RXData[0])/0x8000 ;
i=(RXData[3]*256+RXData[2])/0x4000 ;
Where RXData is an array that stores the received bytes from the I2C reading operation in the order specified by the acs71020 user guide. To
To test dethe ACS71020, we're using an incandescent lightbulb as the target load. Measuring its current draw, we see that it consumes 360mA @220V. The results using either the capacitive circuit or the resistive circuit are pretty similar. When the bulb is off we get Vrms=224VVrms = 224V, and i=3i = 3.1A ; and when it's on Vrms=224Vrms = 224 and i = 2.8A.
The next two tables contain the data obtained from the chip:
Table 1: The lightbulb is off
Table 2: The lightbulb is on
float acs71020_get_voltage(){
float aux_v=0;
acs71020_read(REG_IRMS_VRMS);
aux_v=((float)(RXData[1]*256+RXData[0]))/0x8000;
aux_v=aux_v*(FULL_SCALE_V);
return aux_v;
}
float acs71020_get_current(){ float aux_i=0; float aux_2=0;
}
float acs71020_get_current(){
float aux_i=0;
float aux_2=0;
acs71020_read(REG_IRMS_VRMS);
aux_2=(RXData[3]&0x7f)*256;
aux_i=(aux_2+RXData[2])/0x4000;
aux_i=aux_i*(FULL_SCALE_I);
return aux_i;
}
}
0B: raw vaules: 00 20 00 00 by fields: qvo_fine = 0 sns_fine = 0 crs_fine = 0 iavgselen = 1
raw values: 00 20 00 00
by fields:
qvo_fine = 0
sns_fine = 0
crs_fine = 0
iavgselen = 1
0C: raw vaules: 00 00 00 3C by fields: rms_avg_1 = 60 (decimal) rms_avg_1 = 0
raw values: 00 00 00 3C
by fields:
rms_avg_1 = 60 (decimal)
rms_avg_1 = 0
0D: raw values: 00 1F E0 00 by fields: pacc_trim = 0 ichan_del_en = 0 chan_del_sel = 0 fault = 255 (decimal) fitdly = 0 halfcycle_en = 0 squarewave_en = 0
raw values: 00 1F E0 00
by fields:
pacc_trim = 0
ichan_del_en = 0
chan_del_sel = 0
fault = 255 (decimal)
fitdly = 0
halfcycle_en = 0
squarewave_en = 0
0E: raw values: 00 08 20 00 by fields: vevent_cycs = 0 vadc_rate_set = 0 overvreg = 32 (decimal) undervreg = 32 (decimal) delaycnt_sel = 0
raw values: 00 08 20 00
by fields:
vevent_cycs = 0
vadc_rate_set = 0
overvreg = 32 (decimal)
undervreg = 32 (decimal)
delaycnt_sel = 0
0F: raw values: 00 00 03 14 by fields: i2c_slv_addr = 69 (decimal, or 0x45) i2c_slv_addr = 1 dio_0_sel = 0 dio_1_sel = 0
raw values: 00 00 03 14
by fields:
i2c_slv_addr = 69 (decimal, or 0x45)
i2c_slv_addr = 1
dio_0_sel = 0
dio_1_sel = 0