Author Topic: need a small accurate 100Hz oscillator  (Read 27723 times)

0 Members and 1 Guest are viewing this topic.

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
need a small accurate 100Hz oscillator
« on: January 04, 2014, 11:50:52 pm »
nearly finished with my current project. only thing missing is... well, the most important part. i need a time base for my .01sec timer to trigger on (100Hz triggered on the falling edge)

ive tried various types of r/c circuits, but none have had any kind of reasonable accuracy. i dont think im asking for much, but the best ive managed to build, id tune to 100Hz, and within 5 min was already out by over 10%. i tried letting it run for an hour to "stabilize" and then calibrated it, but the results were practically the same.

ive tried going the crystal route, but any simple, low part xtal osc ive tried i cannot get to work, and any ive got to work have been far too large, especially considering all of the extra circuitry id need to divide the signal down to 100Hz afterwards.

ive got both +9vdc battery and a regulated 5vdc power available as power sources.  itd be super to get it to fit on a piece of perfboard 10 holes x 10 holes, but i can go slightly larger and still fit in the enclosure.

im open to ideas.
 

Offline casper.bang

  • Frequent Contributor
  • **
  • Posts: 311
  • Country: dk
  • Pro SE, amateur EE.
    • BangBits
Re: need a small accurate 100Hz oscillator
« Reply #1 on: January 04, 2014, 11:55:44 pm »
Too bad you are in the US. In Europe I would've tapped into the DC supply after rectifiers before capacitor.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: need a small accurate 100Hz oscillator
« Reply #2 on: January 04, 2014, 11:56:59 pm »
would a real time clock chip be possible? a number of those give outputs of 1000 or 1 pps, there may be one that can do your magic 100,
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #3 on: January 05, 2014, 12:01:57 am »
With a little micro, you can easily program it to do that.

A more complex solution would be a crystal + counter (HC4060 for example).
================================
https://dannyelectronics.wordpress.com/
 

Offline Frost

  • Regular Contributor
  • *
  • Posts: 170
  • Country: de
Re: need a small accurate 100Hz oscillator
« Reply #4 on: January 05, 2014, 12:39:19 am »
What's with the Maxim DS3231 together with an HC4017?

The DS3231 delivers a very accurate 1kHz square wave
signal at it's SQW output Pin and with the HC4017
you can divide it by 10
But as a con the DS3231 requires a microcontroller to
handle the I2C setup routine and it's not so small.
 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #5 on: January 05, 2014, 12:57:40 am »
for the frequency division, i actually already had this in mind:

http://www.leapsecond.com/pic/picdiv.htm

simple 8 pin dip, no external components. all the hex code is right there so i can cook one myself, or buy one if i choose.

but that still leaves the signal to feed into it...

im absolutely 100% stupid afa micros. i have a cheap programmer that i could never get to work because you could only use the hex code (^^^ above website has hex code files!!!!  :-+ ) and i JUST bought a pikkit 3 (JUST, as in it came in the mail thursday) so as far as the micro solutions go, please feel free to talk down to me like im an idiot. afaik, arduino can run independently after programming with just an xtal and a cap, but the only ones ive seen were huge 20 pin+ packages. if there is some other way to skin this cat, im all ears.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #6 on: January 05, 2014, 01:10:11 am »
Quote
but that still leaves the signal to feed into it...

You sure can feed it something but don't need to: the micro can run on either its internal rc oscillator, or an external crystal (+internal oscillator). It can generate a 100Hz signal stand-alone, with the right code: all it needs is to count 1000000/100/2 = 5000 pulses from its interal 4Mhz oscillator, and then flip a pin.

Fairly simple code.
================================
https://dannyelectronics.wordpress.com/
 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #7 on: January 05, 2014, 01:27:21 am »
Quote
but that still leaves the signal to feed into it...

You sure can feed it something but don't need to: the micro can run on either its internal rc oscillator, or an external crystal (+internal oscillator). It can generate a 100Hz signal stand-alone, with the right code: all it needs is to count 1000000/100/2 = 5000 pulses from its interal 4Mhz oscillator, and then flip a pin.

Fairly simple code.

so your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.
 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #8 on: January 05, 2014, 01:29:32 am »
especially if the hex code already existed and was easily available for it.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: need a small accurate 100Hz oscillator
« Reply #9 on: January 05, 2014, 01:58:48 am »
so your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.

