Universal VFO Controller (ATMega328 & si5351)

This board is a universal radio project controller, with an ATMega328P(U) microcontroller and lots of options. The intention was for it to become a basic building block in transceivers, receivers, transmitters, signal generators, anywhere you need either a digital controller, one to three clocks, or both. The board has headers for the common si5351 breakout board, available from Adafruit or as a .CN clone, and a 16×2 HD7044 Liquid Crystal Display using the standard 14+2 parallel data header (+2 for backlight). It brings out all of the available digital IOs (D2..D13), analogue inputs (ADC) A0..A5), as well as headers for a 12V supply, and access to the regulated 7805 5v output, access to the LCD backlight in case you wish to take control of this in software, and an FTDI-compatible USB-to-serial programming board.

More features

However it doesn’t end there, as the point of this desgn was to incorporate as many of the additional components that have so often been relegated to small boards hanging off front, side and rear panel sockets and switches. So there are these additional headers:

  • a header for 1, 2 or 3 pushbuttons for general control purposes, intended to be mounted on a front panel for channel selection, VFO control, VFO step etc (additional buttons can easily be added in desired)
  • a header for a paddle and 1, 2 or 3 keyer memory pushbuttons (again, more may be added)
  • a header to take digitally generated and filtered sidetone (with an on-board level setting trimpot) off to a transcever’s audio stage
  • a header for a mechanical or optical emcoder (tuning), including a line for an integrated pushbutton.

The ATMega328 MCU’s I2C SDA and SCL, ground and 5v are additionally available on an I2C header, for all kinds of extensions via sensors that talk I2C or those on breakout boards. This feature opens up the possibility of using any of the OLED displays instead of the LCD, as OLEDs interface via I2C. Another option is to use an LCD with I2C backpack which would free up 6 additional digital IO lines.

In fact there is no reason to have a display if you don’t need one, this board could control a headless WSPR beacon, Automatic ATU or Satellite Tracker if needed. The possibilities are fairly much as endless as you get from an Arduino Uno.

The board was designed using EasyEDA and fabricated including assembly at JLCPCB. The design process was a part time project that lasted about 6 weeks. The first batch of five boards was done and delivered in about two and a half weeks from ordering, with DHL delivery.

Clock buffers

The three si5351 clocks are each buffered on-board, delivering a solid +13dBm (20mW) into 50 ohms, perfect for driving an L7 mixer (via a pad) or a transmitter pre-driver or driver. The buffers are 74LVC1G126 , fast single buffer/line drivers with 3-state output and a Schmitt-trigger on the input for handling any variation in the si5351 clock rise and fall times as frequency increases. The buffers are permanently powered and will only draw curent if the clock is enabled.

Gallery

Schematic

The schematic is here.

Wiring diagram

Firmware

My VFO_Controller script now has a new compilation target, UNIVERSAL_VFO_CONTROLLER, which, if #defined, includes the code for the pushbuttons and other features of this particular board. Get it here:

https://github.com/prt459/Arduino_si5351_VFO_Controller_Keyer

First use: a 20mW QRPp transmitter!

The first real use of the board in the shack was as a QRPp transmitter. Just power it up, connect a resonant antenna to CLK#1 output, plug in a paddle, and it’s ready. Adding a 2N2222 or BS170 (and a Low Pass Filter) should get to half a watt, an additional IRF510 for a full five watts, so simple!

Credits

The schematic is derived from Ashar Farhan VU2ESE’s Raduino. A number of ideas for improvements were made by David VK3KR. The use of si5351 clock buffers and selection of 74LVC1G126 devices was first done by Glenn VK3PE.

First run boards are being evaluated by David and Peter VK3TPM. Once the bugs are ironed out (and there are a few!) a second run will be done, verified, and then the PCB design will be opened up to anyone who would like to spin up their own pieces.

Tagged , ,

