ちょっと1/fゆらぎに興味があったので、それを応用した電子ランタンを作ってみました。回路は非常に簡単で単にAVR Tiny26でLEDを駆動してるだけです。電球色LEDと黄色LEDを個別の計算式で駆動しています。ただ、手持ちの黄色LEDが電球色に比べてとても暗かったので、黄色の効果は定かではありません。

プログラムでやってることも非常に簡単。こちらのサイトで見つけた、以下のような簡易1/f計算式を使いました。

X(t)<0.5の時
X(t+1) = X(t) + 2 * X(t) * X(t)

X(t)≧0.5の時
X(t+1) = X(t) - 2 * (1-X(t)) * (1-X(t))

ただ、このままでは、演算が凍り付いてしまうことがあるので、ちょっと手をいれてます。

I am interested in 1/f fluctuation. So I made an electronic lantern based on 1/f fluctuation algorithm. The circuit is very simple. An AVR Tiny26 drives LED's. I used incandescent colour and yellow LED's. They are driven by two independent calculations. The yellow LED's in my hand are quite dim comparing to the incandescent one. So I am not sure how this two colour scheme is effective.

The program is quite simple. I used simplified 1/f algorithms as below found in a Japanese web site.

If X(t)<0.5 then
X(t+1) = X(t) + 2 * X(t) * X(t)

If X(t)≧0.5 then
X(t+1) = X(t) - 2 * (1-X(t)) * (1-X(t))

I made small changes to prevent freezing of calculation.

Making circuit was quite easy, but a case for it was another story. I used a paper box that used to contain Japanese sweets.

回路を作るのは何てことないんですが、入れ物の方が大変そうです。かみさんに、なんかいいものないかと聞いたら、こんなものを出してきてくれました。両口屋是清の和菓子の入っていた紙の箱です。

I installed four AAA rechargeable batteries in the box and sticked the PCB on the lid by double sided tape.

箱の中に単四の充電池4本をいれ、蓋の外には基板を両面テープで貼り付けました。

The PCB is fed through contacts made from 0.05mm copper foil. These contacts work as a switch.

給電は箱の外側と蓋の内側に貼り付けた、0.05mmの銅箔を介して行うことにしました。これはスイッチも兼ねています。

I made a shade from Japanese paper.

シェードは障子紙で作りました。なんかミサイルのノーズコーンみたいだなー。

Finished lantern. Look at this movie to see how it works.

出来上がりです。どんな感じに光るかと言うと、この動画をごらんください。

デジタルで、1/fゆらぎを発生させると当然、演算ビット数に従った周期性を持ちます。16bitで演算をしているので、周期はかなり短いです。10秒くらいかな?演算ビット数を増やすとか改良の余地はありそうです。

これ、焚き火やボイラーの焚き口の灯りに使えそうですね。

実際のプログラムはこちらをご覧ください。 このなかに入ってないInclude ファイルはソフトライブラリからダウンロードできます。

ソフト改良:
演算ビット数を31ビットに変更しました。その結果、周期性は有るかどうか全くわからなくなりました。ゆらぎが激しすぎるみたいなのでローパスフィルタもつけてみました。かなりいい感じになったと思います。プログラムは改良版に差し替えました。

Look at here for program source code. Included files can be downloaded from software library.

1/f fluctuation digitally synthesised has inevitable periodism based on the number of bits used. In this case I used 16 bits and the period of the pattern is not so long. Say about 10 seconds. This may be improved by increasing the calculation bit number.

Anyway this circuit may be good to simulate a bonfire .

Software Improvement:
I improved calculation resolution from 16 bit to 31 bit, and no periodism was seen. Also I felt the fluctuation was too harsh, and installed a low-pass filter to the output.


 

 
inserted by FC2 system