PM10DC
y
6
tion and accuracy. For our dB range of the detector (-40dBm to +40dBm) this
comes out to an output voltage range between 0.4V to 2.5V. Now if we have
the converter set up to convert between 0-2.5V, this means we have a poten-
tial accuracy of 2.5 / numSteps or 2.5 / 2^12 or 610uV per step, or in other
words 610uV / 25mV/dB = .024dB per step. A fair bit of resolution to start
with!
Before going directly to the analog to digital converter however, we do some
signal conditioning on the output of the AD8307s with U1:A and U1:B, which is
a non-inverting amplifier and low-pass filter. The low-pass filter helps to re-
move noise and higher frequency changes in power level, like very fast AM
signals, to give us a better average dBm reading. DC-wise this has a gain of
1+Rf/Ri or 1+10K/1K or 1.1. This means our 25mV per dB now becomes
27.5mV per dB. We simply adjust the code to scale the numbers differently to
get the correct results on the display.
U4 is an amazing little part, with accurate timers, a 10-channel 8-bit analog
to digital converter, all sorts of interrupts and more; there is a heck of a lot you
can do with this tiny part! In our case we are mostly doing math on the sam-
pled results of the AD8307s, and the rest is user interface stuff like looking at
the switch and updating the display. When the average power mode is se-
lected, we can take upwards of 100 dB results, convert it to power, add the
power to a total sum, then take the average of all of them and display it all
within one second’s time. All this while maintaining math accuracy of +/-
0.024dB!
So, how is the math done, you may ask? Well, there isn’t enough room to go
into detail but here are some basic formulas I used to get this to happen.
Since our A/D converter is measuring at 27.5mV per dB, and our reference
is 2.5V, it just so happens that the math works out to taking the conversion
value (0-4095) and multiplying it by 27.5 which gives us a result in dB * 1024.
1024 is a power of two, meaning that if we do some more shifting to the right
(essentially a single bit shift to the right divides by two) we can get the correct
value in dB. Let’s say our sample is 1000; we multiply by 27.5 so the answer
is 27500. This is now dB * 1024, so let’s bit shift the answer to the right 10
times, which divides by 1024. The answer becomes 26.86dB! Now we only
have to factor in the attenuation, and in the case of how we calibrate the
PM10DC and the attenuation, we need to subtract 48.6dB from this answer to
get actual dB. This comes out to the conversion of 1000 = -21.74dBm!
Now that we have our dBm result we have to calculate watts from it when we
need to display watts. This gets a bit tricky since we are talking about loga-
rithms. To the left is the formula which converts dBm to
power. This is implemented in the microcontroller in a
lookup table and some interpolation to get high speed
and high accuracy. Let’s just plug the numbers in and
P db
(
)
10
db
10
0.001
.
Summary of Contents for PM10DC
Page 18: ...PM10DC y18 ...
Page 19: ...PM10DC y19 ...
Page 34: ...PM10DC y34 MAIN AND DISPLAY BOARD LAYOUT ...
Page 35: ...PM10DC y35 PM50 MAIN AND DISPLAY SCHEMATIC ...