今日はモータを使った実験をします。
モータは使用する電流が多いため外部電源より供給します。
また、モータを動かす時に発生する逆起電流の対策として「ダイオード」を使います。高い逆起電流が発生するとFETを壊してしまうようで、この回路が必要らしいです。
必要部材
-
- Arduino Uno本体
Arduino Uno Rev3 ATmega328 マイコンボード A000066
新品価格
¥2,500から
(2020/8/15 10:49時点) - Arduinoではなく互換機(安価)を使う場合
- Arduino互換機
※IDEで下記設定変更をすると使えます。
詳しくはhttp://u-style.info/2020/08/14/arduino演習記録01-ide環境を作る統合開発環境の構築)/
- Arduino互換機
- ブレットボード
HiLetgo・ 5個セット 400穴 ミニブレッドボード 実験用ボード 8.5*5.5 CM ニューブレッドボード [並行輸入品]
新品価格
¥870から
(2020/9/5 16:24時点) - ジャンパーワイヤー
ELEGOO 120pcs多色デュポンワイヤー、arduino用ワイヤ―ゲ―ジ28AWG オス-メス オス-オス メス ?メス ブレッドボードジャンパーワイヤー
新品価格
¥990から
(2020/9/5 16:28時点) - モータ
マブチモーター 小型直流モーター FA-130RA 1BOX 10個入
新品価格
¥2,805から
(2020/10/10 16:02時点) - MOSFET K4017
10ピース/ロット2SK4017 k4017 mosfet n-ch 60ボルト5a PW-MOLD2
新品価格
¥2,157から
(2020/10/10 16:05時点)
- Arduino Uno本体
- 【配置図】
- 【回路図】
※部分的ポイント
- 【プログラム】
// constants won’t change. They’re used here to set pin numbers:
const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin// variables will change:
int buttonState = 0; // variable for reading the pushbutton statusvoid setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
} - 【実際画像】
- 【実行結果】
タクトスイッチを押すとモーターが回転します。
- まとめ
FETの仕組み「ゲート」、「ドレイン」、「ソース」の理解ですが、私は
ゲート=電流を流すスイッチ
ドレイン=プラス
ソース=マイナス
と解釈して理解しました。
※実際とは異なると思いますが理解するためにこのような概念で解釈しました。
働きが電気制御で使われるリレーによく似てるなと思いました。
【参考資料】
ここで行っている演習は下記テキストを参考にさせて頂いています。
【使用しているテキスト】
![]() |
新品価格 |