View previous topic :: View next topic |
Author |
Message |
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Mon Aug 03, 2020 2:25 am Post subject: |
|
|
C.D current sensor test with single code for ACS712.
Until there you are correct and the value is 513 +/- 520
Code: | $regfile = "m328pdef.dat"
$crystal = 16000000
$hwstack = 40
$swstack = 16
$framesize = 32
$baud = 9600
Config Adc = Single , Prescaler = Auto , Reference = Avcc
Start Adc
Dim V_sensor As Integer
Do
V_sensor = Getadc(0)
Print V_sensor
Loop
End |
|
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Mon Aug 03, 2020 2:55 am Post subject: |
|
|
I have done a lot of testing with these sensors.
I could not get good readings with 10 bit ADCs
They were not stable and two digits were the best I could get.
You need a 10uF Tantalum capacitor on the sensor at the power supply.
I increased the filter capacitor to 100nF but fast measurements are lost with this.
I now use a 12 bit ADC and get stable 5 digit readings.
I do 16 samples and average them storing each average in a variable .
here is the readings from 11 sensors on my battery banks
1.860<>1.992<>0.096<>2.568<>2.736<>1.860<>0.768<>2.052<>1.656<>0.348<>1.932<>
Total Amps = 17.868
It can be seen that bank 3 is no good 7 and 10 not much better but now nearly 9 years old so expected.
Regards Paul |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Mon Aug 03, 2020 5:07 am Post subject: |
|
|
I do not see much difference we already see tomorrow because it is already very nights.
Nothing loads and the values come out. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Mon Aug 03, 2020 3:06 pm Post subject: |
|
|
Hello!!
Already solved since there is current noise can be the capacitors or setting a code for more precise.
Does anyone know how to add all values to a single value with a for_next? |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Mon Aug 03, 2020 3:14 pm Post subject: |
|
|
As we have already seen the monitor tables, the values are varied.
_0.039__0.066__0.092__0.066__0:092....................
difference of 27 +/- |
|
Back to top |
|
|
Paulvk
Joined: 28 Jul 2006 Posts: 1257 Location: SYDNEY
|
Posted: Tue Aug 04, 2020 1:15 am Post subject: |
|
|
Printpix52 wrote: | As we have already seen the monitor tables, the values are varied.
_0.039__0.066__0.092__0.066__0:092....................
difference of 27 +/- |
A 100nF filter capacitor on pins 6 and 5 greatly stabilizes this.
Also the devices are sensitive to nearby magnetic fields. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Tue Aug 04, 2020 11:38 pm Post subject: |
|
|
I am going to buy and order 100 nF tantalum capacitors tomorrow and I inform you, thank you !! |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Thu Aug 06, 2020 5:56 am Post subject: |
|
|
Hello!! I already change a little noise and we continue tomorrow to change other values of 1uF, 10nF and 100nF tantalum capacitors. |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Fri Aug 07, 2020 1:00 am Post subject: |
|
|
Paulvk wrote: | I have done a lot of testing with these sensors.
I could not get good readings with 10 bit ADCs
They were not stable and two digits were the best I could get.
You need a 10uF Tantalum capacitor on the sensor at the power supply.
I increased the filter capacitor to 100nF but fast measurements are lost with this.
I now use a 12 bit ADC and get stable 5 digit readings.
I do 16 samples and average them storing each average in a variable .
here is the readings from 11 sensors on my battery banks
1.860<>1.992<>0.096<>2.568<>2.736<>1.860<>0.768<>2.052<>1.656<>0.348<>1.932<>
Total Amps = 17.868
It can be seen that bank 3 is no good 7 and 10 not much better but now nearly 9 years old so expected.
Regards Paul |
Hello!!
You are absolutely right I have changed capacitors and nothing changes, the only thing that changes is the sensitivity to 170 and I see a little noise but we already let it.
in the future I will try 12Bit ADC... |
|
Back to top |
|
|
Printpix52
Joined: 18 Jun 2014 Posts: 282 Location: D.F.
|
Posted: Fri Aug 07, 2020 5:28 am Post subject: |
|
|
The noise has disappeared but without load and I am going to test an ammeter test and with a lamp load to compare with ACS712 |
|
Back to top |
|
|
SZTRAD
Joined: 30 Dec 2019 Posts: 165
|
Posted: Wed Feb 17, 2021 8:58 am Post subject: |
|
|
Hi
I assume you don't want to use another chip(I would choose something with differential inputs) Do you need to measure negative current or will you only measure positive current? You're using the power voltage as a reference. Is it well blocked? The ACS712 walks quite a bit with the power supply so block again. The combination of 10,100,1000nF in quality ceramics is ideal. Next, I suggest you use measurement averaging, I don't know how fast you need to measure. With appropriate connection and correction of the output signal, you are able to measure quite steadily. I use in serial production ACS712 in 20A version and the distinctiveness is around 10mA. Deployed in BMS for large battery blocks for balancer control and calculation of individual cell parameter. I don't have problems with them except for one production series that hasn't held parameters since production. You can calm the output with a plugged capacitor, but the error will be greater the greater the current. The tips of the sample will be completely lost. Consideration should be given to how long and how you.
Of course, you can calm the output with a connected capacitor, but there'll be more error in the current take-offs the bigger the current. The tips of the sample will be completely lost. Consideration should be given to how long and how the capacitor will discharge. You haven't written down what you need an evaluation for, so it's hard to answer. Software doesn't solve everything.
RS |
|
Back to top |
|
|
|