What is a GPSDO ? GPSDO means: GPS disciplined oscillator. GPS for global positioning system. All GPS satellites are equipped with synchronized atomic clock. GPS module receives these signals from several satellites. And by triangulation, it knows his location. But here, what interests us is the pulse per second that is found on the module. With this precise pulse (from atomic clock), we can do a very very accurate oscillator. What for ? For reference, for calibration of frequency counter or just for fun to have one in his lab.
For more explanation on how calibration is working. Go to my first instructable just here:
So i did a frequency generator of 10.000000000 Mhz +- 0.000000001 Mhz or 1ppb on 10Mhz
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Here Is the Schematic
I improved schematic. I added a pot for the 12v version. Like that almost any 7404 or 7414 are working.
And i added LED support. Optional as well.
Basic projet could be only the uC atmega without LCD and LED. Output will be the same. But add some monitoring device is more fun :)
Step 2: Some Parts You Will Need.
GPS module. You can buy a cheap one.... any will do.
But you will need to find where is the pulse is. When a led is on the device. Best thing to do is to put a wire from the led to the 7404. Or now on ebay i saw some availables with on board GPS pulse output.
If your module isn't configure to have 1 pulse per sec (1 pps) and 0 pps when antenna are signal is missing, you will need to setup the GPS module. If you buy a ublox 6m. It's by default.
On a ublox n8m, you can choose an output of 10mhz. So why doing a gpsdo when i could have 10mhz directly of a gps module ? It's because ublox module is using speed of 48 Mhz and this is creating jitter at the output. 48Mhz isn't dividable by 10. This is what i talking about:
And this is at 1Mhz, at 10Mhz, this is worst, very ugly. Also, after some test and experience with pll gpsdo, the pll was sticking on a moving waveform. It's why i choose to do an over time gpsdo instead.
Yellow is a 10mhz reference gpsdo divided by 10. Trigger is channal 1 (yellow).
Blue is the timepulse output 1mhz 50% duty of a ublox n8m.
As you can read in Timing Consideration book page 10-11, it's because Ublox is using a speed of 48 mhz. And this one isn't dividing by 10. So, at the end the software is doing a correction.
Step 3: OCXO
Oscillator OCXO. Simple or double, 5v or 12, sine or square will do.
Step 4: LCD 2x16
LCD is optional. If you install one. Only pin 1 to 14 is needed. For pin 15 and 16 (backlight), install a diode and wire exactly like picture.
Step 5: Those for Gps Module
This cable is:
High Frequency Coaxial Connective Cable Cord RP-SMA Female Connector IPX
28dB LNA Gain 1575.42MHz RP-SMA Male GPS Active Antenna Stronger Signal
Step 6: PCB
For PCB i used the toner transfer method. Not perfect but ok for this project. I'll give you PCB to print at next step.
Here is the file you will need to do the PCB. Top one is mirror for toner transfer method. I also added the gerber files if you want to use a professional way.
Step 8: Check Voltage
Before to add atmega and 7404, voltage must be checked.
I know my heat-sink is HUGE but i'm using what i have :) An old pc heatsink
Don't pay attention to my crocs with my socks lol
Step 9: LED Board
I did a board for the LED. At the end i glued the transistors on the metal box.
I'll give you pcb file on next step.
I suggest these flat cable. If by mistake you plug the cable upside down, no worry. everything will be fine. Just no LED will turn on. That's all.
Step 10: LED Board Files
The files for the little board
Step 11: Program Your ATMEGA and Below Here Is the .HEX File
You need an Atmega328p and the .hex file below. You must also choose the right fuses bits.(E0 D9 FF)
They are many way to do that:
-USBasp (see next step)
-USBtiny (see next step)
-Arduino to program another atmega328p (search on internet, many how to availble)
Myself, i'm using a stk500 with ISP directly in Atmel studio. You can use any other method. A lot of cheap programmer are available on ebay. Next step show an ease alternative.
You must choose the right fuse bit. Here is Picture of stk500 fuses bits. (E0 D9 FF)
-Be sure that external oscillator is selected and the low.ckdiv8 clock is unchecked. See picture. Pay attention, when the external clock fuses bit, you must provide an external clock to program or run the code. In other words, connect the Oscillator in xtal1 pin.
So for short, send the gpsdo.hex file to the Atmega328p and program the fuses bits. (E0 D9 FF)
Step 12: Program Your ATMEGA With Avrdude and a USBasp or USBtiny
This method is very simple and cheap. search on ebay or amazon for USBasp or USBTiny. It's between 2 and 5$.
Plug in your USBasp or USBtiny device in your computer and let Windows detect the device (it will report driver not found). If a window pops up asking to search for driver, just close it or click on Cancel.
At this point, download and run Zadig, it should detect the USBasp or USBtiny, or any libusb device that you have. Then in the selection box (see picture), choose libusb-win32 (v188.8.131.52), click on Install Driver, and wait for the installation to complete.
Check in device manager for atmel usb device = ok. No excalmation mark anymore
Download avrdude 6_3 with HEX.rar here below on this page and unzip files in a folder. You will have 5 files, see pictures.
I create a batch file to program the chip with .hex and fuses bits in same time.
Connect USBasp or USBtiny cable in gpsdo board, see picture and turn on the project.
Double click on program usbxxx.bat
At the end, code and fuse bit are programmed, again see picture (black one)
Pay attention, with new fuses bits setting, clock must be now, external.
If programmation is ok and you see happen on lcd, check for oscillation. If you use 12v option, turn the pot
until something is lit on display. Use oscilloscope to adjust duty to 50% if you have one.
Step 13: Try Your Project
Before to put all the thing in a box. Try it. Be sure that all is working fine.
Here i fixed GPS module on heat-sink. I used an old transformer 16v AC. Too large for the project but again, i'm using what i already have.
Step 14: OCXO Insulation
If you want, you can insulate the OCXO with foam. Here i used depron foam. This is optional only.
Step 15: Holes in Your Box
Prepair your box. Do hole, put some paint! For square i'm using this tool, see picture.
Step 16: Time to Put All in a Box
Here i used a metal box.
Step 17: On Scope Results
Like you can see, sine wave is nice. 3,44V peak to peak. (1 volt/div)
Square wave is 2v/div
Here i'm using a 74LS04.
Step 18: Instruction Manual
At turn on GPSDO wait 15 minutes. It do nothing. This is for warming the OCXO and satellites reception.
If the OCXO is already hot, just push button to pass this wait time.
Now begin calibration phases. 6 phases total. 1 second, 10, 60, 200, 900, and 1000 seconds. At 1000, uC is counting 1 billions of cycles (ticks) for exactly 10,000,000.000 Mhz
As soon this 1000 seconds achieved, uC keeps the pwm value in eeprom and continu at run mode.
Run mode is the same, 1000 seconds counted. If counter reach 10,000,000.001 or 9,999,999.999 the pwm value (16 bits) is adjusted plus or minus 1 and so on.
Important, keep in mind, in all calibration phase and run mode, the display is showing the actual count or frequency. If the value isn't normal, bizarre or understandable, suspect a gps pulse problem or a low antenna signal. Problem is coming from the pulse. This one isn't arriving at the right time.
When GPSDO is in run mode, config is saved in eeprom. So if this one is turned off and on, GPSDO go directly in run mode. But be aware. If power if off for a while. You will probably need to do a whole re-config process. Sometime even with pwm in eeprom, frequency have drifted to much. And, in run mode, the pwm is moving to slow (1/65535v) to correct the drift. In that case. Push putton at power on to set to default.
If for any reason, satellites are lost or weak (below than 3), gps pulse will be lost too. So pwm value will be not changed anymore until pulse come back. OCXO will run by itself at last good eeprom value. On scope you wont see difference when pulse is there or not.
If you press button, uC will stop counting and you will see UTC time and localisation for 10 seconds.
Localisation is in Degrees and decimal minutes (DMM). This is how to enter this on google map:
46 19.81750 N 072 35.33259 W
If you want to erase the eeprom value and restart calibration, just push button and hold at startup.
Step 19: Conclusion
I hope you will enjoy this project. Questions, commentary are welcome English or French.