Pages: [1]   Go Down
Author Topic: Arduino as a frequency meter (counter)  (Read 1695 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I'm messing around with quartz crystals and I wanted to try to measure their frequency using the arduino.

I found this page,

http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/

and I've tried hooking a crystal to the F_in point in the second schematic, leading it directly to an input on the 74HC14. I'm using 74HCT14, but I don't think that this will be the problem that I can not get any reading out.

The other lead of the crystal is connected to ground. Maybe I'm doing something wrong ? In the picture the guy is measuring a frequency off a crystal, I'm aiming to do the same.

Any ideas on what I might be doing wrong ?

Thanks in advance,
Aleks
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

My best guess is that your crystal isn't oscillating - what speed is the crystal supposed to be (its best when testing a circuit like this to use a known speed device that you know is working)? The author does note that 8 MHz is about the maximum input frequency - if your crystal is working, and is greater than 8 MHz, that could be the issue...?

The thing about his circuit (his breadboard/protoboard) is that on the board are two caps, but the actual circuit only shows a singular cap. Now, he could be using those in parallel or something to get the proper size shown on the schematic, but it isn't clear. Also, I wonder where the loading capacitors are (or are those the ones shown, and if so, where is the one in the schematic then?); most crystal oscillator circuits I have seen (I am not an expert, keep that in mind) have a couple of smallish capacitors (18-22pF, IIRC) on each leg of the crystal, leading to ground (once again, IIRC).

You might try contacting the author...
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have several crystals below the 8 MHz threshold. and none of them are showing any results. The capacitor there is I think just to filter the supply to the IC, I've tried it with the cap and without the cap, nothing seems to be doing anything.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I fixed the problem using the solution found here :

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1261940115

Now the problem is that on the serial output I'm getting random number that aren't even close to the xtals's real frequency. Even when I only hold a wire connected to pin 5 it displays random data.
Logged

Pages: [1]   Go Up
Jump to: