element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Member and Staff Blogs Si5351 Clock Generator
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: kk99
  • Date Created: 27 Jul 2026 3:53 PM Date Created
  • Views 73 views
  • Likes 7 likes
  • Comments 4 comments
  • esp32
  • esp32-c6
  • diy
  • arduino
Related
Recommended

Si5351 Clock Generator

kk99
kk99
27 Jul 2026
Si5351 Clock Generator

The main concept was to build a clock generator that supported at least a 50 MHz frequency. I have decided to use a module with Si5351. This module supports the three simultaneous outputs for which it is possible to set individual output frequencies. I have decided to use only one output for now. This module is controlled via I2C. As a control module, I have used a XIAO board with ESP32-C6. As a control interface, I have decided to use software Wi-Fi AP and a simple webpage which allows control parameters like: frequency and turning on/off the clock output. Below there is a diagram of the connections between these two modules:
image

The connections were made on double-sided universal board with dimensions 30x70mm. Below is the result of soldering:
image

image

The code uses the etherkit si5351 library to drive a clock generator board, and software Wi-Fi Access Point for serving webpage, and handling actions like setting frequency and toggling output. Below there is the source code:

#include <WiFi.h>
#include <WebServer.h>
#include <Wire.h>
#include <si5351.h>

const char *ssid = "SiClockGen";
const char *password = "12345678";

WebServer server(80);
Si5351 si5351;

const uint32_t MIN_FREQ = 8000;
const uint32_t MAX_FREQ = 160000000;

uint32_t frequency = 10000000;
bool outputEnabled = true;

const char webpage[] PROGMEM = R"====(
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1">

<style>

body{
    font-family:Arial;
    background:#f0f0f0;
    text-align:center;
}

#display{
    font-family:Consolas,monospace;
    font-size:60px;
    font-weight:bold;
    color:#0040ff;
    background:white;
    border:3px solid black;
    border-radius:10px;
    display:inline-block;
    padding:15px 25px;
    margin:20px;
}

#status{
    font-size:28px;
    font-weight:bold;
    width:220px;
    margin:auto;
    border-radius:8px;
    padding:10px;
}

.on{
    color:white;
    background:green;
}

.off{
    color:white;
    background:red;
}

input{
    width:240px;
    font-size:24px;
    text-align:center;
}

button{
    font-size:22px;
    padding:10px 20px;
    margin:8px;
}

</style>

</head>

<body>

<h2>Si5351 RF Generator</h2>

<div id="display">10.000.000</div>

<div id="status" class="on">
OUTPUT ON
</div>

<br><br>

<input
id="freq"
type="number"
min="8000"
max="160000000"
step="1"
value="10000000">

<br><br>

<button onclick="setFreq()">Set Frequency</button>

<button id="toggleBtn"
onclick="toggleOutput()">
Turn OFF
</button>

<script>

function formatFreq(f)
{
    return Number(f).toLocaleString('en-US').replace(/,/g,'.');
}

function setFreq()
{
    let f=document.getElementById("freq").value;

    fetch("/set?f="+f)
    .then(r=>r.json())
    .then(data=>{

        document.getElementById("display").innerHTML=
            formatFreq(data.freq);

        document.getElementById("freq").value=
            data.freq;

    });
}

function toggleOutput()
{
    fetch("/toggle")
    .then(r=>r.json())
    .then(data=>{

        let status=document.getElementById("status");
        let button=document.getElementById("toggleBtn");

        if(data.output)
        {
            status.innerHTML="OUTPUT ON";
            status.className="on";
            button.innerHTML="Turn OFF";
        }
        else
        {
            status.innerHTML="OUTPUT OFF";
            status.className="off";
            button.innerHTML="Turn ON";
        }

    });
}

</script>

</body>
</html>
)====";

void handleRoot()
{
    server.send_P(200,"text/html",webpage);
}

void handleSet()
{
    if(!server.hasArg("f"))
    {
        server.send(400,"text/plain","Missing frequency");
        return;
    }

    uint32_t f=server.arg("f").toInt();

    if(f<MIN_FREQ)
        f=MIN_FREQ;

    if(f>MAX_FREQ)
        f=MAX_FREQ;

    frequency=f;

    si5351.set_freq((uint64_t)frequency*100ULL,
                    SI5351_CLK1);

    String json="{\"freq\":";
    json+=String(frequency);
    json+="}";

    server.send(200,"application/json",json);
}

void handleToggle()
{
    outputEnabled=!outputEnabled;

    si5351.output_enable(SI5351_CLK1,
                         outputEnabled);

    String json="{\"output\":";

    json+=outputEnabled?"true":"false";

    json+="}";

    server.send(200,"application/json",json);
}

void setup()
{
    Wire.begin();

    if(!si5351.init(SI5351_CRYSTAL_LOAD_8PF,0,0))
    {
        while(1);
    }

    si5351.set_freq((uint64_t)frequency*100ULL,
                    SI5351_CLK1);
    si5351.drive_strength(SI5351_CLK1, SI5351_DRIVE_8MA);
    si5351.output_enable(SI5351_CLK1,true);

    WiFi.softAP(ssid,password);

    server.on("/",handleRoot);
    server.on("/set",handleSet);
    server.on("/toggle",handleToggle);

    server.begin();
}

void loop()
{
    server.handleClient();
}

The code was compiled and programmed to the ESP32C6 with usage of the Arduino. After initial testing, I found that it was required to set a higher output current by setting: SI5351_DRIVE_8MA, to get better results on higher frequencies.The webpage with control panel is available at address: http://192.168.4.1 after connecting to the SiClockGen Wi-Fi access point: Below there is what the page looks like:
image
The testing was done using direct probing via a passive probe as on the following picture:
image
Below there are results of measurements for clock frequencies of 1 MHz, 10 MHz, 25 MHz, 50 MHz, 100 MHz and 150 MHz:

{gallery}Output clock measurement

image

1 MHz clock

image

10 MHz clock

image

25 MHz clock

image

50 MHz clock

image

100 MHz clock

image

150 MHz clock

Below there are measurements with FFT included:

{gallery}Output clock measurement with FFT

image

1 MHz clock

image

10 MHz clock

image

25 MHz clock

image

50 MHz clock

image

100 MHz clock

image

150 MHz clock


These measurements were done with a SP5050A passive probe and SDS2000X HD. It will be worth checking with usage a 50 Ohm input and direct connection via coaxial cable. I am waiting for the adapter from SMA to BNC to check it.

  • Sign in to reply
  • kk99
    kk99 20 hours ago in reply to colporteur

    Yes, I will think about the case. The target will be usage with a terminated transmission line. I have no plans for any RF transmission. For that purpose, I have SDR.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • kk99
    kk99 20 hours ago in reply to wolfgangfriedrich

    I have also added measurements with FFT enabled.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • wolfgangfriedrich
    wolfgangfriedrich 20 hours ago

    Would be interesting to see the FFT graphs of the different clock speeds and calculate the scope roll off at 200 MHz and above. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur 21 hours ago

    will the final design be shielded..If you have any unwanted signal power escaping through the air directly from the device chassis and cables you might *** off your neighbour if he is a HAM operator.  50Mhs is in the HAM radio band. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube