PHSNA with an Arduino

IMAG0753

Article pdf en Francais ici

What is a PHSNA?

This comes from the term « Poor Ham’s Scalar Network Analyzer » It is just a sheap antenna analyser.

PHSNA Features :

  • Analysis band: 1 to 30Mhz
  • Ad9850 or AD9851
  • Arduino UNO
  • Remote Display: autonomous mode (optional not yet developed)
  • Wheatstone bridge measurement coupled with an AD8307
  • 1206 CMS Components (Ebay Listing here Bill Of Materials For phsarduino)
  • Cost between 20 € and 30 €

PCBs are available, if you are interested, send me an email :

f4goh  at orange.fr

(8.5€ including shipping to France, 11€ international)

Now, PCB are available with SMT mounted, connectors, era2sm.

smt

 

1 Introduction

It’s been a long time since I wanted to try this scalar analyser. Indeed there are many descriptions on Internet and various schematics like this article.

Most of the time, the results of this analyzer are displayed on an LCD screen and does not have communication with PC software.

I wanted to overcome this disadvantage by using the AntScope software for Rigexpert analyzers while having the possibility of operating in Autonomous mode.

2 Schematics description

phsarduino

The Arduino drives an ad9850/51 programmable oscillator. The output signal is then amplified by a MMIC SGA3486. Then after attenuation, the sinusoidal signal attacks a Wheatstone bridge used in many different and varied electronic stuffs.

The differential voltage from the bridge is injected into a logarithmic amplifier AD8307. The output Vout of the AD8307, continuous is converted by Arduino ‘s 10 – bit internal ADC. The reference voltage of the ADC is delivered by a LM385Z-2.5V regulator on the AREF input,

With this continuous voltage, the arduino calculates what is called the « return loss » (RL) then deduces the « Rho (Reflection coefficient magnitude) » and finally the SWR

It will remain a last calculation to perform, Rs, the equivalent resistance of the antenna. Indeed, the AntScope software protocol needs two parameters:

– Rs – Resistance, series form

– Xs – Reactance, series form

Rs is calculated by the arduino, but Xs is not possible to calculate with this scalar antenna which does not determine the phase. This parameter always remains at zero.

This is why we call this montage: Poor Ham’s Scalar Network Analyzer, since the phase is not used compared to a vector network analyze that gives more informations, but little more expensive to build on HF bands.

An HF VNA has already been published here:

https://hamprojects.wordpress.com/2016/02/21/hf-arduino-vna-english-version/

However to made wired RF antennas, the PHSNA will do the job as well for an cheap price.


3 Assembly and tests:

You will find here in the ZIP all the PCBs, implementation of the components and the software.

github

pcb

The assembly does have any problem. Start by soldering the SMD resistors as well as the 1206 format capacitors. Continue the SMD implementation with 2 inductors and ad8307.

Finish the SMD by the LED face up. (at the edge of the map on the AD9850 side)

If you do not know how to weld CMS by hand without reflow oven, watch this demonstration.

 

 

Then solder the LM385Z-2.5V, C9 capacitor and connectors.

IMAG0755
I forgot LM385 on this picture. This error has been corrected

Perform a non-continuity test between the VCC and the Ground before turning on the Arduino, it’s safer.

Note about the amplifier

Depending on your supply, you can change the reference and R1 polarization resistance.

MMIC Amplifier R1 Résistor (ohms)
sga3486 68
msa0386 (my configuration on board) 10
sga3386 68
era2sm 33

4 The software :

In order to facilitate the programming, I directly provided the HEX file to be programmed in the arduino UNO.

PHSNA_F4GOH_UNO.HEX

Depending on your DDS choose the right configuration

If you are using an AD9850, leave the J1 strap open

If you are using an AD9851, solder a bridge on the J1 strap

Put a strap on J6 (pin 2-3) this is for AD98850 RESET PIN connection

The programming is done via the Xloader software provided in the ZIP mentioned above.

xloader

Remember to program the arduino UNO WITHOUT the sheild (PHSNA card) disconnected. You never know what he had as a program in the ARDUINO UNO, (new or already used?)

If the drivers are not recognized, install the Arduino IDE environment because the drivers are contained in the program, unless you use a Arduino « Chinese clone ». There is a good chance that they are CH340 / 341 drivers. Fortunately, you will find these drivers in the ZIP.

if you don’t know how to install CH340 Drivers watch this video

 

To find COM port number, take a look at peripheral manager

peripherals


5 First start

Insert the PHSNA card on the Arduino. Power on the unit with a USB type A-B cord. The red power LED on the AD9850 should light up. Check the voltage at the terminals read LM385Z (2.5V)

6 Calibration

Start a serial terminal software (eg Hterm). Set the port as shown on the screenshot below.

calibration

Without connecting a 50 ohm load or an antenna, enter « cal » and enter

The aduino makes a measurement of 1 to 30Mhz. Then save the calibration value in its internal EEPROM memory. Its value should be between 100 and 200 depending on the amplifier mounted on the card.


7 Using AntScope

If you are interested in the serial communication protocol, know that it is open and available at the following address.

Rig expert protocol

Download the AntScope software, and follow the following screenshots in order.

01_Intro
Warning at start up, that’s ok
02_Config
The Arduino program emulates the AA-30.ZERO analyzer . Select good COM port number

 

03_Config
Beware, that’s Khz

 

The software help is here, but a bit light.

Be careful, the options will be limited with the PHSNA.

It will be necessary to be satisfied with the Measurement menu in order to obtain the SWR curve and it is what we want. D1 Led blink during scan.

I compared the PHSNA plot with a miniVnaPro from mini radio solutions

7Mhz
The SWR curves are similar.

8 JNA software

It will be possible to use PHSNA with jnva software (experimental firmware)

the trik is to make believe that jna use an ad8302 while it is a ad8307

  • First PHSNA need to be calibrate with PHSNA_F4GOH_UNO.hex (like using antscope software  : part 6) Calibration value is stored on internal EEPROM
  • then upload phsnarduino_jvna.hex file with xloader
  • launch jnva and select VnArduino. In calibration menu select right frequency as your dds
  • ad9850 : 34359738
  • ad9851 : 23860477
  • make open calibration as jnva required
jvna phsna
JVNA frequency calibration for ad9850
compare csv phsna
MiniVNApro and PHSNA compare Curves with my 40m dipole antenna

9 Troubleshooting

It will be necessary to check that the signal delivered on amplifier output is sinusoidal.

To do this, launch Antscope software, then in the menu Measurement click on RF on / off The frequency must be 10Mhz,

test

The output voltage must be clean (see screenshot below). In case of distortion, check the ad9850 output signal  and amplifier output.

power_rf output

open
OPEN DUT
charge
DUT with 50 ohms dummy load

10 Conclusion

This small HF analyzer will do a good job in your radio shack. Mounting is easy to build and components are available on Ebay or Alliexpress. I would like to add an ESP8266 interface (WIFI server) to view the SWR curve on the Smartphone

Screenshot_2017-09-24-19-15-29

73 and see you next time.

Anthony


OMs PHSNA

 

F1TZM
FD 4 Antenna measurement. PHSNA is an excellent complementary product to the MFJ. F1TZM
PHSNA with an Arduino

