Jump to content

Recommended Posts

Measuring Video Transmitter (vTx) RF power and checking antenna performance are two things a lot of FPV'ers would like to do. ImmersionRC sells a nice RF Power Meter but its $150 USD price tag is a problem for most hobby budgets.

But I have low cost solution for you. How about a DiY digital RF Power meter for less than $30 USD?  Its 433MHz to 5.8GHz frequency range means it can handle all your FPV devices. Max input level is 0dBm, but much higher RF power is acceptable with an external attenuator (budget $20). And it can measure antenna VSWR if you add a RF Directional Coupler (budget $65).

Here's what it looks like:

vswr_meas2_800.jpg

 

Here's an example of a VSWR measurement. Just a couple keypad presses is all it takes to measure the antenna:

vswr_meas1b_1000.jpg

 

The 3D printed plastic case shown above is not required, but looks fantastic. Inside is a Arduino Mega R3 board ($12), LCD/Keyboard shield ($3), and AD8318 RF power sensor board ($12).  These parts are available from from eBay and Banggood retailers.

internal_view2_1200.jpg

Assembly involves soldering 3 wires, 2 resistors, and a capacitor. Then flash the firmware using the Arduino Mega's built-in USB port. Low cost and quick assembly, who doesn't love that?

 

Share this post


Link to post
Share on other sites

This DiY build has a short parts list. You'll need:

  • 1 each, Arduino Mega2560 R3 Microcontroller Board: eBay search
  • 1 each, Arduino 1602 LCD / 6-button Keypad Shield: eBay search
  • 1 each, Analog Devices AD8318 Log Detector/Controller Board:
  • 1 each, 470 ohm 1/8W or 1/4W Resistor: eBay search
  • 1each, 3.3K ohm 1/8W or 1/4W Resistor: eBay search  (May require different value due to LCD Keyboard Shield variants, see project discussion)
  • 1 each, 100pF 0603 SMD Ceramic Capacitor: eBay search
  • 1 each, 10mm Toroid (optional, see instructions): eBay search

Plus about 1.5 feet of 28 to 32 AWG 3-conductor wire. You can get this from an old USB cable.

For measuring vTx power up to 1 Watt you'll need a fixed 30dB attenuator. I'm using the Mini-Circuits VAT-30W2+. At $20 it is a good value since it has a predictable attenuation curve and supports all the FPV frequencies. You can measure more than 1W with a higher value attenuator. But wary of those cheap Chinese attenuators on eBay; Their low price is due to their sloppy variations in attenuation.

VSWR measurements will require a RF Directional Coupler.  I'm using a Krytar 0955-0098 that I got off eBay for $50. It is rated for 2-8GHz applications, but I found that mine also handled 900 -1300MHz device measurements with good results too.

Edited by Mr.RC-Cam
Added note about alternate resistor.

Share this post


Link to post
Share on other sites

You can build the meter without a fancy enclosure.  But if you have access to a 3D printer then I recommend making the custom plastic case.

The case was originally created/published by contributor Vector_Mayhem on Thingiverse: https://www.thingiverse.com/thing:142282

But I modified the Case's Top cover and Button KeyPad for the RF Power Meter. Here's my revised files:

Custom Button Pad File: Button_Pad1.stl

keypad_stl1_1000.jpg

 

Custom Case Top File: Case_Top1.stl

Case_Top1_1000.jpg

 

3D Printing Tips:
1. You can use PLA or ABS.
2. Be sure to scale the files to account for shrinkage of YOUR filament. For example, I used ABS and that requires 101% scaling.
3. I suggest 40% infill with 3 solid layers on the top, bottom, and perimeter.
4. Do NOT remove the tree that holds the Button Pad's keycaps together (be gentle when pulling the part from your print bed).
5. The five captive keycaps on the Button Pad must smoothly fit in the case top. Trim or file as needed to eliminate any binding.


 

Share this post


Link to post
Share on other sites

Electronic Assembly Instructions

STEP 1:
Begin assembly by plugging the LCD Keypad board into the Arduino Board. The LCD Keypad board goes on top and it must be carefully offset to the left side as shown below:

PCB_Stack1_1200.jpg

Initially it may seem to be a mystery on how to correctly align the two boards. Fortunately the various connectors are silkscreened with pin-out labels. I suggest finding "A5" on both boards and then plug them together so that the A5 positions match up. Double check your work!


