PDA

View Full Version : Maths help please



Tina10
- 11th June 2012, 15:39
Hi, I have one MCP3204 connected to my my 877A. I am getting the 12bit reading fine. The sensor is hooked to a load sensor. My problem is that how Can I get the exact load from the reading. My load sensor is for 14tonns. So 4096 reading for 14 tonns. Each increment is for 3.41Kg. My problem is dealing with decimal numbers, can someone advise on how to deal with calculations like this ??????

ScaleRobotics
- 11th June 2012, 16:36
Take the reading from your A/D and multiply it by 341. If your a/d sensor value is 1, then you will get 341 for 3.41 kg. You can set your lcd display to show this in the format of 3.41 if you like. Or you can divide the result by 100 and just end up with with 3 kg (no decimals).

HenrikOlsson
- 11th June 2012, 16:45
Hi,
How about

kg=raw_value */ 875
It's not perfect but is it enough?

Or you might try

dummy = raw_value * 3419
kg = DIV32 1000

or perhaps

dummy = raw_value * 3419
hg = DIV32 100
HSEROUT["Result: ", #hg/10, ".", #hg//10, "kg", 13]

If you have PBP2.60 or newer and you're able to use LONGS then there are other possibillities as well.

/Henrik.