| Electronics > Projects, Designs, and Technical Stuff |
| Using ESP32 and Neo-7N for precise frequency measurement |
| (1/11) > >> |
| edigi:
I've found some older topic where both ESP32 and Neo-7N was mentioned but scope was rather signal reference than measurement so I've decided to create this topic. After trying some cheap ready built OLED frequency meters from e-bay and from elsewhere (all were basically crap, not coming even close to a device using a half decent TCXO) I've decided to build one by myself. ESP32, which I was familiar from other projects, looked as a good candidate and also found some examples about the PCNT usage and using RMT for gating. I've had naturally some reservations about how good clock source ESP32 can have to use RMT for gating but nevertheless it was easy to check. (As prescaler currently I use Fujitsu mb506, the leftover of the OLED meter, but plan to extend the range with HMC434.) Result: ESP32 clock drifts something like 2ppm within 15 minutes from cold start in a stable temperature room. Certainly better than the OLED variant that I've bought, but still not good enough even for my hobbyist use, and although I'd like to build something cheap, I'm still willing to invest a bit more to make it better. So I've looked for a better gating source and found that Neo-7N gives out a high precision 1 sec period pulse signal by default. The pulse is 100ms and there is 900ms low value. To keep things simple I could directly use this with ESP32, use the 900ms low (negative) value as gate and process the measured counts in the remaining 100ms time. There is a big question though that I've found no answer so far and I have nothing to check this (not even the GPS module, let alone any capable measuring device). So I understand that the period of the pulse is high precision but how about the 100ms/900ms division or other words has the 90% duty cycle similar precision as the period? Has anyone experience with this or could check please? |
| edigi:
I've tried to check an answer to my question in various threads in eevblog and what I've realized that quite many people are planning to build (or has already built) their own GPSDO (many of which is based on some Neo GPS variants). I don't know what are the precision expectations, but if one does not need very high precision that is the simplest case 0.01ppm (10 ppb) is sufficient or in a more demanding case 0.001ppm (1 ppb) a very simple setup can do it (so it makes me wonder why no-one has come up with the idea, or what are the pitfalls). So to ramp up some interest let's see the bill of materials: ESP32: ~7 USD Neo 7N: ~12 USD (you could use also the cheaper 7M) AD9834 DDS board: ~15 USD (in the more demanding case AD9910 but there is a diminishing return since AD9910 is not so cheap) So core material is in the magnitude of ~35USD in the simplest case + probably some TFT display+rotary encoder etc. where you mileage may vary. So basically instead of building a tailored PLL with special loop filter simply measure the frequency of the output of the DDS using the GPS for gating and after some digital filtering (in simplest case some averaging of the successive frequency measurements) the ESP32 can easily adjust DDS as needed to compensate for the error of the DDS reference clock source (that can be done in case of AD9834 with 28 bits precision, for practical purposes actually one bit less/nyquist theorem). Since the ESP32 can measure up to 40MHz out of the box (there is only 15bit for counting, but on overflow an interrupt can be generated so counting can use as many bits as you wish) it's quite good match with the AD9834. Since prescalers (obviously) cannot increase the precision of the measurement, (gating) period must be extended to at least 3 sec for this use case even with AD9834 (ten times more with AD9910). This design has the advantage that you can set arbitrary frequency reference (hence the rotary encoder) as after all that's the purpose of DDS and can have e.g. both sine and square right out of the box (depending on the DDS with very little phase noise + various extras that's available in the DDS). The disadvantage that without the GPS assistance the built in XO is probably very far behind an OCXO and is even probably well behind a good TCXO (I have checked this with ADF4351 of which I have 2 different designs, even the better one is only 2ppm and the worse is something like 10ppm). However even with occasional (self) "calibration" with the GPS reference (so after all it's not necessary to connect the GPS all the time if less precision is OK, calibration offset can be saved to flash) the long term stability can be improved even probably beyond a good OCXO. So what do you think? Note: I used ADI products in my description (basically as example) as those are that I'm familiar with but this does not mean that you could not use many similar products as well (so as short disclaimer: I don't have any affiliation with ADI or any other vendor). |
| ArthurDent:
I see a lot of buzz words and part numbers being thrown around but I'm not sure I see any real application information to connect any of this stuff together to make a working system. I wish you luck. |
| hamster_nz:
I have a vaguely similar interest in making this sort of project (if only because i have most the parts lying around), and would be quite interested in playing along at home with your build. However, I wonder if people have a real use for a 10 ppb reference. I could see it being handy for checking calibration, but that is about it. Most of the world seems to be built on +/- 1% for most specs, and maybe +/-50ppm for frequency (about that of a cheap XTAL) What are you going to do for an antenna? Fun fact #1 - the clocks on-board the GPS Space Vehicles are not super-accurate in terms of absolute time keeping or frequency, but they are very predictable. Each Space Vehicle transmits the coefficients for a polynomial equation, that is used to map the on-board time to back to the GPS time standard, for the current few days. Fun fact #2 - GPS time also has been known to be break: http://insidegnss.com/news/gps-experiences-utc-timing-iif-satellite-launcher-problems/ |
| DimitriP:
--- Quote ---So what do you think? --- End quote --- You seem to describe something that resembles this: http://www.knology.net/~gmarcus/VFO/GPS_Sig_Gen_v1_1.pdf |
| Navigation |
| Message Index |
| Next page |