Designing, assembling, programming and testing an ultra-low-cost GPS-disciplined oven controlled crystal oscillator / lab clock based on an 100 MHz STM32 32-bit ARM microcontroller
Keywords: STM32, GPS, GPSDO, OCXO, 10MHz, crystal oscillator, frequency standard, atomic clock
I have been following the thread by the late Lars about his inspirational DIY Arduino GPSDO project. And I checked the dozen or so GPSDO projects published on the net. Then I decided to join the party and design and build my own.
I didn't quite know what I was getting into, but after a couple of months waiting for the parts to come from China, and then another couple of months writing the firmware, I have a working, blinking, timekeeping and happily and precisely oscillating GPSDO.
Like with Lars' design, any OCXO, DOCXO or even rubidium source can be used, but the recommended oscillator is an inexpensive used square wave 10MHz 5V OCXO, which is what I am using in the breadboard prototype. These OCXOs are available from various sources on the net, recycled from decommissioned telecom equipment and sometimes still soldered onto a piece of PCB, for around 10€ or less (< US $12). The OCXO is the most expensive part in this GPSDO.
For Lars' design check following links:
- Original Lars' EEVBlog forum thread: https://www.eevblog.com/forum/projects/lars-diy-gpsdo-with-arduino-and-1ns-resolution-tic/
- GitHub project combaning all information in one place: https://github.com/AndrewBCN/Lars-DIY-GPSDO
The second most expensive part is the GPS receiver module. I strongly recommend a u-blox Neo-M8 GPS module with an SMA antenna connector. With a u-blox Neo-M8, I am still getting 5~9 satellites even indoors in my basement lab. The much cheaper Neo-M6 struggles to get a fix in the same conditions.
I have decided to build my own version of a 10MHz GPSDO with the following features:
- Very low cost i.e. < 30 EUR ($35), short and easily purchased BOM.
- Acceptable performance (+/- 1ppb) "out of the box", can be fine tuned over time.
- Uses an 100 MHz STM32F411CEU6 "Black Pill" microcontroller module, programmed in C/C++ using the Arduino IDE (STM32duino).
- Requires only a 5V @ 1A power supply, supplied through a USB C cable.
- Compact and portable.
- Optionally battery powered (allows taking it outdoors for optimal satellite signal reception).
- Optional modules
- BMP280 for atmospheric pressure and temperature monitoring,
- AHT10 for temperature and humidity monitoring,
- INA219 for OCXO power consumption monitoring,
- HC-06 for wireless communication with a PC/mobile using Bluetooth UART.
- Extensive logging of various operating parameters to allow further software tuning.
- An optional small OLED displaying room temperature, UTC time, uptime, operating status, measured frequency.
- New! Optional UTC-aligned 1PPS output using a picDIV.
- It uses a digital FLL (Frequency Locked Loop),
- New! It can also use a PLL (Phase Locked Loop).
- OXCO Voltage control using a 16-bit DAC provided by a 2kHz PWM output pin on the STM32F411CEU6
10 MHz | 1 ppm (10^-6) | 1 ppb (10^-9) | |||
---|---|---|---|---|---|
10000000 | Hz | 1E+06 | ppm | 1E+09 | ppb |
10 | Hz | 1 | ppm | 1000 | ppb |
1 | Hz | 0,1 | ppm | 100 | ppb |
0,1 | Hz | 0,01 | ppm | 10 | ppb |
0,01 | Hz | 0,001 | ppm | 1 | ppb |
0,001 | Hz | 0,0001 | ppm | 0,1 | ppb |
Latest (0.6.2 revision) schematics are available here: EDA/Schematics-STM32-GPSDO-0.6.2.pdf
In normal operation this is displayed on the small OLED:
You can see it in action on YouTube video (click image below):
https://www.youtube.com/watch?v=mgoK4KuVDhw
- André Balsa, April 2021