STEP 2:
Solder the 100pF SMD cap to the empty component position on the RF Power board, as shown below:

RF_Board_Cap1_1200.jpg

 

STEP 3:
Solder the two resistors to the Arduino Board as follows (see photo below):
  470 ohm: A1 to GND
  3.3K ohm: A0 to GND

Shield_Wiring1_1200.jpg

Note: Use the GND solder pad that is located on the left side of the arrow pointer shown above.

STEP 4:
Connect the RF Power board to the Arduino using small gauge (28-32AWG) 3-conductor twisted wire, as follows:
NOTE: The wire's length should be short as practical. 

  WHITE: RF Board OUT to Arduino A1
  BLACK: RF Board GND to Arduino GND (right side of arrow pointer shown above)
  RED: RF Board VCC to Arduino VIN

OPTIONAL: I wrapped the wires around a 10mm diameter Toroid to minimize any common mode noise from the RF sensor board. The Toroid wraps should have at least 10 turns. The Toroid filter might not be necessary but provides a bit of insurance against unexpected problems.

RF_Board_Toroid1_800.jpg

 

If you've made the 3D printed enclosure then now is a good time to install everything in it.

Assembly is complete. All that remains is to flash the firmware.

 

Share this post


Link to post
Share on other sites

The Arduino board has a built-in USB port for firmware flashing. The internet is full of How-To's that explain the flashing process, so I won't repeat the details here. If you are new to Arduino then be prepared to watch some YouTube videos and/or visit some web sites.

Note: This Arduino project will compile without any errors on Arduino IDE Version 1.8.5. To avoid compile failure frustrations I suggest you use this version too.

In the Arduino Tools menu choose these two settings before flashing the Arduino sketch file: 
  Board: Arduino/Genuino Mega or Mega 2560
  Processor: ATmega2560 (Mega 2560)

1. Assuming you already have the Arduino IDE installed on your PC, begin by downloading the project's zipped firmware file set.

      Version 2.3RF_Power_Meter.zip

2. Unzip the files in a Arduino working directory named RF_Power_Meter.

3. Flash the Arduino and wait for the file transfer to end.

A few seconds after flashing is complete you will see the power meter's boot messages, beginning with the "RF POWER METER" title. At the end of the boot sequence the meter will display "HARDWARE PROBLEM, RF SENSOR FAILS". Then a few seconds later it will display "OVERLOAD WARNING, DISCONNECT NOW!" Ignore these warnings for now, they occur whenever the meter's main battery power is missing. That is to say, the USB connection on its own doesn't provide voltage to the RF sensor so it will fail the start-up tests.

4. Disconnect the USB cable. Apply 2S-3S LiPO battery power (7.4V - 12V).

5. At the end of the boot sequence the meter should display the "NO RF Signal" message. Congrats, the meter is working!

At this point the meter should be functional. Go ahead and use the keypad to explore the menus to see the available functions and settings.

Edited by Mr.RC-Cam
Added note that Arduino 1.8.5 IDE is recommended

Share this post


Link to post
Share on other sites

The AD8318 RF sensor's data sheet advises performing a board-level calibration to ensure measurement accuracy. Here is the datasheet, see Device Calibration section: AD8318.pdf

Calibrating the meter will ensure accurate RF power measurements. However, if you only intend to use the meter's VSWR function then calibration is NOT necessary. But no doubt you'll want to measure RF power too, so plan on performing the calibration procedure.

What does this all mean? Editing the calibration data in the Arduino source code is needed for each RF band you intend to measure. The Arduino config file has two data arrays that holds the sensor's Slope (signal gain) and Intercept (signal offset) calibration information.

The two data arrays are found in the config.h file, as follows:
   slope data array: CAL_SLOPE [ ]
   intercept data array: CAL_INTERCEPT [ ]

Each array has six values that relate to the meter's six supported RF bands. The data values are arranged in this order: 433, 900, 1200, 2400, 3300, 5800.

The calibration data began as values determined from the datasheet that were further optimized by using a trusted RF power meter and attenuator. Fortunately I have other RF power measuring equipment that is accurate, so I used it to determine the final calibration data for my DiY meter.

