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.

35 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
  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
  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
  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
    2. share with me sir for schematic and firmware or source code.
      thanks

      Delete
    3. can you share with me for sketch?
      thanks

      Delete
  11. Dear...LB0MG...thanks for all ....

    ReplyDelete
  12. Dear LB0MG
    Your design looks neat and compact.
    Can you please share me the schematic PCB fabrication file and the arduino code so that I can make one for my self and also for the club

    best regards

    VU3RQX

    ReplyDelete
    Replies
    1. request you to email to me at gaurav.mahesho@gmail.com
      PCB Gerber or eagle file would be really helpful

      Delete
  13. Tony,

    counld you send me the schematic for your SWR/Pwr meter the one shown
    on the web article is impossible to read components and values

    thank you
    Tim KQ4TQ
    tpglennon1@gmail.com

    ReplyDelete
  14. Is there a BOM for this? A lot of values are on the schematic, but not all. Just received the PCB, looking forward to putting it together!

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

    ReplyDelete
  16. are C1, C9 D3, D5, D6 critical values?
    I am guessing the diodes can by D3 1n4001 nd D5/D6 1n4148.. and the caps "bypass" types of 0.1uf?

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

    ReplyDelete
  18. Hello Jeremy Lareto (and other interested parties)
    have a look at this BOM for digikey.
    I tried to make it sharable.

    If Joakim replies with more info, I will try to update the list...
    https://www.digikey.com/en/mylists/list/QJQSN049PR
    let me know if its not viewable...

    I added the parts for C1, C9, D3, D5, D6.
    C1 and C9 are 0.1uf (same as C2, C19, etc... as they are power bypas caps.
    D3, D5, D6 are protection deiodes, so thye can be just rectifier types..my choice might not be optimal, but they should be fine.

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

    73's PP5RG Richard pp5rg@yahoo.com

    ReplyDelete
  20. Dear Joakim !

    Hopefully do you read my post....
    Long time ago, when you posted it !

    I would like to remake your SWR meter ....
    Please send me the eagle files so that it is easier for me to order a board.
    tscharly33@gmail.com

    TU, 73, Karl OE3JAG

    ReplyDelete
  21. apakah anda bisa berbagi dengan saya?
    briker.fm2019@gmail.com
    regard 73-88

    ReplyDelete
  22. interest.
    i'm from indonesia.
    can you share with me for schematic and firmware?
    thanks
    73 YD1HDD

    ReplyDelete
  23. Hi, I tried to download the file using the link provided (/diycrapfiles/files/SWRmetershare.zip), but it says site not found.

    ReplyDelete
  24. Hi, I'm interested in the swr power meter, can you share with me the firmware (link not working). coskunmuti@gmail.com

    ReplyDelete
  25. Hi! Link with code are dead. Can you refresh or send it to me please sp9adc@gmail.com

    ReplyDelete