Mr RB
Well-Known Member
...
A second process is used to convert that result to picofarads;
(9195399*100)/scale = 919539900/919 = 1000587
1000587 is then displayed as; 10005.87 pF [/I]
I don't understand what "scale" means, or why you multiply 9195399 * 100. What does the 100 represent?
"Scale" is scaling from time measurement units to picofarads. It depends on your time unit size, and your charge/discharge impedances (resistor values).
The 100 enlarges the number from 9 million to 900 million, giving much more accurate math when the next process is a division.
...
I was also wondering where you take into account the 10k resistor? What if I used a different value resistor...
...
The simple way to approach it is to assume that the time period from the oscillator is proportionate to the capacitance. Basically you measure and add multiple period samples to increase the accuracy, then you multiply the number with a constant to give a very large number (but that still fits within a 32bit signed or unsligned long variable), then you divide by the scaling factor (which converts from time units to picofarads).
In your case the scaling factor will be found the easiest by measuring some 1% tolerance caps and doing it empirically rather than trying to calc it and still needing to tweak it empirically later.
...
I notice your website is not update quite as often as it used to be. Do you just not have many new projects going or not have the time to update your website with them?
...
Thanks for the nice words about my hobby site, yes I do miss the hobby projects and have a few fun ideas going in the background but unfortunately have too little time at the moment to complete them and write up the page. I'll make some time sooner or later.
Last edited: