Nanocounter: Frequency Counter With An Android UI

Have you ever started a project, run into an issue, started a new project to solve the issue, and completely forgot about the original project? [Andy] went down a rabbit hole of needing a tool to calibrate an MCU oscillator, but not having an accurate way to measure frequency. Most people would just buy a frequency counter and be done with it, but [Andy] decided to build his own.

The Nanocounter is an accurate, open source frequency counter that uses an Android phone as its display. It’s based on a high accuracy temperature compensated crystal oscillator (TCXO) fed into a phase locked loop (PLL) to create a high frequency, accurate reference clock.

This reference clock, along with the signal to be measured, are sent into a Xilinx FPGA which uses a method called equal precision measurement to determine the frequency. A STM32F072 microcontroller uses a SPI interface to get this data out of the FPGA, and controls the whole system. Finally, a cheap HC-06 Bluetooth module facilitates communication with an Android device.

The project achieves the goal of frequency counting, though [Andy] doesn’t remember what project sparked the idea to build it. (Classic yak shaving!) But the result is a great read of a detailed writeup, and you can watch a video of the Nanocounter in action after the break. That’s a win in our book.

9 thoughts on “Nanocounter: Frequency Counter With An Android UI

  1. I thought about a similar project, combining a frequency counter and synthesizer, clocked by a rubidium frequency standard.
    But after some experiments with Bluetooth and Android, I decided that it’d be too fiddly and unreliable, so I used a simple hardware user interface.
    I was planning to equip it with a touch LCD later, but never found the time to do this.

    Nice to see that Andy did it with Android, but I personally prefer monolithic lab hardware, that keeps working even after Google has upgraded to Android X.

    1. I agree. Bluetooth, FPGA, 32-bit CPU, and an Android phone, just for a frequency counter. Way to over-design! The user interface does look nice, though. I just looked at the project on which the $15 frequency counters found on the usual sites are based:

      This is the “bare circuit board” Andy mentions as being the low end of the range of counters out there. It uses a PIC 16F28 and very little else. I think if I was going to build a counter, I’d lean more toward the PIC end of the scale than the FPGA.

    1. The devil is in the details…
      It’s shown measuring a 16MHz clock in the picture, but the frequency meter you’ve linked to has a minimum frequency of 27MHz, so not exactly suitable for the stated need.

  2. I used to think that the future of every project that I make would end up using my phone as the UI because displays were expensive. Then.. before I even really got around to learning Android programming touch LCDs became cheap! :-)

    1. The phone manufacturers saw you as a threat, they don’t want people using their $5 phones for non profitable (i.e. non data transmitting) use. So, they artificially dropped the price of the touch displays to preserve their ability to recover the actual phone costs in the data markets.
      And you thought you were just paranoid!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.