13 réflexions sur “PHSNA with an Arduino

    1. Bonjour
      je n’ai pas encore trop testé le si5351. Est-ce sinusoidal pour la hf et la vhf ?
      je sais que il y a foxdelta qui propose un kit HF a base de 5351 avec un filtre en sortie.
      Quand a rigexpert le système AA-30 permet de connaître la phase (VNA complet) à l’aide de mélangeurs , mais il faut un processeur qui tourne plus rapidement qu’un arduino (STM32)

      Cliquer pour accéder à AA-30_ZERO_schematics_and_drawings.pdf

      Pour le moment je me fixe plus sur l’interfaçage de l’ESP8266 sur la carte existante.
      Quoique le si5351 a bien baissé en tarif depuis quelques temps.
      73
      Anthony

      J’aime

      1. Re-bonjour,
        je me permet de répondre.
        leSi5351 est un générateur d’horloge, donc pas de sinusoïdal.
        Il ne peut donc pas être utilisé tel quel sur ce montage, les équilibrages du pont devant être effectifs sur l’ensemble des harmoniques…
        Après on peut bricoler, par exemple en mettant à profit les sorties multiples du du Si5351 pour faire du changement de fréquence et du filtrage. J’ai un peu expérimenté ça et les résultats sont exploitables, mais ça complique le montage ( il faut rajouter au minimum un mélangeur plus un filtre).
        Un AD9850 ( ou un AD9851) reste le meilleur choix si on veut faire simple.
        David, F4HTQ.

        J’aime

      2. Bonjour,
        Effectivement il faut être méfiant avec le si5351. c’est bien spécifié dans la doc générateur d’horloge.
        73
        Anthony

        J’aime

  1. Bonjour Anthony,
    Pour commencer, merci pour l’article.
    Je ne comprend pas comment vous calculez ça:
    « Rs is calculated by the arduino, but Xs is not possible to calculate with this scalar antenna which does not determine the phase. This parameter always remains at zero. »
    Comment pouvez vous différentier une résistance plus faible que 50 Ohms d’une résistance plus élevée ?
    le AD8307 va mesurer un différentiel de tension, et il me semble que ce différentiel peut venir tout autant d’un DUT présentant une résistance plus faible que 50 Ohms que d’un DUT en présentant une plus forte…. ce qui revient, il me semble, à une incapacité à mesurer Rs ( vu qu’il y a deux solutions).
    Si possible, pourriez vous aussi fournir aussi le code source ( arduino ) du projet ( en plus du HEX ), j’aimerais y jeter un coup d’œil.
    Mes 73,
    David, F4HTQ.

    J’aime

    1. Bonjour,
      je ne peux pas différentier une résistance plus faible que 50 Ohms d’une résistance plus élevée.
      J’utilise un artifice pour leurrer Antscope et avoir la meme forme de SWR que sur mon VNAPRO.
      Je mettrais bientôt le code dans github, mais c’est le même que pour mon vna avec l’Arduino sauf que im=0.
      73
      Anthony
      #define adc2Db 100/1024
      #define offsetDb -90

      void calculDut(unsigned int adcMag)
      {
      //Point.Freq = freq;
      Point.RL = ((float)adcMag * adc2Db) + offsetDb;
      Point.Rho = pow(10.0, Point.RL / -20.0);
      Point.Swr = fabs((1.0 + Point.Rho) / (1.0 – Point.Rho));
      Point.Rs = abs((1 + Point.Rho) / (1 – Point.Rho)) * 50.0;
      if (Point.Swr > 10) Point.Swr = 10;
      #ifdef DEBUG
      Serial.println(« —————-« );
      Serial.print(« adcMag « );
      Serial.println(adcMag);
      Serial.print(« RL « );
      Serial.println(Point.RL);
      Serial.print(« Rho « );
      Serial.println(Point.Rho);
      Serial.print(« Rs « );
      Serial.println(Point.Rs);
      Serial.print(« Swr « );
      Serial.println(Point.Swr );
      #endif

      }

      J’aime

      1. Bonsoir Anthony,
        merci pour votre réponse.
        j’avais donc vu juste 🙂

        de mon coté j’ai bricolé un analyseur d’antennes ( qui sert pour les antennes, pour caractériser les lignes de transmissions, mesurer le Q et valeurs de bobines, caractériser les quartz) dans lequel la résistance de 50 ohms est remplacée par un potentiomètre variable.
        via une petite astuce je mesure la valeur de ce potentiomètre en continu avec un des ADC de l’arduino ce qui permet, quand le pont s’équilibre de connaitre la valeur exacte de l’impédance.
        Du coup j’ai une mesure fiable.
        En gros l’utilisateur connecte le DUT, et joue avec le potentiomètre jusqu’a ce que la courbe ( affichée sur un LCD ) présente des zeros. Chaque zero est une résonance, et le DUT présente alors une résistance égale à celle du potentiomètre.
        Il faudra que je mette ce projet en ligne… ce qui va demander du temps de rédaction.
        Première étape, passer le projet sous IDE arduino ( il est actuellement sous atmel studio).
        Bonne soirée.
        David.

        J’aime

  2. theo dit :

    bonjour Anthony et David,
    merci pour réponse as vous deux!
    on voie que ça bricole encore !
    c’est vrai que le SI5351 n’as pas des sorties sinusoïdales, mai il y as des solutions qui mérite a être envisages .
    une d’elles : http://dspview.com/viewtopic.php?f=14&t=183
    l’ESP8266 est super mais manque d’entrés analogiques; une solution as envisage est passage vers son grand frère, ESP32 !
    n’oublie pas une option d’écran graphique , stp !
    amicalement, theo

    J’aime

    1. Bonjour,
      Merci pour le lien.
      Pour le moment je reste avec l’esp8266 qui hébergera seulement les pages web.
      En ce qui concerne l’écran graphique. je préfère utiliser un affichage déporté comme un écran de smartphone (très répandu maintenant)
      plutôt que de racheter un écran spécifique, ce qui augmente le coût total du montage. D’où l’esp8266 en point d’accès Wi-fi dédié au PHSNA.
      73
      Anthony

      J’aime

  3. Claudio dit :

    Hello at all,
    Anthony, I done your vna that is fantastic, Thank You for this new project!

    I have completed the PHSNA, I have the AD9851, so I put a jumper on J1.
    During calibration, no way to receive a value within 100-200, here is what I receive (three attempts):

    Calibration Average saved in eeprom : 39322
    if value is out of 100-200 range, check hardware
    OK
    Calibration Average saved in eeprom : 48058
    if value is out of 100-200 range, check hardware
    OK
    Calibration Average saved in eeprom : 37137
    if value is out of 100-200 range, check hardware
    OK

    If I put a jumper on J6 pin 1-2 (not having the AD9850, but I dont’ know if it’s correct), I receive this (three attempts):

    Calibration Average saved in eeprom : 370
    if value is out of 100-200 range, check hardware
    OK
    Calibration Average saved in eeprom : 370
    if value is out of 100-200 range, check hardware
    OK
    Calibration Average saved in eeprom : 370
    if value is out of 100-200 range, check hardware
    OK

    but, again not into the 100-200 range.

    I have tried to change the AD9851 with antoher, but the results are again out of range, I receive 368 instead 370.

    Which hardware I need to check?

    Thank You
    Best Regards

    J’aime

Laisser un commentaire