You'll need to do a similar meter measurement comparison to find the best calibration values. So plan on hunting down a FPV buddy that has a reliable (calibrated) RF meter and attenuator. Beg/bribe and borrow it. For example, the ImmersionRC's power meter is fine for this task.

Edited by Mr.RC-Cam
Updated cal array names.

Share this post


Link to post
Share on other sites

As mentioned, each RF band that you intend to use will need to be calibrated. In this example we'll calibrate the meter's 900MHz band using a 910MHz FPV video transmitter (vTx).

PART 1: Slope Calibration (900MHz)

The items you'll need are as follows:
  1 each, 910MHz vTx (100mw to 800mW).
  2 each, 30dB fixed attenuator. MiniCircuits' VAT-30W2+ is recommended.
  1 each SMA-SMA adapter or very short coax patch cable.

1. Apply power to the meter and wait a few seconds for the main measurement screen to appear.

2. Press the Enter key. Use the Up/Down keys and set the meter to the 900MHz band.

3. Press Enter again. Use the Up/Down keys and set the meter's Atten Profile to match your attenuator's value. For example, if using a VAT-30W2+ then select that entry. Otherwise use the Custom entry and set the correct dB value for your attenuator. Press Enter one more time to exit the setting mode.

4. Use the SMA-SMA adapter and connect the 900MHz vTx and one (1) attenuator to the meter.

5. Apply Power to vTx and confirm you see a dBm / mW value.

6. Now use the Up key and select the Relative RF Diff mode. Press the Enter key to zero the value. See the photo below.

slope_meas1_1000.jpg


7. Remove power from the vTx and install the second attenuator. The second attenuator will be measured and used to calibrate the meter.  Reapply vTx power. See photo below:
slope_meas2_1000.jpg

8. The measured attenuation value will be shown on the meter's display.

IMPORTANT: ALL attenuators have frequency dependent tolerances. That is to say, the actual dB value will vary depending on the measured frequency. In this example I am measuring a VAT-30W2+ attenuator and its datasheet shows that typical 900MHz attenuation will be 29.7dB to 29.8dB. The measurement in the photo example (see above) shows the correct value for my "30dB" attenuator. That's because this is a calibrated meter.

If the measured value is incorrect then the RF sensor's 900MHz slope value will need adjustment. This requires editing / reflashing the Arduino code.  I won't explain how to use the Arduino IDE to edit the code because there are endless YouTube tutorials that will do a better job of teaching you the basics.

9. Calibrating the slope measurement begins by opening the config.h file. Find the CAL_SLOPE array directly below the AD8318 SECTION BEGINS HERE text region. The six comma separated Slope values are ordered by RF band (433, 900, 1200, 2400, 3300, 5800). The second value is the 900MHz band's slope data.  Identify this value -- it is the one you will edit.

10. If the displayed measurement is too large then decrease the slope value. If the value is too low then increase the value. The exact amount of the change should be small, perhaps try ±0.0005. After editing the value, save the file, then flash the Arduino board. Repeat these slope calibration steps until the meter accurately measures the attenuator's expected value.

 

Edited by Mr.RC-Cam
Updated Cal Array Name.

Share this post


Link to post
Share on other sites

Now that the 900MHz slope value is calibrated we can move on to the RF sensor's Intercept calibration. These instructions are for the 900MHz band.

PART 2: Intercept Calibration (900MHz)

The items you'll need are as follows:
  1 each, 910MHz vTx (100mw to 800mW).
  1 each, trusted RF Power Meter (to be used as a Reference Meter). An ImmersionRC RF power meter is used in this example.
  1 each, 30dB fixed attenuator. MiniCircuits' VAT-30W2+ is used in this example.
  1 each SMA-SMA adapter or very short coax patch cable.
 

1. Connect the attenuator to the Reference Meter. In this example I used an ImmersionRC Power meter along with its included 5cm long SMA patch cable and 30dB attenuator.

2. Apply power to Reference Meter and configure it for the 900MHz band. Set the Attn value to 29.7dB (nominal value for VAT-30W2+).

3. Connect the 900MHz vTx to the attenuator and apply power. Allow it to warm up for a few minutes. Do not allow the vTx to overheat (use a small fan if necessary).

4. Measure / record the vTx's mW and dBm values. Example shown in photo below.

intercept_meas1_1200.jpg
 

