I had the old Data sheet where there was no such device.
Please accpet my appologies. Now downloaded the new pdf and see that indeed there is a variation of bidirectional device.
050U is unidirectional and has 0.6 volts offset.
So sorry.
Ioannis
I had the old Data sheet where there was no such device.
Please accpet my appologies. Now downloaded the new pdf and see that indeed there is a variation of bidirectional device.
050U is unidirectional and has 0.6 volts offset.
So sorry.
Ioannis
No problem Ioannis it happens to the best of us. Lol It is actually my fault if I had been thinking I would have included the spec sheet rather than just referencing it. It turns out from trial and error that the A/D readings includes the offset so in the calculations you have to subtract it.
Best, Ed
Yes, thats right. It is a constant value that has to be subtracted. The only little matter is that this constant is not so constant and may change with temp or other factors (aging etc.)
So a complete zero after calculation cannot be guaranteed. Even worse,the calculation can result in a negative number, that in absolute valu can be very large positive.
So a regular update of the offset value could be a good idea.
Ioannis
Hi Ioannis!
Thank you and you are very correct. What will probably be necessary is to add an external 3 second delay to measure the zero point each time time circuit is powered up. That is, power up the PIC, wait 3 seconds, then add the load. Where I have become very stuck is in what I call 4994 land. At 50 amps the A/D will be giving you value of 2987. Subtract a zero point of 490 and you get 2497. Times 2 and you get 4994. It seems no matter what I do this number keeps showing up!
Taking into account that your power supply is 5Volts and the max output of the device is 3.6 volts in respect with the flowing current, the reading of the ADC I think is correct.
I don't understand why you double it.
Ioannis
When things go wrong is that yes (2987 divided by 10 gives 298 -49 = 249. 249 x 200= 49800. 49800 /4096 = 12. 12 x 4167 = 50004 close enough to 50.00 amps. Now do the same with an A/D OF 700 which is very close to 4.24 amps measured and 700 / 10 = 70. 70 - 49 = 21. 21 x 200 = 4200. 4200 /4096 = 1 (in a PIC) 1 x 4167 = 4167 or .4167 amps not the 4.24. What I am trying to say is that if I get the high end of the scale to work the low end does not! Even at a change to 800 the results will not change. Other approaches such as ((700-490) ** 8000) >>4 = 1 so it does exactly the same!
At 50A: ADC=2987, offset=485. (2987-485) * 20 = 50040mA (50.04A)
At 4.24A: ADC=700, offset=485. (700-485) * 20 = 4300mA (4.3A)
At 1A: ADC=534, offset=485. (534-485) * 20 = 980mA (0.98A)
Not perfect. However, there are some things that doesn't quite add up here... You should be getting 60mV per A so at 50A you should get 3V or a count of 2457+offset. Now, you say that the offset is 485 which should give you a total of 2942 at 50A, yet you say that you get 2987 but never mind.
In theory, provided that your VRef is exactly 5.000V you will get 49.152 'counts' per A. If you get yoursefl a voltage reference of 4.096V then your ADC will report the measured voltage in units of 1mV instead which means that you'll get 60 counts per A - might make it easier for you.
/Henrik.
Bookmarks