レビューメディア「ジグソー」

少し風が弱いです…。

サイズ比較
サイズ比較

とあるラジコン専門店で見つけた掘り出し物です。

お値段290円なり。

ラジコンでも内部のICが発熱する用途のために、その冷却手段として使うパーツのようです。

ラジコンで発熱するといったらやはりモータードライバとか無線通信部分でしょうか、生憎筆者はラジコンには詳しくないのでそこらへんわかりかねます…

で、コイツをRaspberry pi


のCPU冷却に使おうと思い、購入しました。

Rating: DC5V, 0.09Aと表記されているので、5V, 90mAですか…。

GPIO経由で動かすには厳しそうです。

一応GPIOの5V端子とGND端子に接続したら回転するのですが、風力が弱いです。
別電源を使う必要がありそうです。

冷却ユニットのフローチャート
冷却ユニットのフローチャート


プログラム。
プログラム。

プログラムまで書いて、GPIOとファンを接続し、動かしてみたのですが、肝心のファンが駆動せず、困っている状態です…。へるぷみー。(2回目の他力本願)

以下にプログラムソースをば。
/* Raspberry pi CPU cooler.
// Author : 2014 A.Fujimoto
// Needs more DC current power for rotate the fan?
*/
#include<stdio.h>

char buf[6]; // input buffer.
int raw_temp; // and then store the value to this variable using atoi().
const int thr_temp = 60000; // warning temperature threshold value.

// read temperature.
main(int argc, char *argv[]){

raw_temp = getCPUtemp();
printf("%d\n",raw_temp); // debug print.

// This will determine whether your CPU is over threshold value or not.
if (raw_temp >= thr_temp){
printf("\nThe temperature of this CPU is high, will now cooldown. (>_<;)\n");
cpuCool();
}
printf("\nThe temperature of this CPU is nominal. (^-^)b\n");
}

int getCPUtemp(){
FILE *fp;
fp = fopen("/sys/class/thermal/thermal_zone0/temp","r"); //original.
// fp = fopen("./temp","r"); // for debugging use, so remove this line.
fgets(buf, 6, fp);
fclose(fp);

int temp = atoi(buf);
return temp;
}

cpuCool(){
// system("sudo sh ./test.sh"); // determine which statement to use.
while (raw_temp > thr_temp){
system("sh ./fanon.sh"); // write a shell script for CPU cooldown.
raw_temp = getCPUtemp(); // original code. uncomment to get real CPUtemp.

/* debug */
// raw_temp-=100;
printf("raw_temp : %d\n",raw_temp);


/* debug block end. */

}
system("sh ./fanoff.sh"); // determine threshold end.
} // cpuCool method end.



----------------- fanon.sh --------------------
#!/bin/sh
echo 'cooling...'
#Write a code for cooling your CPU!
#e.g. turn on a CPU fan for several seconds via GPIO on your Raspberry Pi.
sudo su
echo 24 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio24/direction
echo 1 > /sys/class/gpio/gpio24/value ## turn on fan.

#End of file.


----------------- fanoff.sh --------------------
#!/bin/sh
echo 'stopping...'
#Write a code for cooling your CPU!
#e.g. turn on a CPU fan for several seconds via GPIO on your Raspberry Pi.
sudo su
#echo 24 > /sys/class/gpio/export
#echo "out" > /sys/class/gpio/gpio24/direction
echo 0 > /sys/class/gpio/gpio24/value ## turn off LED.
echo 24 > /sys/class/gpio/unexport ## gpio clean.
  • 購入金額

    290円

  • 購入日

    2014年06月20日

  • 購入場所

13人がこのレビューをCOOLしました!

コメント (0)

ZIGSOWにログインするとコメントやこのアイテムを持っているユーザー全員に質問できます。

YouTube の動画を挿入

YouTube の URL または動画の ID を入力してください

動画の ID が取得できません。ID もしくは URL を正しく入力してください。

ニコニコ動画の動画を挿入

ニコニコ動画の URL または動画の ID を入力してください

動画の ID が取得できません。ID もしくは URL を正しく入力してください。

ZIGSOWリンク挿入

検索対象とキーワードを入力してください

    外部リンクを挿入

    リンク先の URL とタイトルを入力してください

    URL を正しく入力してください。

    画像を挿入(最大サイズ6MB)

    画像を選択してください

    ファイルサイズが6MBを超えています

    別の画像を追加

    ZIGSOW にログイン

    ZIGSOW会員登録(無料)はこちらから