nobcha23の日記

PICマイコンやArduinoを使う電子回路遊びを紹介します

Arduino C meter 2 充電時間計測のCメータ to measure charging time( time constant ) by using the internal resister of Arduino 1/3

「アナログポート浮遊容量を利用したコンデンサー値測定法」を試しましたが、電解コンなどの大容量には向いていません。

そこで、コンデンサー充電時間(時定数)をATmega内のプルアップ抵抗を使い測れないかと試してみました。
pinMode(DIGITAL_WRITE_PIN, INPUT_PULLUP);コマンドでPULLUPを指定した時に内部で接続されるであろう抵抗です。WEB情報だと大体10~30kΩあるとのことです。

inside

それで測定アプローチですが、次です。
1. 標準C(充電時間とADCのサンプルレートを勘案し104を使った)を付けて、測定値から内部抵抗値を計算。
2. 覚えておいた内部抵抗値から試験Cの充電時間を計測して、容量値を計算。

I had reported "C meter refered with stray capacitance of Arduino MPU nodes" ever. That can measure small value. This time I tryed the other way to measure charging time( time constant ) by using the internal resister of Arduino. We can use it as command of pinMode(DIGITAL_WRITE_PIN, INPUT_PULLUP);. Someone said the value is 10 - 30 k ohm.

My approach is next.
1. To calibrate by the standard capacitor and draw the value of the internal resister of Arduino.
2. To calculate with gotten time constant of RC circuit.

接続概念図は次です。The block diagram is here.

ところが、内部抵抗値が安定しません。推定ですが、どうも他の端子状態の影響を受けるようで、15-30KΩの範囲で変化します。But in vain the experiment was no use. the internal resister of Arduino may not be stable.

ここで方針変更。充電用の抵抗2.2MΩは外付けにします。 I changed plan to add 2.2mega ohm outside.

こんな構成です。The block diagram is here.

2.2Mohm added

前回の「アナログポート浮遊容量を利用したコンデンサー値測定法」の時、ポートの浮遊容量が30pFぐらいはあるとのことでしたが、今回は測定用アナログポートと充電放電用ポートも並列につながり、もっともっと容量は多そうです。I got the data of open circuit and it is about 100pF because there are two nodes tied.

で、被試験コンデンサなしの時の表示です。なんと100pFあります。>

no CAP