You will get about 1% accuracy from a PIC12F675 internal RC oscillator. More like 2% with temperature and supply voltage spread.

The chip can be used with an external crystal or ceramic resonator if you need better.

I would be surprised if you could find exactly the code you need.
 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #10 on: January 05, 2014, 02:02:17 am »
so your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.

You will get about 1% accuracy from a PIC12F675 internal RC oscillator. More like 2% with temperature and supply voltage spread.

The chip can be used with an external crystal or ceramic resonator if you need better.

I would be surprised if you could find exactly the code you need.

an oscillator that would stay between 98 and 102Hz indefinitely would be fine for my purposes. with my r/c trials i was deviating beyond that after less than a minute of operation. 
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: need a small accurate 100Hz oscillator
« Reply #11 on: January 05, 2014, 02:36:41 am »
an oscillator that would stay between 98 and 102Hz indefinitely would be fine for my purposes. with my r/c trials i was deviating beyond that after less than a minute of operation.

You were doing something wrong. You should be able to get 1% stability from a 555 timer oscillator if you use a stable capacitor type. If you are not going to use a crystal a 555 would be a simpler solution than a PIC, however, you would learn less.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4700
  • Country: au
  • Question Everything... Except This Statement
Re: need a small accurate 100Hz oscillator
« Reply #12 on: January 05, 2014, 02:58:37 am »
by chance what capacitor where you using? if its a ceramic or electrolytic i can see it drifting like mad,

try a film cap, if you pick a capacitor with a good enough temp and voltage tolerance i could see reaching 0.1% easily,
 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #13 on: January 05, 2014, 06:04:10 am »
by chance what capacitor where you using? if its a ceramic or electrolytic i can see it drifting like mad,

try a film cap, if you pick a capacitor with a good enough temp and voltage tolerance i could see reaching 0.1% easily,

didnt even bother trying a 'lytic, didnt have any polypropylene on hand. other than that, all of them. ceramic, tantalum, polyester, ect.. best results was a dipped metal polyester film and one of those little box caps (they are all metalized polyester too, right?)

i might be mis-remembering how quickly it drifted, but it wasnt an exaggeration. im tempted to board it back up and test again.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #14 on: January 05, 2014, 07:15:55 am »
so your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.

You will get about 1% accuracy from a PIC12F675 internal RC oscillator. More like 2% with temperature and supply voltage spread.

The chip can be used with an external crystal or ceramic resonator if you need better.

I would be surprised if you could find exactly the code you need.

I would use a PIC10F200... it's less than 0.60 USD and also has a ±1% accurate internal RC oscillator.

A 555 is generally cheaper, at less than 0.40 to 0.50, but when you consider you need to add a stable cap to it, it is a solution with more components and maybe now exceeds the area and price of a standalone PIC10F200.
« Last Edit: January 05, 2014, 07:18:52 am by codeboy2k »
 

Offline owiecc

  • Frequent Contributor
  • **
  • Posts: 317
  • Country: dk
    • Google scholar profile
Re: need a small accurate 100Hz oscillator
« Reply #15 on: January 05, 2014, 09:02:59 am »
by chance what capacitor where you using? if its a ceramic or electrolytic i can see it drifting like mad,

try a film cap, if you pick a capacitor with a good enough temp and voltage tolerance i could see reaching 0.1% easily,
I remember Dave saying in one of his videos that certain types of caps have NTC and other PTC behaviour. Conecting the two in parallel woulc compensate the cap drift.
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: need a small accurate 100Hz oscillator
« Reply #16 on: January 05, 2014, 09:05:13 am »
an oscillator that would stay between 98 and 102Hz indefinitely would be fine for my purposes. with my r/c trials i was deviating beyond that after less than a minute of operation.

You were doing something wrong. You should be able to get 1% stability from a 555 timer oscillator if you use a stable capacitor type. If you are not going to use a crystal a 555 would be a simpler solution than a PIC, however, you would learn less.
I agree, what you are doing wrong is to use a bipolar 555 and not a Cmos 555. (TLC555 for example.)
 

Offline Jon86

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: need a small accurate 100Hz oscillator
« Reply #17 on: January 05, 2014, 11:14:45 am »
Pic with a crystal. If not Pic then almost any other micro should be fine too, but having a crystal in there is going to significantly increase the accuracy.
Death, taxes and diode losses.
 