44 thoughts on “Universal VFO Controller (ATMega328 & si5351)

  1. W9WC VARC Amateur Radio says:

    Great work! Can you make the gerbers available? I would like to have JLCPCB make some of these for me. I had actually thought about doing the same thing, but you beat me to it! I would like to use these in several builds I have planned in the future. I’ll be sure to give you credit, if I publish the builds on YouTube or on my future blog. Thanks so much.
    73 de W9WC
    Paul

    Like

    • Paul Taylor says:

      Hi Paul, thanks for commenting. This board is a first prototype, actually it is ver1.1, 1.0 failed JLC evaluation. There are about 5 errors , all minor, mostly silk screen labels. But they need to be fixed before the board is shared more widely. It is currently with two friends who are evaluating it. In a few weeks, I will apply the changes, and decide what to do about a Ver 1.2., whether to buy a few or enough to offer them, and PCB or fully assembled. Quantity discounts are substantial. Stay tuned!

      Liked by 1 person

      • W9WC VARC Amateur Radio says:

        Thanks Paul. I will stay tuned. I understand that are beloved Si5351 chip is becoming hard to find. I bought several breakout boards from Adafruit and some other vendors. I understand that there may be an alternative so I am looking into that. Something to consider if you decide to not use a breakout board and have the chip and associated hardware mounted to the board. I’m currently building a Pete Juliano’s receiver that is in the Summer SPRAT and uses a separate Arduino and SI5351.

        Thanks again Paul
        73 de W9WC

        Like

      • Paul Taylor says:

        Good luck with your projects Paul. The reason why I chose the breakout board is that JLCPCB has no stock of si5351, same as every other source I’ve tried. So until supply comes back, expected 2022, no point in using it. The breakout boards are still available from what I can see.

        By the way, supply of ATMega328 is very low to zero in SOIC, some supply still available in the older 28 pin DIP. There’s a reason for most choices! The kit companies must be highly exposed to these shortages.

        73 Paul VK3HN.

        Like

  2. VK3IL says:

    Hi Paul,
    Congratulations on making the jump to PCBs 🙂
    This looks like a really useful building block.
    Given you’re doing a PCB, did you consider just putting the Si5351 directly on the board rather than as a plug in? They are small packages, but not that hard to solder.
    Also, not sure if you were aware that there is a quad version of the line driver 74LVC126AD which would reduce the parts count – I like the idea of the line driver given the potentially long interconnects to other boards. Another suggestion on the driver – I note that it can also act as a level translator, so it might be a good idea to have a jumper that allows the user to strap the driver VCC to either 3.3 or 5V depending on what they need offboard.

    Like

    • Paul Taylor says:

      Hi David, good to hear from you. Hope you’re well, and occupied. I would have preferred to use a ‘naked’ si5351 but there is zero stock. Soldering is not an issue as these boards are populated in the factory. It is a brilliant service, they check and fabricate the board, supply the parts, solder and dispatch!

      Thanks for suggesting the quad version of the driver. I’ll probably stay wirh the individual units for clock isolation. They are so tiny that space is no issue. Your suggestion of a 3v3 or 5v jumper is a good one.

      Hope to catch up with you at some stage, when we gain some freedom of movement.

      Paul VK3HN.

      Like

  3. vk2kyp says:

    Hi Paul,
    Great project, look forward to seeing more and making a few boards myself
    Keep up the good work.
    See you on Peters Zoom on Wednesday

    Like

  4. VK3IL says:

    Hi Paul, in relation to the Si5351 chip shortaage, there’s a Chinese clone of it ms5351 which apparently performs very well and is readily available. Hans Summers has done a performance assessment of it here: http://qrp-labs.com/synth/ms5351m.html

    Liked by 1 person

  5. VK3IL says:

    Another thought – these days, many low power systems are moving to 3.3V as the standard voltage. I think you could make this work as an all 3.3V system as the AT328Mega works at 3.3V, as can all the other components. It’s also easy enough to get 3.3V LCD displays now too. I would then think about having a single 3.3V switch mode regulator and you would have a much lower power solution I think. This would avoid the need for level translators for the Si5351 too. If you were concerned about switch mode noise, you could use a two stage regulator with switch mode to 5V and then a low noise LDO linear regulator to 3.3V.
    Also, I couldn’t see any pull-up resistors on the I2C lines, are you using the internal pullups in the uP?
    Yes it would be good to catch up again when we are allowed to!

    Liked by 1 person

    • Glenn P says:

      Hi Paul, VK3IL,

      I did some experiments with the buffers on the Si5351 which i found reduced the cross talk to close on 10dB. That was the main reason I used them in my own project.

      Paul, I also fitted series chokes (smd) to each of the Vcc pins of the buffer chips. I never tried without them so can’t quantify if they assisted the cross talk but assume they would. http://www.carnut.info/VFO_raduino/Si5351_PCB/VK3PE_Si5351_pcb.pdf

      Glenn
      vk3pe

      Liked by 1 person

      • Paul Taylor says:

        Hi Glenn

        Apols about the late reply. Got busy with other things. Your pick of these line drivers as buffers seems to be an excellent one. My two evaluators have both commented on the ‘stiff’ output level and power.

        I will add the beads in Rev 1.2. David has suggested using a .CN 5351 equivalent, of which JLC has stock. If that is the case, I will probably ditch the Breakout board and place the ‘naked’ 5351 on the board. Will drive down overall costs. I was going to do that in the first place but JLC’s Analog Devices si5351 parts bin was empty.

        Haven’t seen you in the ARV Zoom sessions, it is good to stay in touch online but not the same as in person.

        Regards Paul T.

        Like

      • Glenn P says:

        No problem Paul. My post before is bad English, I meant to say that the crosstalk has been reduced by a further 10dB.

        Re the Raduino, I made a 50x50mm version some time back using the OLED display. Based on your Sketch by the way.
        http://carnut.info/VFO_raduino/RADUINO_AND_Si5351_CLONES.html

        Glenn

        Like

      • Glenn P says:

        Paul, I haven’t hooked up on the ARV group. No real reason why apart from forgetting about it………

        Like

    • Paul Taylor says:

      Hi David,

      Apols about the late reply. Got busy with other things. Your suggestions are excellent. The 7805 is a beast compared to switch mode regulators; the two step idea allows use of quality LDO 3v3 types. I would prefer to be using ATMega328P SOIC version but none were available. I did not know it works on 3v3, that would eliminate the need for level shifters.

      The Breakout board was chosen only because of a si5351 stockout. The MM5351 will drive down overall costs. The LCD is an issue. I an not inclided to move a way from garden varity LCDs, ans everyone has them and can work with them. It is an option to bake a 3v3 version onto the board but not every application needs or wants an LCD.

      Re pullups, I think the library enabled the internal pullups but I will add them next time.

      I have started watching uSDX videos. It is severely limited by the A-D converters, memory and processor power in the ATMega328, an old and underpowered MCU for an attempt at an SDR, but, with recent improvements, it is sounding more than acceptable on receiver, and I mostly would want it for CW not SSB on transmit. There’s no reason why you coldn’t run a uSDX on my board. The LCD assignments and some IO pin uses would need to be changeable. Thinking about that option…

      See you sometime, some day…

      Like

  6. Mark says:

    Hi Paul, what an excellent project. Love the CW keyer option with memories.
    Nice to see the modern raduino project.
    How small could this be if all made surface mount?
    Mind you I particularly like watching you free hand draw out your pcb’s and etch them.
    But as you say this board can make your rig designs a lot easier.
    Thanks for sharing 72 Mark G0NMY

    Liked by 1 person

    • Paul Taylor says:

      Hi Mark,

      Good to hear from you on the Blog. It is exactly that, a refresh of Raduino, in fact the LCD and other IO assignments were taken from Raduino, so that BiTx software could run on it without rewiring.

      Size could reduce further with all surface mount components. The issue at the moment is surface mount ATMega328s and si5351s are almost impossible to find. If I want to use JLC’s factory assembly service, I need to design only with parts from their stock. They have ATMega328s in 28 pin DIP. That’s not so bad, if you look at a number of commerial QRP products, many of them use the 28pin MCU option.

      The physical side of the board is matched to the 16×2 HD7044 dimensions. You want the four corner holes to align. So if you chose all surface mount you would end up with spare board space. You could make the board narrower and still maintain the 16 pin LCD header. But you cannot do anything else much with the resulting freed-up space. If you design primarily for OLED, you can drop the LCD physical dimensions and go a fair bit smaller. But OLED does not have such universal popularity.

      It’s all about choices, compromises and trade-offs — that’s design!

      72 Mark de VK3HN

      Liked by 1 person

      • Glenn P says:

        It’s a real nuisance, parts shortages. Many times on what you would have considered easy to get parts. Just not available.

        Current project is a QRP ATU based on N7DDC’s ATU. I built one of his from Gerbers PCB but the PIC devices are near impossible. Actually impossible to find. I ended up re-designing his board to use some PICs in a different package that (currently) are not on the “endangered” list!
        http://carnut.info/ATU_N7DDC/ATU-10/ATU-10%20build.html

        Glenn
        vk3pe

        Like

      • Paul Taylor says:

        I visited your website recently to see what you were doing and noticed that. An ATU represents a class of microcontroller projects that I’ve not tackled. It is a good application. Satellite tracking AZ EL is another one.

        I am enjoying learning PCB design now, and am spending my radio time on my computer. It’s pretty impressive what you can do. One thing I have learned is that the PCB is guaranteed to reproduce the schematic electrically In other words, if the schematic is correct, your PCB will be.

        73!

        Like

  7. danminciu says:

    God day Sir,
    (Here in Romania it’s day…timezone diff.)

    I read almos all of your posts here at vk3hn.wordpress.com… and as I said before, it’s an huge amount of inspiration in your posts.
    Now I’m trying to replicate this project(Universal VFO Controller (ATMega328 & si5351)) and – of coarse – ideas begin to”emerge”: May I try to change your script?

    First thing that I like to redesign is the usage of an SD-card(with the appropriate Ardu-shield) where to store the messages for CW keyer, reading from there, display first 20-25char on LCD for selection and transmit after confirm.

    Next idea is to “Save” messages keyed in it, on an free memory space(aka SD-card) so I can use this as actually hard-coded messages.

    Or as an alternate solution using ESP32 will provide 4mB of SRAM for those messages.

    Another area of development in wich I’ll try is Morse decoding… After so many years since I was teached to receive Morse code( ’80 as radioamateur and ’83-’84 military service as radio-operator) this skill is lost. For me it’s useful to decode received morse chars and to display them in a single line – scrolled on the bottom of display.

    Like

    • Paul Taylor says:

      Hello Danminciu

      Thanks for commenting. Hello Romania from Southern Australia! Thankyou for your kind comments and for spending some time reading my radio projects, much appreciated. Regarding my script, you are very welcome to change and improve it. You can take a copy and do that locally, or you could fork my repository and work in the forked repo. That could provide a merge path back at some time in the future. up to you. Whatever you do, let me know how you go with it.

      The SD card with keyer messages should be fairly straightforward, that would allow you to write keyer messages on a PC and transfer. ESP32 is a natural and better alternative to the old and under-powered ATMega328, I am happy for you to do that port.

      A morse decoder is a neat feature, I would like to see that! You would need to bring an audio line into the MCU and sense the presence of the carrier, with timing. You may start to run out of memory with the 328, I recommend doing that on a larger MCU. But, happy to be proved wrong.

      73 and good luck, Paul VK3HN.

      Liked by 1 person

      • Dan Minicu says:

        Hello Paul.(may I use this form?)

        I will do my best to accomplish those tasks.Thank you for your kind answer, hope I’m not too dare. And of coarse excuse my english. Because is not my “default” (HI!) language, sure I make mistakes.
        The best way to do what I’m thinking is to do the modifications and to pass them to you, see what I did and decide wether include or not into original project. It’s your’s and the decision must come from you.
        My version will be modified as I proceed, but I don’t want to interfere with your original source, only if you like the result. It’s the best way(said it again 🙂 ).
        (BTW. I change my picture and the name… beginner’s error.)
        Thanks again for your quick and warm reply.

        Dan Minciu.

        Like

      • Paul Taylor says:

        That is fine Dan. Thanks for your interest. I will follow your progress. No need to apologise for your English, I am lucky, the world speaks my language! I do not speak another language, so you are a long way ahead of me.

        73 Paul VK3HN.

        Liked by 1 person

  8. Dan Minicu says:

    Hi Paul,
    After some time waste on e-commerce(I buy, China sells) I am the proud owner of a SI5352 breakout board, one LCD 16chr/2rows and several I2C to LCD adapters. More to come I2C to 8 bit multiplexers(PCF8574 on a breakout board).
    So, I insert LiquidCristal_I2C library in your sketch, then create my rig’s definitions and upload the script into ArduinoNano. That was the easy part…
    Now, the questions:
    1 can you explain a little how A0 buttons are wired?
    2. I was study a while SP-IV and SP-7 schematics…wich one do you recommend for a first time buid?
    3. The vfo (without any buton except the encoder) starts on VFO4. It shows 7.020.00 aka 7.02MHz.but going down it didn’t stop at 7.0 MHz. Is it normal? I presume that it has no limit above/beyond amateur bands. How can I force band limit in the script?

    Vhen I’m done with those, I’ll go to implement SD-card storage system in your script. I decided that way because I intend to apply for radioamateur licence somwhere in april next year.

    73!…Dan

    Like

    • Paul Taylor says:

      Hi Dan

      Thanks again for experimenting with my designs. You have resolved your question on the analogue multiplexed pushbuttons. All good.

      Thinking about a first time build, I would recomment SP-IV, which is based on the OzQRP MST transceiver. It uses an SA612 mixer and product detector. It is a simple but effective design for a hombrew radio project, and can be built in a relatively short time. I have been happy with its performance and you would need to choose a more complex design to improve on it . You have the option of buying Leon’s kit, or build it up from scratch. You also have the advantage of an excellent manual. Build and test the modules independently, get each one working before bringing it all together into a receiver or transmitter, then a full transceiver.

      That said, SP-7 has a slightly better receiver so built that if you prefer. Build the QRP 5 watt version first and get one band going. Multi-banding always adds quite a lot of effort. I am tending to build for 40 and 20 only, as these are the most active bands, nd you only need one control line and one band switching point for each filter.

      My SP-IV rig does enforce the BPFs and LPFs to drop out on band edges, so I must have that in my script. See if you can find it. I may have removed it over the years. It is easy to add in. I dropped it because I wanted the option to receiver outside of band limits sometimes. A better option is to detect the band limits, and when outside, blink the display. Or, let the receiver tune anywhere, but drop the LPFs out when outside the band.

      You will need to play with the script to do this. Set up your radio and computer with Arduino IDE. Make one script change, upload and test. When you break something, reverse the last change. Do this in a loop, over and over again, over a few sessions, and you will gain confidence to change the script. Take a local copy if you are concerned about breaking it! Ask me if you have any questions.

      Good luck, have some fun, and learn a lot!

      73 Paul VK3HN.

      Like

  9. Dan Minicu says:

    “1 can you explain a little how A0 buttons are wired?”
    …Sorry… I found them… Mea culpa…

    Like

  10. Saquib Ahmed says:

    You did a fine job! I didn’t discovered any other writhings with Atmega 328 with SI5351
    Thought I discovered plenty with Arduino
    I rounded out some of the most popular si5351 codes and posted on my bloghttps://itshamradio.com/amateur-radio-codes-for-si5351/
    Please let me know thoughs!

    de VU3HZW

    Like

  11. Dan Minicu says:

    Hi Paul!…
    Searching on Goo/gle I find something …interesting:http://www.oz1jhm.dk/content/very-simpel-cw-decoder-easy-build
    I think I’m not the single one nor the first who think to decode MORSE code…
    Well.. I accept this. And I give a try to this idea… I borrow the code, modified it for NodeMCU(some addresses changed) and… that’s what came out:https://youtu.be/Uy21apt27-Y

    Nasty problem occurs when I realize that decoding is real-time and can’t mess around with Transceiver’s commands. Because of inherent delays.
    So, it will be necessary to use two Arduinos…

    73!…de Dan Minciu

    Like

  12. Dan Minciu says:

    Hi Paul!..
    I am sorry to bother you again, but I find something weard:
    Values returned from analog buttons multiplexers differs from standalone(powered from 12V+7805) versus powered by USB. I think a liiiiittle difference between those 5V…
    Could it be a good idea to use something like 220R+4V7 zenner to get a different voltage on the line wich sustain ONLY multiplexers(that batch of resistors connected to +5V and buttons)?
    73! Dan…

    Like

    • Paul Taylor says:

      Hi again,
      Yes, I have found the same thing. You could power the resistor chain with a 4v7 sender, that should work.
      What I have done is to open up the range test in the if(){} statements to ensure all possible values that can be read from the A2D input are caught. I generally leave these ranges quite wide, much wider than the values I see traced out in the console, to be safe.
      This raises a question. How did you know the values were different on battery, meaning you have no serial link to the ISE and therefore console. You must have traced the values on your LCD!
      Good luck!
      73 Paul VK3HN.

      Like

      • Dan Minciu says:

        Hi Paul,
        Yes, it was a challenge, but I did it in the simplest manner possible:
        I use last 4 digits in second row of the display to print Z…it is a bit flickering but readable. On a single A2D multiplexer at once.
        I have reorder my ranges to meet the values dispersion, but there are so wide spread… (ex. 798 and 999…)
        so I decided – as you suggested – to use a Zenner diode to keep the line steady.

        So, it’s time for analog part. (I’m sorry if I’m too stressful but…) I’ll try to build the IF amplifier and mixers first… can I do some tests with this and power AF amplifier? I don’t have RF signal generator…Or I can use(just for tests) an IF amplifier from a commercial receiver (3 stages BF254 10,7MHz+455kHz) realign IF transformers to 4,915MHz and build BPF+frontend…

        73! Dan

        Like

      • Paul Taylor says:

        Ok. A range of about 200 of a possible 1024 values is 20%. Thats a volt on a 5v scale, a lot, I wonder why. The value and number of resistors has a big effect, of course. Anyway it’s fixed now.
        I would not bother to realign another IF module, too much work! Do you have your si5351 working? If so, you have a VFO and a BFO. So you can build a receiver from antenna forwards, or from speaker backwards. Build each stage and test. Audio amp from the detector back is a good starting point.
        For a crude RF source, connect up your antenna for broadband RF noise.
        My usual approach is to build backwards, audio amp, product detector, IF amp, xtal filter.
        Then build the front end.

        Good luck!

        Like

      • Dan Minciu says:

        Hi, Paul…
        “A range of about 200 of a possible 1024 values is 20%. Thats a volt on a 5v scale, a lot, I wonder why. “…
        Mistery solved: mi PC’s USB deliver only 4V…4,3V precisely… It’s an old refurbished i5, wich I suspect some(several)capacitors out of service in PSU or even on the motherboard…

        Like

      • Paul Taylor says:

        Ahhh, mystery solved! For nearly all USB devices, it wouldn’t matter. Thanks for the explainer!

        Like

  13. Dan Minciu says:

    AF-side is ready to use….
    So as you said before, I will make IF module, also need to say that today I’ll buy 12 crystals with 4,915MHz freq…

    Like

  14. Dan Minciu says:

    Hi Paul…
    Yesterday I was thinking to a possibility to reduce number of relays on my “toy”…
    So, I googled a little and find something that I knew since ’80-’81: A412 transceiver built here in Romania… In it, BPF switching was made thorough diodes…1N914 at that time…
    (sorry but I can’t post any picture here)…
    What is your opinion about that?

    Like

    • Paul Taylor says:

      Hi Dan, diode switching is commonly used. If you Google it you should find some examples. Look at the schematic of my SP-X project, the BPFs are diode switched. There are many good diodes to use. If you want to use common components, try 1N4007. IN4148 will probably work OK. A Shottky diode is recommended. A lot has been written about this topic, search YouTube, Google and the usual sources. — Paul VK3HN.

      Like

Leave a comment