Saturday, December 5, 2015

Homebrew SWR and power meter

First of all, this SWR meter in this article is not exactly homebrew, as I based the circuit on the schematic in the excellent book Arduino Projects of Amateur Radio. Although I bought the book and respect the copyright of the authors I will share my own schematic here. Why? First, the design in the book is not completely original and is based on similar designs from others. One example here.  Second, I changed a few things, removed some stuff,  and added some other things, to my own liking, so the design is not identical anymore.


The circuit is based on two AD8307 log amplifiers, which are connected to the forward and reflected ports on a directional coupler.  The AD8307 amplifiers gives a DC voltage of about 25mV/dB of the input signal, which is amplified using an opamp (LM324). The opamp also provides the reference voltage to the Arduino (AREF) to ensure that the full ranges of the A/D converters are used.


I used the fourth opamp in the quad LM324 to provide input voltage reading. That is why the PCB in the picture has two power jacks. One input and one output. That way I know the drive voltage for the radio. I primary plan to use this device for my Softrock.


I created the schematic and the board in Eagle, and submitted the gerbers to Elecrow. I received 10 PCBs after about 25 days.


The board is not much larger than a standard 20x4 LCD.


I choose to use an Arduino nano rather than populating a AVR328 on the board and messing with USB converters. I am glad I did. I did one mistake on the board however. The Arduino was not powered from the 5V rail. The problem was that it was an error on the Eagle footprint for the Arduino Nano. I just downloaded the footprint file uncritically from the Internet without checking it. Other than that, It was fine.


Another problem was that I got oscillations on the LM324 opamps connected to the AD8307. The oscillations were around 40KHz and about 400mVpp on top of the DC signal. Hence it was impossible to calibrate the device. The solution was to desolder the output capacitors on the LM324. I do not think they are really needed on a DC design.


This was my first SMT design, and I am fairly happy with the result. The SWR and the power measurements seems accurate. I used the Arduino software from the book, and modified it to include a larger display and some other things. As you may notice, there are no buttons on the device. Originally I planned to use a rotary encoder and a bunch of menus, but as they say in the Soldersmoke podcast, menus are for restaurants. I totally agree. Besides, programming all kinds of features to the device is totally insane. This is a simple SWR meter and thats it. 

The files are available here, should you be interested. Note that there is an error in the schematic. The Arduino is missing +5V, but it should be easy to fix.

18 comments:

  1. Dear LB0MG ,I will to DIY the SWR Meter that you posted on you blog ,can you supply me the codes of the Arduino that you modified .

    My E-mail.:szleyea@gmail.com


    VY 73!

    BH4SQE /Tony

    ReplyDelete
  2. if possible can you send me the EAGLE file.

    TKS

    ReplyDelete
    Replies
    1. Thanks for your interest. You got mail...

      Delete
  3. Hi LBOMG I'm very interested in the swr power meter
    Can you supply met with the code, schematic and board plans

    73's ON7FL Fred fleijnen@skynet.be

    ReplyDelete
    Replies
    1. Thanks for your interest. You got mail.

      Delete
  4. hi, I also interesed in this project, can you supply me all data? schematic, code, eagle files? thanks in advance:
    EA4EAR Javier. palomaroja@yahoo.com

    ReplyDelete
    Replies
    1. The blog post is now updated. The link to the files is now at the bottom of the post. Good luck. Please tell me how it goes for you.

      Delete
  5. Hi, I'm very interested in the swr power meter, can you supply met with the code. Thanks in advance
    largosoftar@yahoo.com.ar

    ReplyDelete
    Replies
    1. The blog post is now updated. The link to the files is now at the bottom of the post. Good luck. Please tell me how it goes for you.

      Delete
  6. Hi LBOMG I'm very interested in the swr power meter
    Can you supply met with the code, schematic and board plans

    73's OK1MAE Zdenek zsach@seznam.cz

    ReplyDelete
    Replies
    1. The blog post is now updated. The link to the files is now at the bottom of the post. Good luck. Please tell me how it goes for you.

      Delete
  7. Checked the archive and the Eagle files are missing, everything else is there... Please drop me a mail with the Eagle files.

    ReplyDelete
    Replies
    1. Thanks for telling me. It is fixed.

      Delete
  8. hello LB0MG,
    can you give me an update your scketch for 5KW power, please
    my email: es45101@gmail.com
    very appreciated for your help
    thanks

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. hello LB0MG,

    If I have use the 30dB directional coupler and 20dB att

    In the sketch where I need to modify

    Here ?

    #define FORWARDPOWERONE 0.31 // Forward power at max reading
    #define FORWARDANALOGONE 782 // Analog value at max forward
    #define FORWARDPOWERTWO .00094178 // Forward power at second reading
    #define FORWARDANALOGTWO 544 // Analog value at second forward
    #define REFLECTEDPOWERONE 0.31 // Reflected power at max reading
    #define REFLECTEDANALOGONE 772 // Analog value at max refelected
    #define REFLECTEDPOWERTWO .00094178 // Refelected power at second reading
    #define REFLECTEDANALOGTWO 535 // Analog vale at second reflected

    Wait you answer

    ReplyDelete
    Replies
    1. Hi. All those defines can be calibrated using the code from the book Arduino Projects of Amateur Radio. If i remember correctly, the code is found on the internet.

      Delete