Jump to content

Recommended Posts

Version 2.1 firmware has been released. Get it here: Click Me!

V2.1 adds a Mini-Circuits BW-S40W2+ 40dB attenuator to the Attn profile list. This affordable attenuator (~$35 USD) has good accuracy on all FPV RF bands. But more importantly, it extends the DiY RF Meter's maximum allowed power level so it can handle all FVP transmitters (even a high powered vTx). It can be purchased directly from MiniCircuits.com and occasionally one will show up on eBay too.

 

Share this post


Link to post
Share on other sites

I have tried to compile Ver2.1 RF_Power_Meter and I get the following error messages,

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino:31:0:

sketch\config.h:94:62: warning: missing terminating ' character

   #error ***** INCORRECT LOG DETECTOR DEFINE IN CONFIG.H (Can't use both devices at same time)! *****

                                                              ^

sketch\config.h:98:62: warning: missing terminating ' character

   #error ***** INCORRECT LOG DETECTOR DEFINE IN CONFIG.H (Can't use both devices at same time)! *****

                                                              ^

C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino: In function 'int ReadLCD_Buttons()':

RF_Power_Meter:519: error: return-statement with no value, in function returning 'int' [-fpermissive]

     return;

     ^

C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino: In function 'byte getAmountDigits(int)':

RF_Power_Meter:1499: error: return-statement with no value, in function returning 'byte {aka unsigned char}' [-fpermissive]

     return;

     ^

Multiple libraries were found for "LiquidCrystal.h"
 Used: C:\Program Files (x86)\Arduino\libraries\LiquidCrystal
 Not used: C:\Users\David\Documents\Arduino\libraries\NewliquidCrystal
exit status 1
return-statement with no value, in function returning 'int' [-fpermissive]

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


I am not an experienced Arduino programmer and would value some asistance;I have ordered the hardware to build this project.It looks very useful. Thanks,David

Share this post


Link to post
Share on other sites

The " INCORRECT LOG DETECTOR DEFINE IN CONFIG.H (Can't use both devices at same time)!" error means you have compiled with both log detector IC types enabled at the same time. You must choose either AD8318 or AD8317.  This choice is made in the config.h file.

I recommend choosing the AD8318 that was used in my project. Here is how the code would look in config.h for that sensor chip (find the text snippet and edit it to look like this):
// #define DEVICE_AD8317
#define DEVICE_AD8318 

Fix that and then report back the errors (if any) that are posted after a recompile. This should clear up most (or all) of the compiler errors.

It seems like you are not using Arduino Ver 1.8.1, so I may need to fix the " return-statement with no value" error for your version.

Share this post


Link to post
Share on other sites

Thank you for your speedy reply. I am using Arduino ver 1.8.1 and have the #define DEVICE_AD8317commented out at the start of the config.h file

error messages are

Arduino: 1.8.1 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino:31:0:

sketch\config.h:94:62: warning: missing terminating ' character

   #error ***** INCORRECT LOG DETECTOR DEFINE IN CONFIG.H (Can't use both devices at same time)! *****

                                                              ^

sketch\config.h:98:62: warning: missing terminating ' character

   #error ***** INCORRECT LOG DETECTOR DEFINE IN CONFIG.H (Can't use both devices at same time)! *****

                                                              ^

C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino: In function 'int ReadLCD_Buttons()':

RF_Power_Meter:519: error: return-statement with no value, in function returning 'int' [-fpermissive]

     return;

     ^

C:\Users\David\Documents\Arduino\RF_Power_Meter\RF_Power_Meter.ino: In function 'byte getAmountDigits(int)':

RF_Power_Meter:1499: error: return-statement with no value, in function returning 'byte {aka unsigned char}' [-fpermissive]

     return;

 


exit status 1
return-statement with no value, in function returning 'int' [-fpermissive]

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Sorry to trouble you again.Best wishes,David

Share this post


Link to post
Share on other sites

My apologies. This was a head scratcher since my Arduino V1.8.1. IDE does not show those compiler warnings. I had to do a fresh Arduino 1.8.1 install on another Win10 PC in order to see them.

I have posted a new version (V2.2) for you to try. Please download it and report back on the outcome of your recompile.

 

Share this post


Link to post
Share on other sites

Hallo, is it possible to ad an battery guard for field operation  in this lovely arduino projekt for  6,1 oder 6,2 Volt für 2S lion, on the  unused ad- a3 or a4

Voltage 6 to 6,1  blinking charging ??? or so ?

this arduno code works very well  - for battery ""in field operation"" i  missed this option for saver  battery operation

Edited by Pit
repair .. hi

Share this post


Link to post
Share on other sites

The operating voltage should be 7V - 13V. Lower voltage would be unreliable; For example, at <7.0V the LCD will probably not work correctly.

The published design is intended to be simple/minimal for a quick & easy build. So the project does not have a battery saver/monitor feature. There's plenty of free code space and some unused I/O pins, so feel free to add any feature you need.

 

Share this post


Link to post
Share on other sites

Hi Mr. RC-Cam,

 

Many thanks for sharing this great project!

I'm very interested in this project and wonder if I can use it for test output power of my HF rig (100W PEP output) - guess 60dB attn will be ok.

Also can I use it for VSWR measurements on my current HF antennas for a rought estimative of VSWR in HF bands?

 

 

thank you

Share this post


Link to post
Share on other sites

The existing code supports 60dB attenuators.

For rough VSWR estimates the 433MHz setting should work OK (despite the extreme RF difference). But if you should ever need to make accurate absolute RF power measurements then you'll need to dig-in and modify the code for the HF band's dramatically lower frequencies.

Share this post


Link to post
Share on other sites

My objective is to do measurements on 70cm band, 23cm band and HF bands. Measurements regarding output power and, later on, VSWR.

Do you think that for a rough estimate, it will be adequate building this DIY RF Power unit? Measurements don't need to be precise, it is just to have an order of magnitude of the output power and VSWR.

I can try to modify the code at a later stage as I have already programmed in arduino...

Share this post


Link to post
Share on other sites

The meter is targeted for FPV hobby applications so it certainly supports the 23cm (1.2/1.3GHz) and 70cm (433mHz). But it omits the HF band (<30MHz) since FPV'ers don't use it.

There's a chance you can cheat and use the 433MHz mode for HF power measurements. But I have no idea how accurate it would be since the cal data for 70cm/433MHz would be different compared to the HF band cal data. Maybe results would be good enough for you, or maybe not.

The AD8318 sensor covers 1MHz to 8GHz. Adding a new frequency range not currently supported by the firmware would require Arduino coding. Hardware would remain the same.

 

Share this post


Link to post
Share on other sites

hello mr.rc-cam,

Would i be able to use the meter to measure RC TX output power- such as EZUHF module (433 mhz). So far it seems like the meter is primarily meant for VTXes.

Also, is there any other way of calibrating it w/o using another reference meter. The primary reason i am considering this build is that i don't want to spend $150 on iRC and i dont' know anyone owning it. Perhaps another rated transmitter with a known power output.

My goal is to validate the output power of EXUHZ JR TX which is giving me some range troubles.

 

thanks - great project BTW,

maciek

Share this post


Link to post
Share on other sites
Quote

Would i be able to use the meter to measure RC TX output power- such as EZUHF module (433 mhz).

The AD8318 sensor has fast response so it can handle most digital modulation schemes. Due to the UHF R/C's modulation duty cycle I suggest using the meter's Max Power mode.

But I don't have a EZUHF so I can't confirm the measurement performance. But if other RF meters can accurately measure the EZUHF then this meter should be fine too.
 

Quote

Also, is there any other way of calibrating it w/o using another reference meter. <snip> Perhaps another rated transmitter with a known power output.

The alternate method is to use a calibrated RF source & accurate attenuator. It's rare to have these things laying around that can be trusted for the task.

 

Share this post


Link to post
Share on other sites

I've done all the steps mentioned but I got this error message: OVERLOAD WARNING, Disconnect now! and Hardware problem, RF sensor: FAILS

I'm using AD8318 and v2.2

I've not yet tried to connect it to any transmitter.

Any tips?

 

Thank you

Share this post


Link to post
Share on other sites

Hi HF_ATL,

Pleas check the reference voltage and the voltage on A1. If the reference voltage is OK then there might be something not connected of short circuit. The voltage on A1 should be around 2V when no signal is connected.

Joost

Share this post


Link to post
Share on other sites

If JoostB's advice does not get you going then we'll need to know a few things. For example:

1. What exactly are you using to power the meter? 

2. What is the measured voltage on the Arduino's VIN pin? This is the pin that supplies power to the AD8313 board.

3. Do the five keypad buttons work correctly?

Keep in mind that the meter will give you that warning if you try to use it while powered by the USB port. That is to say, an external power source must be connected to the DC Input (barrel plug jack) on the Arduino board. I recommend using 12VDC (3S LiPO battery).

Share this post


Link to post
Share on other sites

Dear Mr. Joost and Mr. RC-Cam,

 

Many thanks for the quick reply and support!

Voltage on A1 pin is 2.1V when no signal is connected.

That problem is solved... Both of you nailed it exactly! Apparently it was due to a power supply issue. I just used another 12V source with bigger amp capacity (1A) and now that error message has gone. The LCD backlight must be consuming a lot. The voltage drop is around 0.8V from the supply voltage unconnected to VIN pin.

However another issue occurred: The select button on the keypad doesn't work. I used the serial port to get the analogread of the A0 to view the values as I pressed all the keys. I noticed that the values used on the code don't suit my situation. I used this line of code: "Serial.println(adc_key_in);" to get those values on Serial monitor. Even changing the values for the new ones the select button doesn't work.

The values I get are:

Select button pressed: 1012

Left button pressed: 774

Right button pressed: 10

Up button pressed: 263

Down button pressed: 561

None button pressed: 1023

 

Best regards,

JF

 

Edited by HF_ATL

Share this post


Link to post
Share on other sites

All of your button values are too high. Confirm that you have installed the correct resistor value (3.3K) on pin A0 (see image below).

BTW, does the artwork of your LCD Keypad board match the image below? If it is different in any way then the A0 resistor value may need to be altered.

PCB_Stack1_1200.jpg

Share this post


Link to post
Share on other sites

Before we do any tinkering please verify A0's 3.3K ohm resistor value again.

Your photo's colors might be deceiving me, but it appears that the A0 resistor's color code is ORG/ORG/BLK/VIO/VIO. That would be an incorrect value (3.3G ohms).

Share this post


Link to post
Share on other sites

I confirm that the resistor placed between A0 and gnd pin is correct. I have just measured 3.29kOhm with my multimeter (one terminal of the resistor disconnected to properly measure the resistor value).

With the resistor connected I measured 1.41kOhm between A0 and gnd.

Edited by HF_ATL

Share this post


Link to post
Share on other sites
Quote

I confirm that the resistor placed between A0 and gnd pin is correct.

Thanks for checking the 3.3K resistor.

 

Quote

With the resistor connected I measured 1.41kOhm between A0 and gnd.

Mine measures 1.82K ohms between A0 and GND (with 3.3K installed). So that means your LCD Keyboard Shield has different keypad summing resistors on it. The workaround will require changing your 3.3K A0 resistor value.

Begin with a 2.7K ohms instead of the 3.3K. Then report back the button values using your "Serial.println(adc_key_in);" debugging code. This will allow me to confirm we're on the right path.

Share this post


Link to post
Share on other sites

Thanks for your support Mr. RC-CAM!

With a 2.7kOhm connected between A0 and gnd pin I measured:

Select button pressed: 940

Left button pressed: 736

Right button pressed: 10

Up button pressed: 258

Down button pressed: 542

None button pressed: 1023

 

With the 2.7 KOhm resistor installed I now get 1.29Kohm between A0 and gnd pin.

Edited by HF_ATL

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...