Jump to content

Recommended Posts

Those values show we are on the right path. But the key press values are still a bit high.

Replace the 2.7K ohm with a 2.2K and report all the key press debug values again.

 

Share this post


Link to post
Share on other sites

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

Select button pressed: 884

Left button pressed: 697

Right button pressed: 10

Up button pressed: 252

Down button pressed: 520

None button pressed: 1023

 

With the 2.2 KOhm resistor installed I now get 1.16Kohm between A0 and gnd pin.

Edited by HF_ATL

Share this post


Link to post
Share on other sites

Almost there. Try a 1.5K and report the debug values.

With the 1.5K installed, please measure the A0 voltage when no buttons are pressed and also when the select button is pressed.

 

Share this post


Link to post
Share on other sites

With a 1.48 KOhm connected between A0 and gnd pin I measured:

Select button pressed: 744

Left button pressed: 611

Right button pressed: 10

Up button pressed: 241

Down button pressed: 470

None button pressed: 871

 

With the 1.48 KOhm resistor installed I now get 0.93 Kohm between A0 and gnd pin.

Share this post


Link to post
Share on other sites

I measured:

A0 voltage when no buttons are pressed: 2.11V

A0 voltage when select button is pressed: 1.80V

 

Measurements done with the 1.48KOhm resistor.

Share this post


Link to post
Share on other sites

 

Quote

I measured:

A0 voltage when no buttons are pressed: 2.11V

A0 voltage when select button is pressed: 1.80V

The voltages and key press values are now a bit too low. Increase the resistor value a small amount (try ~1.8K).

Ideally the A0 voltage with no button pressed will be 2.45V - 2.50V with a "None" key press value between 1015 and 1023.  With the Select button pressed you should see about 2.0V.  Get as close to these voltages as practical then report all the key press debug values.

Important: Never power the meter without the A0 resistor installed.

 

Share this post


Link to post
Share on other sites

With a 1.99 KOhm connected between A0 and gnd pin I measured:

Select button pressed: 846

Left button pressed: 677

Right button pressed: 10

Up button pressed: 251

Down button pressed: 509

None button pressed: 1020

 

With the 1.99 KOhm resistor installed I now get 1.10 Kohm between A0 and gnd pin.

Share this post


Link to post
Share on other sites

I measured:

A0 voltage when no buttons are pressed: 2.47V

A0 voltage when select button is pressed: 2.05V

 

Measurements done with the 1.99KOhm resistor.

Share this post


Link to post
Share on other sites
Quote

I guess now the values are acceptable enough?

The 2K ohm (1.99K) resistor is a good A0 choice for your LCD shield. Now the various key press codes will need to be re-mapped.

In the RF_Power_Meter.ino file, go to the ReadLCD_Buttons function (starts at line 435).

Replace the adc_key_in code section (from lines 486 to 506) with this revised snippet:

    if (adc_key_in > 1000) {
        kybd = btnNONE;
    }
    else if (adc_key_in < 50)  {
      kybd = btnRIGHT;  
    }
    else if (adc_key_in < 265)  {
        kybd = btnUP; 
    }
    else if (adc_key_in < 525) {
        kybd = btnDOWN;
    }
    else if (adc_key_in < 690) {
      kybd = btnLEFT;
    }
    else if (adc_key_in < 865) {
        kybd = btnSELECT;  
    }
    else {
        kybd = btnNONE;
    }
    


 Upload code then check all the button functions. Hopefully you are rewarded with button press happiness.

EDIT: Beginning with firmware V2.3 this alternate key press code can be selected in the config.h file. Choose LCD_SHIELD_ALT1  to enable it.

Edited by Mr.RC-Cam
Updated Keypress firmware now in V2.3.

Share this post


Link to post
Share on other sites

It works as expected! Many thanks for all your support, really appreciated! 

I have already configured successfully the attn profile for my 30.3db attenuator. I get around -67dbm/-68dbm with nothing connected to the SMA input.

Unfortunately I don't have here at the moment a 1.3GHz transmitter to test but I'll come back here and post my results for sure. Wonderful work Mr. Thomas and Mr. Joost!

Share this post


Link to post
Share on other sites
Quote

It works as expected ...

You are welcome. Thanks for letting me know the keypad is working now.

I should add a note to the docs about the changes for your LCD/Keypad shield. Is there a Chinese manufacturer's name or unique ID printed on your DFRobot clone shield so it can be identified by other project builders?

 

Quote

I have already configured successfully the attn profile for my 30.3db attenuator. I get around -67dbm/-68dbm with nothing connected to the SMA input.

That's a sane/reasonable value with nothing connected to the SMA. It should be fine for VSWR only measurements. But a calibration will be required for accurate RF power measurements .

 

Share this post


Link to post
Share on other sites
22 hours ago, Mr.RC-Cam said:

You are welcome. Thanks for letting me know the keypad is working now.

I should add a note to the docs about the changes for your LCD/Keypad shield. Is there a Chinese manufacturer's name or unique ID printed on your DFRobot clone shield so it can be identified by other project builders?

 

That's a sane/reasonable value with nothing connected to the SMA. It should be fine for VSWR only measurements. But a calibration will be required for accurate RF power measurements .

 

I have purchased this item in ebay about 1 year ago. All I can see it says is: "LCD Keypad Shield, Drive the Future". The best would be for users to check what you said to me: "Ideally the A0 voltage with no button pressed will be 2.45V - 2.50V. With the Select button pressed you should see about 2.0V". I guess this is a good starting point to check for possible keypad issues. 

I still need a directional coupler (not yet purchased) as I'm always looking for a good used one for a good price. Calibration probably will be left as it is unfortunately as I don't have access to any equipment for verify the results.

Edited by HF_ATL

Share this post


Link to post
Share on other sites
Quote

The best would be for users to check what you said to me: "Ideally the A0 voltage with no button pressed will be 2.45V - 2.50V. With the Select button pressed you should see about 2.0V". I guess this is a good starting point to check for possible keypad issues. 

I suppose that is the best we can do for now.

Given the random nature of the Chinese boards I expect the LCD-Keyboard shield compatibility issue will pop up again. To be proactive about this I have released a new version of the firmware (V2.3).  It is posted here:
https://www.rc-cam.com/forum/index.php?/topic/4139-diy-rf-power-vswr-meter-low-cost/&do=findComment&comment=29002

There's now a keyboard debug function. It will display the key-press code value when each menu button is pressed. The feature is enabled via the config.h file using DEBUG_KYBD found under the Troubleshooting section. What does it do? For those that need help solving keyboard compatibility problems: Enable DEBUG_KYBD in config.h, re-flash the firmware and then report the five keypress code values shown on the LCD. When posting for help be sure to include the two A0 voltage values mentioned earlier.

Also, the config.h file now supports an alternate LCD/Keyboard shield. Currently there's two choices, my DFRobot branded board (LCD_SHIELD_DFR) and the clone used by HF_ATL (LCD_SHIELD_ALT1). The shield choice is made by enabling LCD_SHIELD_DFR or LCD_SHIELD_ALT1 found under the LCD/Keyboard Shield Type section.

 

Share this post


Link to post
Share on other sites
3 hours ago, Mr.RC-Cam said:

I suppose that is the best we can do for now.

Given the random nature of the Chinese boards I expect the LCD-Keyboard shield compatibility issue will pop up again. To be proactive about this I have released a new version of the firmware (V2.3).  It is posted here:
https://www.rc-cam.com/forum/index.php?/topic/4139-diy-rf-power-vswr-meter-low-cost/&do=findComment&comment=29002

There's now a keyboard debug function. It will display the key-press code value when each menu button is pressed. The feature is enabled via the config.h file using DEBUG_KYBD found under the Troubleshooting section. What does it do? For those that need help solving keyboard compatibility problems: Enable DEBUG_KYBD in config.h, re-flash the firmware and then report the five keypress code values shown on the LCD. When posting for help be sure to include the two A0 voltage values mentioned earlier.

Also, the config.h file now supports an alternate LCD/Keyboard shield. Currently there's two choices, my DFRobot branded board (LCD_SHIELD_DFR) and the clone used by HF_ATL (LCD_SHIELD_ALT1). The shield choice is made by enabling LCD_SHIELD_DFR or LCD_SHIELD_ALT1 found under the LCD/Keyboard Shield Type section.

 

Very quick and professional way to address that this issue can happen again. Can't get better than this!

Very proud of your awesome work Mr. Thomas!

Share this post


Link to post
Share on other sites

Thank you for the kind words. Your technical assistance was extremely helpful in identifying the LCD Keyboard problem, so it was a joint effort.

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

×