Go Down

Topic: Your opinion on an Arduino compatible frequency counter (Read 4263 times) previous topic - next topic

mrguen

Hello,

I have been designing an Arduino compatible frequency counter for quite a long time and built a prototype (see https://pandauino.com/en/arduino-compatible-frequency-counter/), but it does not seem to be exactly what the users are looking for. So I wrote a little survey. I hope it will catch your attention!

https://kwiksurveys.com/s/pF3sHUzz#/0

zoomx

On ebay there is a kit based on a project of a german guy.
Search for "50MHz 5 DIGIT CRYSTAL OSCILLATOR FREQUENCY COUNTER/METER DIY KIT"

mrguen

Yes I know his project. I saw his project page where he explains that it was copied by companies and that he didn't mind as long as the price was low. Indeed one can find it on ebay from many merchants at 10-20 dollars (kit). I don't say his design was bad, it was accepted by many people, but it is relatively old now.

What I propose is very different. It is not based on PIC but on Arduino compatible microcontroller. It is programmable with all the ports needed to communicate: SPI, USART, I2C and maybe USB. It has an LCD instead of LED digits, so of course it can display messages and it is much more readable. It can be powered by many sources and voltages and not only 5 volts. The input is protected... there are countless differences. You can see the full presentation on pandauino.com.

You can also find other Arduino compatible frequency counters (in kit or assembled) but I try to do something different and top level. Let me know your opinion if you have 5 minutes.

zoomx

Ok, you have explained better you project and shure! I had time for the survey!

mrguen

Thanks. I will try to change the design according to the wishes of the users. But at the moment I face a problem: from the data collected I should build 2 boards: one "simple" low cost and one with the best specifications possible. I will have to cut a deal. Also I considered moving to cortex m0 because it can be clocked faster but I have more people wishing an Atmega328 (the one in the actual design). What do you think about the comparison Atmega328 vs cortex m0?

zoomx

A cheap board already exists, the only difference is that it uses a PIC. But I believe that a Arduino kit  is interesting too, many people request Atmega328 because they can mod it. But I believe that there is a better solution.

There are kits that uses an STM32F103 that has alread an Arduino core (see http://stm32duino.com there are 3 cores!) for example the DSO138 cheap cheap oscilloscope. The MCU is also cheap and has 5volt tolerant pin but it is a Cortex-M3.
I believe that people that ask for an Atmega328 can use an STM32F103 too. STM32F103 is faster, has more pins, more flash, more ram and has DMA.

allanhurst

If using an arduino ( or any processor) be aware that the reference source is normally a ceramic resonator, and so will have poor accuracy (+/- 1% or worse ) and significant temperature drift.

If you want your readings to be better than this you need a better reference.

The more you pay the better they get.

 It's no good having a resolution and display of 6 digits if only the most significant 2 can be believed.



Allan

mrguen

A cheap board already exists, the only difference is that it uses a PIC. But I believe that a Arduino kit  is interesting too, many people request Atmega328 because they can mod it. But I believe that there is a better solution.

There are kits that uses an STM32F103 that has alread an Arduino core (see http://stm32duino.com there are 3 cores!) for example the DSO138 cheap cheap oscilloscope. The MCU is also cheap and has 5volt tolerant pin but it is a Cortex-M3.
I believe that people that ask for an Atmega328 can use an STM32F103 too. STM32F103 is faster, has more pins, more flash, more ram and has DMA.

Hello zoomx,

For what I saw until today with the 3 prototypes I built the processing capability of the Atmega328 is enough. Even thought the program tests a couple of things continually (like the power voltage) it does not impact the precision. So I don't really need to upscale the microcontroller. All the more that as you said, people know the Atmega328 and want it. After all this makes the board programmable as a UNO board.

Anyway I would consider upgrading to cortex m0 because 1) it has built in USB 2) It is clocked at 32 Mhz max or with PLL multiply up to 96 Mhz. This would give an advantage in time resolution for low frequency period measurement using FreqMeasure library. But I don't know if the PLL clock will be stable enough. I don't think so but I will try on an Arduino M0 board. Anyway 32 Mhz would still be a little better than 16 Mhz.

But, once again, from the first results of the survey, some people want the Atmega328, most don't mind and very few ask for the cortex m0.

A big problem I face is for amplifying the signal over the very broadband of 5Hz to 100 Mhz. This is different than the amplification problem of VHF or UHF narrow "band". I try to achieve this with only one circuit, otherwise it is going to be expensive, complicated and with a large footprint.

It is all the more complicated with a 5 v USB voltage source (from 4,75 v minus maybe a diode etc) so it really cannot power an amplifier in the tens of megahertz range (impedances in the few hundred ohms) and it draws some current.

All in all the first design is, I believe, good to very good but I didn't include a USB port considering this is not a board that would be programmed often and the SPI port would suffice. But it seems most users really like the concept of the USB port + power. This is the new big problem.




 

mrguen

To Allan: the Atmega328 has many clocking options. On most board it uses an external 16 Mhz crystal. This is what I use with a precision of 10 ppm frequency, 10 ppm temperature, 5 ppm aging. As you said this is a major source of error and here this is coherent with a 10-5 precision / resolution that I aim. Here again this precision or resolution is not that of a VHF/UHF counter in the 10-8. It keeps this performance in HF and LF ranges. From the comparison of theorethical to measured values I have done over the domain of sensitivity 177mV to 3.54 V and 5 Hz to 80 MHz precision and accuracy are better than  0.005%.

allanhurst

#9
Sep 14, 2017, 07:06 pm Last Edit: Sep 14, 2017, 07:06 pm by allanhurst
You can buy  3ppm crystals., external oscillators from 0.1ppm with VCTCXO's or better still  with ovens.
 Caesium standards if you pay enough. Parts in 10^10. Or derive off-air from eg BBC R2.

 For super wideband amplifiers look at oscilloscope front ends : often dc - >1GHz.

Allan

mrguen

At allan: an oscilloscope at 1 Ghz (I take the first result from google): https://www.distrame.fr/fr/catalog/Oscilloscope-numerique-4-voies-1-GHz-avec-memoire-4-MPts,58230.html 15.721 euros !

Regarding the crystal: I don't plan to use a 20 euros++ crystal in a device with a target price around 60 euros.

I will consider using a more precise cystal in the 1-2 ppm.

Also I don't consider adding an external auxiliary clock since this will be costly and complicated for the few people who would use it. It is because

* the power of the signal is important. The micro controller has different modes of operation "full swing" or "low power" crystal. Not respecting this will burn the chip.

* the capacitance is highly important. I use capacitances with 2% accuracy. These are 22pF and one must consider about 1 pf/ cm of trace and much more if there is a connector and a wire.

In conclusion one cannot simply replace a crystal by another or add any external clock even if it is an atomic clock. Here is an interesting video that shows how sensitive this is https://www.youtube.com/watch?v=KmZwAjmzHx8

allanhurst

Quote
15.721 euros!
Nice scope - but I'm not suggesting you buy it and strip out it's front end!

A typical front end has 2 fets as a diff pair, with a cross-coupled bipolar loads in a cascode circuit. This keeps the voltage swing on the fets at almost zero, and hence the fet capacitances ares not being charged/discharged ( this eliminates the 'Miller effect') and so  has a high bandwidth...


I'll see if I can rustle up a circuit diagram........

Allan

mrguen

Ok let me know if you have a circuit but one must also consider the consumption. It would need impedances under 100 Ohm. I don't want to waste 10 times more energy at low to high frequencies only to be able to reach 500 Mhz instead of 50 Mhz. In my opinion that is another type of frequency counter.

allanhurst

#13
Sep 15, 2017, 01:05 am Last Edit: Sep 15, 2017, 01:25 am by allanhurst
When I designed  pagers for production rates in the millions we bought accurate crystals from  NDK.  Nominally 2.5 ppm. They cost < 1Eu.

And then trimmed them on test against an accurate reference to get 0.1ppm.

The crystal circuit had a series wirewound inductor ( Coilcraft) of a few hundred nH and a variable capacitor (Murata) of a few 10's of pF to resonate around the crystal frequency. They could then be 'pulled' a little.

They then drifted about 0.05 ppm/year.

I'll get back to you aboout the preamp.

Allan

 

mrguen

Hi Allan,

I am now working to improve the performance of the frequency counter. Did you find the ultra wideband amplifier you wrote about?

Sincerely

Go Up