Below is the schematics of a circuit so far I finalized and soldered on a perfboard:

enter image description here (please left-click to enlarge)

Basically the circuit converts 0...10V input voltage to 10mV pk-pk square-wave. The goal is to obtain a linear relation between the output frequency and the input voltage. Since LM331 known as quite linear, I used it as a voltage to freq. converter. But when varying the freq., LM331 also changes the duty cycle a lot. That was a problem in ADC side at the output. So to overcome this and to obtain around 50% duty cycle a 74HC74 follows LM331 by halving the frequency. Halving freq. is no problem because it will not affect the linear relationship between the input voltage and output freq.

The circuit works fine both in simulation and in real. I mean it does the job at first look.

But if you wait enough you see a drift in freq. output(at Q or at Fout).

Here are some observations from yesterday for 2.5V constant input voltage:

At 17:00 o'clock 924Hz

At 18:00 o'clock 918Hz

At 19:00 o'clock 919Hz

At 20:00 o'clock 913Hz

At 21:00 o'clock 917Hz

At 22:00 o'clock 912Hz

And today after powering on the circuit with again 2.5V input I measure the freq. output as: 936Hz which keeps increasing to 945Hz ect.

Here is the circuit soldered on perfboard(I marked some ports and components with red color):enter image description here

What I have noticed is, when I touch slightly with my finger or a pencil to the capacitor C1 or C3 I see dramatic changes at the output. The other components do not make such difference in response to a physical interaction.

For C1 I'm using a ceramic capacitor as you can see in the photo.

In the data-sheet of LM331 C2 is recommended 1u Mylar capacitor which I use ceramic. But interacting it physically does not make such change as C1.

In another forum I found this comment(in the quote I modified his cap names to be consistent with my schematics):

Finally I solved it.

I used C1 = 10nF NPO (very stable with varying temperature) capacitor in place of C1 = 10nF X7R (high temperature coefficient). As my circuit contains lot of transistors and Transformer, due to increasing temperature, the frequency was gradually increasing, which doesn't happen now after changing it to NPO.

Also, I added 47 Ohm resistor in series with C2 = 100 nF capacitor, which increased the stability further.

Does anybody have experience or idea about the issue? The capacitor types and tolerances are critical for LM331 in this circuit, I would be glad to hear your suggestions on these.

  • \$\begingroup\$ How is Vcc (12V) derived? Is it unregulated? \$\endgroup\$ – sstobbe Jun 3 '17 at 14:30
  • \$\begingroup\$ NP0 ceramics are certainly preferred over other types - NP0 are hard to find with large value capacitance. You might balk at the size of polypropylene capacitors for C2, C1 but they should improve stability too. C3 should be less critical, as long as it doesn't leak DC current. (An ohmmeter should yield infinite ohms). \$\endgroup\$ – glen_geek Jun 3 '17 at 14:40
  • \$\begingroup\$ @glen_geek If I replace both C1 and C2 with NP0 would that be better? Sorry I didnt get what you meant by " You might balk at the size.." \$\endgroup\$ – user16307 Jun 3 '17 at 16:23
  • \$\begingroup\$ @user16307 Those polypropylene-film capacitors are far larger than ceramics. You can get 0.01uF NP0 (ceramic), but not likely 1.0uF NP0. \$\endgroup\$ – glen_geek Jun 3 '17 at 17:52
  • \$\begingroup\$ Ok so how about 10nF to NP0 and 1uF to Mylar? \$\endgroup\$ – user16307 Jun 3 '17 at 17:59

The temperature coefficient of the capacitor can have a profound effect on the accuracy and stability of the output. This is what the other thread that you quoted is referencing.

However, some of you data seems to suggest that you are getting noise into your circuit or that your input reference voltage has some fluctuation or that your method for measuring the frequency has some instability. If you haven't already done so, you should assess these error terms.

You may find it helpful to determine the Hertz/Volt transfer ratio and assess your variation in light of this. You may find that the output frequency variations may account for a very small input fluctuation. This could help you to track down the cause of the fluctuations.

| improve this answer | |
  • \$\begingroup\$ Oh so you mean I should also monitor the input voltage by a multimeter? \$\endgroup\$ – user16307 Jun 3 '17 at 15:24
  • \$\begingroup\$ Yes, that would be a good starting point. \$\endgroup\$ – Glenn W9IQ Jun 3 '17 at 15:25
  • \$\begingroup\$ The reason I didnt monitor was the 2.5V input was coming from a function generator's offset. And I could see the change in freq. second by second. But I will give a try to monitor the input as well. \$\endgroup\$ – user16307 Jun 3 '17 at 15:39

Ceramic capacitors have considerable temperature, voltage, and aging dependency. Even an NP0 would change by a few fractions of a percent (more than enough to justify what you are seeing).

If you want stability you need to move away from ceramics, I have found that mica capacitors are extremely stable in comparison. I once put together a 1000Hz linear oscillator with 0.1% precision and stability across +-20ºC variations for testing purposes. One year later it had moved by less than 0.1%. Even as I placed a soldering iron near the capacitor to see if it would move.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.