This is an RF power meter I built to help measure amplifiers for a QO-100 transciever project.
The AD8317 has a linear output for -35dBm up to about -5dBm, which is fed in to the analog input of a blue pill board. The Python script polls for samples and displays on a graph with some stats.
Measurements are highly dependent on frequency, so it is important to edit the calibration data in __main__.py
for the band you want to measure. The calibration matrix specifies pairs of ADC values and the corresponding power level in dBm.
External attenuation can be specified, again it is important to measure this at the frequency you want to measure.
Using a directional coupler it is possible to measure the return loss, and use this to calculate VSWR:
About as accurate as your calibration. To get the best results you need an accurate signal source. For 2.4GHz I have used some data collected by DD1US using a PlutoSDR. This is unlikely to be accurate for my PlutoSDR but is roughly in the same order of magnitude. My main use case for this is measuring gain from amplifiers, so it is the delta between measurements rather than the absolute value that is important.