ソレノイド制御 by arduino
ソレノイド
ソレノイドは、コイルと稼働鉄芯/プランジャー等から構成され、コイルに電流を流すとプランジャーが動く。
制御には、誘導負荷に対する考慮が必要。
特にオンオフする際の逆起電力対策として、ダイオード等を忘れると、故障や事故に繋がる。
回路
refの回路
ref
https://www.google.com/amp/s/gamp.ameblo.jp/solcon/entry-12278991497.html
レベル変換
I2Cの場合
変換チップ等
http://akizukidenshi.com/catalog/g/gM-05452/
GPIO等のレベルが異なる時
それぞれが5vと3.3vの場合。
- 5v to 3.3v
- 3.3v to 5v
電圧を下げる時
5v out to 3.3v in
5v out - 10kΩ -+--- 3.3v in | 20kΩ --- GND
Vh@in = 5v * 20kΩ/(10k+20k) = 3.33...v
Out Current = 5v/(10kΩ+20kΩ) = 0.16mA
電圧を上げる時
3.3v out to 5v in
電圧を上げる側は考える事がいくつかある。
出力側に5v耐性があれば、Open drain 出力に5vプルアップで簡単に出来る。
しかし、5v耐性がない場合、5v耐性のあるトランジスタ、ゲート等の外部回路が必要。
5v | 30kΩ +-------- 5v in |(c) 3.3v out -- TR |(e) GND
論理が反転するのはご愛嬌。
トランジスタを使うぐらいなら、レベルシフタの方が良いかもしれない。
或いは、5v耐性のあるゲートを使って5vにプルアップとか。
Rhaspberry Pi Zero W
安いね
Pi zero W 送料150円込みで約1,500円。Headerなし版。
何に使う?
WifiとBluetoothが付いている一方、有線LANなし。まずは、どちらかでネットワークに接続したい。
取り敢えず、Bluetooth経由でネットワーク接続してみる。
Bluetooth network
基本的にはBlueZのPAN。
client の設定。
sudo hciconfig hci0 up sudo bluetoothctl pairing on scan on (you should see the name of the system you named previously here) scan off devices (you should see the name of the system you named previously here) agent on pair xx:xx:xx:xx:xx:xx (enter the pin for pairing here, and a window should pop up on the computer asking for the same one) trust xx:xx:xx:xx:xx:xx connect xx:xx:xx:xx:xx:xx (will fail, but you will get a list of available services here) # ここで、APにペアリングポップアップ。 # ペアリングの後で sudo hciconfig hci0 up sudo /usr/share/doc/bluez-test-scripts/examples/test-network 00:16:93:01:00:2C nap sudo dhclient bnep0
ref
Raspbian Buster
Raspbian Buster Release
- 2019/07/10 リリース
フレーバー
3種類のパッケージ
- Desktop with recommended software 1,945MB
- Desktop 1,149MB
- Lite : Minimal 426MB
Version
Version July 2019 Linux Kernel 4.19 Name : Buster
Desktop w/recommended
Raspbian Buster with desktop and recommended software Image with desktop and recommended software based on Debian Buster Version:July 2019 Release date:2019-07-10 Kernel version:4.19 Size:1945 MB
ref
https://www.raspberrypi.org/downloads/raspbian/
setup serial
https://www.google.com/amp/www.usagi1975.com/201907061400/amp/