Can I use 18pf and 22pf capacitor for standalone arduino?

Hi! I know its recommended to use two 22pf capacitors and a crystal for making a diy standalone arduino. However, I only have one 22pf right now and ordering another one takes a bit more time. I have an 18pf though. I was wondering if I could use different values of capacitor to do a standalone arduino? Would that be ok? Thanks!

I dont know the accuracy spec of a 22pF cap but I'd be surprised if it was better than 20%
so an 18pF should be fine.

Sure... but you can also "make" your own caps... using kapton tape and copper tape:

From an ancient article I wrote for Hackster.io

Reprinted: Gimmick on Barebones Arduino 16MHz - ATMega32 AVR (atmega32-avr.com)

One?
Never order 1 of anything as cheap as capacitors, at least 10.

Did you know that you don't need a crystal or caps to make a DIY Arduino?

You can run the atmega328 on its internal 8MHz clock.

  • It's only half as fast as a 16MHz Uno, in theory. But in practice, arduino sketches spend almost all of their time waiting for buttons to be pressed or data to arrive or delay() to finish, so you will probably never notice the difference in processing speed.
  • It can run at 3.3V or 5V. 3.3V is great for battery powered projects powered by 3x AA/AAA or LiPo batteries for example.
  • You get 2 extra digital pins.

I would recommend using the MiniCore boards package if you go this way.

+1 for MiniCore.

It's not necessary to guess or ask. The capacitor values selection is well documented by the IC manufacturer.

Kind of a "which came first" problem: the microcontroller or the crystal.

Application note AVR042 gives some insight into crystal selection in section 5.2


Adafruit gives some insight on selecting the load-caps after a crystal is selected

A 12MHz crystal that I use quite a bit is the NX3225SA-12.000000MHZ from NDK. It’s a good size, stable (+/-15 ppm), and easy to find. I use the more expensive +/-15 ppm model for better input to the PLL, but if you don’t use the right capacitors along with the crystal your signal will never be anything remotely close to +/-15ppm and you may as well buy a much cheaper crystal.
So how do you know which capacitors to use? Easy. Every crystal datasheet lists something called the Load Capacitance (CL). In the case of the crystal above, it’s 8 pF. C1 and C2 need to match this Load Capacitance, with the following formula being the key:

Yes, right. It's matching the crystal, not the oscillator. I think in most cases, the crystals for a certain frequency are so close to each other in load capacitance, that typical values can be used safely. Some data sheets list those by crystal frequency range.

As some sections of the Adafruit docs that you posted imply, the main effect of the capacitance value (assuming it's in a reasonable range for guaranteed oscillation), is just the resonant frequency. That is illustrated by circuits that use a variable capacitance on one leg of the crystal circuit, to manually fine tune the frequency.

It is worth noting, a given manufacturer will usually break out oscillator design into a separate document than the data sheet, in an application note. It's definitely worth reading, no matter how you decide to make the choice.

1 Like

Once upon a time... K5LAD - 50+ Years of Ham Radio Memories (hayseed.net)

2 Likes

The proof is in the pudding. Put in you 18pf and if it oscillates then your fine (for now). I would change it to 22 pf when you have one, simply to be at the recommended value for (maybe) more stability in the future.

Thing is, if it's a PCB, desoldering can be a real challenge for a beginner. Hence my reference to "tack soldering". Hmmm. Well I thought I did, but I don't see it...

The idea is to attach the component with a minimum of solder, none in the hole if it's a through hole part. Only to the side of the pad. It only has to work for a few minutes while you test it. When you know for sure it works, apply heat and remove it, re-insert and permanently solder it.

It's especially frustrating to deal with the ground side of most such placements, because the ECAD uses the wave soldering paradigm by default, that heats the entire board, does not allow for adequate thermal isolation of ground and some other component pads. It makes it hard to hand solder and desoldering is worse.

Surface mount is easy to place and remove, except you will usually destroy the part while removing it. Luckily those parts can be purchased for about $1/100.

Huh. if you have an older/larger crystal, can you use it's case as the ground plane, and make a sort of three-legged crystal?

:crazy_face:

If I remember correctly, some the big ol' xtals often had ground wires already spot-welded to the case.

image

I often tack solder the case to a nearby ground, to make it a shield. Shoot me if I'm wrong. Sometimes if it's on a proto board, I will run a grounded bare wire over it, and tack to that.

Crystal manufacturers will supply a crystal case ground wire on request. That is useful in situations where the crystal will be subjected to vibration, as in mobile equipment.

Yes, I've seen the ground wires. I want to know if I can wrap some kapton tape and copper around the case, connected to the other leads, to get enough capacitance...

That makes me think that you want to learn how to design and build small value capacitors, a great engineering project! It that case maybe you want to use a resonator instead, since they have the caps built in.

I don't know if anyone has ever tried, but with a multilayer board, you could probably make 15pF or so caps out of PCB conductor planes.

That is an interesting idea, also.