5. Apply power to your DiY RF meter. Confirm that it is still set to the 900MHz band and Attn value is 29.7dB.

6. Remove power from the vTx and move it (with the attenuator) to your DiY RF meter. Apply Power to vTx and allow it to warm up again.

7. Measure / record the vTx's mW and dBm values. Example shown in photo below.

intercept_meas2_1200.jpg


8. Using your recorded measurements, subtract the Reference Meter's dBm value from the DiY meter's measurement. If the difference value is more than 0.1dBm then the RF sensor's 900MHz Intercept value will need adjustment. This requires editing / reflashing the Arduino code.

9. Calibrating the intercept value begins by opening the config.h file. Find the CAL_INTERCEPT array directly below the AD8318 SECTION BEGINS HERE text region. The six comma separated intercept values are ordered by RF band (433, 900, 1200, 2400, 3300, 5800). The second value is the 900MHz band's intercept data.  Identify this value -- it is the one you will edit.

10. If the dBm measurement was too high then decrease the intercept array value by subtracting the difference value from it. If the value is too low then increase the intercept value by adding the difference value. After editing the value, save the file, then flash the Arduino board.

11. Confirm the DiY meter's 900MHz RF power measurement is now within 0.1dBm of the reference meter.  Your meter's 900MHz band is now fully calibrated.

Repeat the slope and intercept calibration steps for the other RF bands you intend to use.

 

Edited by Mr.RC-Cam
Updated Cal Array Name.

Share this post


Link to post
Share on other sites

All the missing details will be posted as I find time to do it. No promises, but perhaps in a week or so.

Aug-23-2017 Edit: Arduino code link has been posted.

Edited by Mr.RC-Cam
Arduino code link

Share this post


Link to post
Share on other sites

The DiY RF Power Meter can measure antenna SWR (VSWR). A RF Directional Coupler is needed to use this feature. Mine is a Krytar 0955-0098 that is rated for 2-8GHz applications. Despite it's 2GHz rated lower end, I get good VSWR results down to the 900MHz band.

The VSWR function is simple to use. Here is an example involving a 910MHz FPV antenna.

1. Apply power to your DiY meter. Select the appropriate RF band and ATTN setting for your equipment.

Then use the Up/Down keys until you see the  VSWR: [SEL] TO START menu.  Then Press the Enter (Select) Key to select the VSWR function.

2. Prepare to install the Directional Coupler, vTx (video transmitter), attenuator, and antenna (DUT).  For best results do NOT use coax cables to connect them; SMA-SMA coupler adapters are recommended instead.

3. See photo below for Forward measurement setup. When ready, press the Enter Key to perform the measurement.

vswr_step1_1200.jpg


4. See photo below for Reverse measurement setup. When ready, press the Enter Key to perform the measurement.

vswr_step2_1200.jpg


5. The SWR measurement results will be automatically calculated and displayed. See photo below for example:

vswr_step3_1200.jpg

Share this post


Link to post
Share on other sites

Go ahead and explore the menus to become acquainted with the meter's functions. The features are simple enough that I didn't feel it necessary to write a formal instruction manual. But here's some basic tips:

[1] Menu navigation uses five context sensitive keypad buttons (see photo below):
keypad_info1_1000.jpg
  1 = Select / Enter / Change Freq Band & Attn / Reset Min & Max
  2 = Left / Previous
  3 = Up / Next
  4 = Right / Next / Edit Attn Value
  5 = Down / Previous

[2] You can change the Frequency and Attenuator settings by pressing the Select (Enter) key while in the main RF power mode. This mode is identified by the toggling FREQ: and ATTN: status messages on the LCD's top line.

[3] The Attn. Profile menu includes some pre-defined attenuators that are characterized for all five RF bands. The  *USER DEFINED* profile uses flashed data values that are  defined (by you) in the config.h's SER_ATT_PROFILE[ ] array. Lastly, the Custom profile allows you to manually enter a fixed attenuator value using the Keypad. To edit the Custom entry begin by pressing the Right (Edit Attn Value) Key. This will turn on the custom attenuator edit mode.

[4] The main RF power mode uses data averaging. It's the recommended mode for measuring analog RF power (typical FPV vTx). In case you are interested, data is sampled at 200Hz and 200 rolling values are collected for averaging.

[5] The Instant Power mode is for Instantaneous (non-averaged) measurements.  This is the recommended mode for measuring digitally modulated RF signals (Wi-Fi FPV and long range UHF R/C). Keep in mind that digital signals aren't continuous RF so reliable measurements are difficult to achieve. The display is limited to a 5Hz update rate for legibility.

[6] The Min / Max Power measurements are held in a rolling buffer that automatically resets after 10 seconds.  Or you can manually reset the buffer at any time by pressing the Enter Key.

 

Share this post


Link to post
Share on other sites

Well, that about wraps this project up. I think you'll find it to be a good performing meter that can be built at a bargain price.

If you build the DiY RF Power Meter then please share your feedback and/or improvements. If you have any technical questions then post them here in the public forum so that others can learn too.

Share this post


Link to post
Share on other sites

Joost's Arduino program is simple and a good starting platform for doing your own thing.  I came across his work a couple months ago and noticed the last activity was back in 2015. But a few days ago he released a new firmware version, so his project is still alive. Maybe there's something new in it that will help your development.

Share this post


Link to post
Share on other sites

Yes he released an updated firmware which includes calibration.

When i tried to compile his firmware, im having error in his library so i just rewrite the program and select only what i want to use.some more i add the Rtadj which make it more accurate.

Yes you are correct his concept is easy to follow, we exchanges email and i learned a lot from him.

The main equation that he only used was the slope formula. 

Share this post


Link to post
Share on other sites

I like this project. I'm glad part of my code is used.

It might be a good idea to add an optional second log detector to do continuous vswr measurements without switching the input and output of the directional coupler.

You might want to copy the changes I made for calibration and faster/more measurements of the adc. If you have got any questions about the code feel free to contact me. But you already know that of coarse.

I got some email from people who want to have vswr functionality with my piwer meter. I'll refer them to this page.

Regards Joost

Share this post


Link to post
Share on other sites

@Joost, Thanks for stopping by! It's great to see that your RF meter project is still active.  When I have some spare time I'll have a look at your new firmware release.

Please feel free to adapt my VSWR code feature in your meter project.

 

Share this post


Link to post
Share on other sites

Hi guys,

Im a bit confuse with this RF attenuator, lets say i have 30db 2watt attenuator and i want to use it to my 400mw video Tx, then i assume that my 400mw vtx is equivalent to 26dbm based from the calculator, then what would be my expected output power from my vtx after i use the rf attenuator?

How can i translate this to equation?

thanks.

 

Share this post


Link to post
Share on other sites

When dealing with dBm you can add and subtract those values. So the output of the attenuator will be 26dBm-30dB=-4dBm. Be aware that -4dBm is outside the linear range of the chip used in the RF meter. According to the datasheet you will have +0.2dB error when using the AD8317. Its best to stay within the -10dbm to -50dBm range. So an attenuator of 40dBm or higher is advised.

You can also use 2 attenuators in series. Then you can add those attenuation values together. If you use a 30dB and a 20dB attenuator in series then the total attenuation will be 50dB. The power at the input of the power meter will be 26dBm-50dB = -24dBm. If you enter an attenuation of 50dB in the meter it will display 26dBm of coarse. That way you will not have to do the calculations yourself.

Share this post


Link to post
Share on other sites

I expect that simply adding another attenuator will introduce an error that overbears the sensor datasheet's 0.2dB. Instead, for FPV hobby measurements I would accept the 1dB error that a AD8317 may have with the -4dBm input since I think it would be the lesser of two evils. Also, this larger error span conforms to the manufacturer's advertised ±1dB error (over 55 dB range) specification.

But as JoostB stated, the data sheet shows the error can be reduced to ±0.2dB by limiting the input level. But to achieve that low error the measurement system cannot default to the data sheet's -22mV/dB typical Slope value. Both Slope and Intercept values would need to be precisely determined for each RF band using a lab quality RF signal source.

By the way, the meter project discussed here uses the AD8318 sensor (the AD8317 is supported, but is not used). The AD8318 chip can tolerate a slightly higher input level than the AD8317. For example, the -4dBm signal level from your 5.8G 400mW vTx would have ~0.2dB typical error on a AD8318.  So if your home brew meter is using the AD8318 then a high quality 30dB attenuator would be fine to use with the 400mw vTx .

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×