Offline Strada916

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: au
Re: need a small accurate 100Hz oscillator
« Reply #18 on: January 05, 2014, 11:35:09 am »
Go to youtube and search the channel  w2aew then look at one of his videos called "Build a crystal oscillator from schematic thru prototype construction and testing - DIY" youtube is blocked from where i am typing this.

Then all you need to do is find a suitable crystal and a divide by chip(s).

eg A crystal at 1MHz can be divided down to 100Hz with 4 x 4017 daisy chained.  >:D That might be a high ic count though



The Bone, the Off-White, the Ivory or the Beige?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #19 on: January 05, 2014, 11:49:30 am »
Quote
with a 12f675, and NOTHING ELSE, i can get a stable accurate signal?

Yes.

================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #20 on: January 05, 2014, 11:51:24 am »
555: you can also configure a mcu into external rc oscillator (which would be identical to a 555). But why bother if better alternatives exist?
================================
https://dannyelectronics.wordpress.com/
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: need a small accurate 100Hz oscillator
« Reply #21 on: January 05, 2014, 12:17:15 pm »
nearly finished with my current project. only thing missing is... well, the most important part. i need a time base for my .01sec timer to trigger on (100Hz triggered on the falling edge)

ive tried various types of r/c circuits, but none have had any kind of reasonable accuracy. i dont think im asking for much, but the best ive managed to build, id tune to 100Hz, and within 5 min was already out by over 10%. i tried letting it run for an hour to "stabilize" and then calibrated it, but the results were practically the same.

ive tried going the crystal route, but any simple, low part xtal osc ive tried i cannot get to work, and any ive got to work have been far too large, especially considering all of the extra circuitry id need to divide the signal down to 100Hz afterwards.

ive got both +9vdc battery and a regulated 5vdc power available as power sources.  itd be super to get it to fit on a piece of perfboard 10 holes x 10 holes, but i can go slightly larger and still fit in the enclosure.

im open to ideas.

Make a modification of this for example.
http://www.leapsecond.com/pic/picdiv.htm
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2906
  • Country: gb
Re: need a small accurate 100Hz oscillator
« Reply #22 on: January 05, 2014, 12:31:03 pm »
Quote
eg A crystal at 1MHz can be divided down to 100Hz with 4 x 4017 daisy chained.  >:D That might be a high ic count though

Does seem a little high, but a PIC seems to be overkill somewhat, though being able to do it all in an 8 pin package does seem attractive.

A 1.6384MHz crystal and a CD4020 would do the trick. The only snag is that 1.6384MHz crystals aren't especially common - though a Google did turn up a couple of small suppliers in the UK. 3.2768MHz is much easier to find but the 4020 is only 14 stages so can divide by 16384 max.

A 3.2768MHz crystal, a 4020 and the d-type of your choice would fit the bill nicely.
 

Offline jolshefsky

  • Regular Contributor
  • *
  • Posts: 227
  • Country: us
    • Jason DoesItAll
Re: need a small accurate 100Hz oscillator
« Reply #23 on: January 05, 2014, 01:09:13 pm »
ive tried various types of r/c circuits, but none have had any kind of reasonable accuracy. i dont think im asking for much, but the best ive managed to build, id tune to 100Hz, and within 5 min was already out by over 10%. i tried letting it run for an hour to "stabilize" and then calibrated it, but the results were practically the same.

I was just thinking your RC oscillator may get so much drift from the type of capacitor. I was looking for a good cap to use for a rather tight filter application, and did some reading and found you can get very stable capacitors that use the NP0 ceramic with a C0G rating. According to the Wikipedia article, "an 'NP0' capacitor with EIA code 'C0G' will have 0 drift, with a tolerance of ±30 ppm/K". The NP0 ceramic also doesn't change with age:


Using a CMOS inverter RC ring oscillator, you can get the capacitor pretty small since the input impedance is so high. For instance, a 0.1µF and 1M? resistor, trimmed as needed, will get you 10Hz.

May your deeds return to you tenfold.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #24 on: January 05, 2014, 01:30:28 pm »
Rc oscillators are not very stable, particularly in terms of phase.

if you are not pressured for time, I can write a short piece for 12f675 to generate the pulse, plus allows voltage running - making the chip a vcxo.
================================
https://dannyelectronics.wordpress.com/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf