You have a couple of options (that I can think of):How can i calculate the decimal value in watt's out of my 10bit ADC value
- Direct Math
- Lookup Table
In the direct math, you would follow the equation: Pwr = (Vrms ^ 2 / R). Where Vrms is the voltage read from the ADC; meaning you need to convert the ADC reading to voltage, and then input into equation. You can optimize a lot of this by pre-calculating many of the terms. For example Vrms would be ADC_count * Vref / 2^bits), where bits is the number of bits on your ADC (note that any gain/loss between the detector and ADC must be accounted for on the equation as well). In any case, pre-calculate all the known values beforehand so the PIC has less computation to do.
In the lookup table method, you would build up a table which relates ADC_count to Pwr (again, this is all pre-calculated beforehand - Excel is great for this). You may need to interpolate between values if you need more precision.
In either case you still have to account for any gains/losses (e.g. coupler, and conditioning OPAMP / divider - if used) between the signal you are attempting to measure and the ADC input.
The following link provides some good examples on math techniques using the STAMP (pretty close to PBP) :http://www.emesystems.com/BS2math3.htm
Bookmarks