「通信機器」カテゴリーアーカイブ

Arduino:ESP8266でモーションセンサーと電源スイッチっす

ESP8266
少し時間ができたので、PIRモーションセンサーを使って電源をコントロールするモジュールの作成
人体感知で、電源につながった機器のスイッチをコントロール
このモジュールだと

これもいたって簡単っす。
ESP8266
Now that we have some time, create a module to control the power supply using the PIR motion sensor
This is also easy.
All you need is
必要なのは、
ESP-12の乗ったモジュール
5Vがあれば面倒なし
D1だと、ダイオードが必要

Module with ESP-12
No trouble with 5V

とこれ
HC SR-501
人体感知センサーモジュール
注意なのは、4.5V入力

And this
HC SR-501
Human body sensor module
Note that 4.5V input

1つのチャンネル5Vリレーモジュールボードシールド

高負荷のスイッチであればこれ

1 channel 5V relay module board shield

構造はすべて同じ
通電に,
HC_SR501_PIR_MOTION_SENSOR_ブレッドボード
All structures are the same
To energize,

SR-501に感度と通電時間の設定ダイヤルが付いているので微妙な調整は自分でできる
(^^)>
組み上げて動作するまでに、15分程度
The SR-501 has sensitivity and energization time setting dials, so you can make subtle adjustments yourself.
(^^)>
About 15 minutes to assemble and operate

ソースは、これだけ
This is the source

//D6 06 GPIO12
int Status = 12;
//D7 07 GPIO13
int sensor = 13;

void setup() {
Serial.begin(9600);
pinMode(sensor, INPUT); // declare sensor as input
pinMode(Status, OUTPUT); // declare LED as output
}

void loop() {
long state = digitalRead(sensor);
delay(1000);
if (state == HIGH) {
digitalWrite (Status, HIGH);
//動きが検出されました!
Serial.println(“動きが検出されました!”);
}
else {
digitalWrite (Status, LOW);
//動きがない!
Serial.println(“動きがない!”);
}
}

iFTTTのソースは、また時間あるときに作ろうかと思う。
かかった費用は、
415円程度 安くはないですね。
I will make the iFTTT source again when I have time.
The cost was
415 yen is not cheap.

製品でれば、1800円程度なので
If it’s a product, it’s around 1800 yen

ただし、セキュリティの観点からいえば、自作は全くのハイドなので
外部からの操作は通常と比べて高度
その上、iFTTTなどの操作で、複数の操作が簡単に可能
However, from a security point of view, my work is a complete hide.
External operation is more advanced than usual
In addition, multiple operations can be easily performed by operations such as iFTTT.

ただし、事故責任す。
だけど、他の商品を購入しようが、結局は自己責任なので
(^^)>
スイッチングなのでケースは、防炎ケースが必要
However, we are responsible for accidents.
However, I will try to buy other products, but it is my own responsibility after all
(^^)>
Since it is switching, the case needs a flameproof case

時間制御には、これが必要

基本的に、NTPがいいけど、技適の必需性もある※閉鎖された自宅からでなければ影響を及ぼさない。
確認はスマートフォンで外に出て確認を取ればよい。
稼働時に、自宅の外で確認
自宅から、5-10m程度が限界でした。(^^)>
確認してみると意外
市販されているルータ膨大な数、70ホストがキャッチ
本来 20m程度の範囲なのでせいぜい4件と家族4名で20台程度と思うが・・
非常に迷惑になるほど出力が高い状態で技適もある。
ホッピングが不能になる高速な製品も見受けられるが、
とりあえず、自宅周辺だと、ESP8266系の電波はそれほど強くない。
気にするには、超したとこも無く、一度時間を設定すると、クオーツを利用していないので
環境に左右されず、1年ほどはずれが無いはず。

Basically, NTP is good, but there is a skill-necessary necessity. * It has no effect unless it is from a closed home.
Confirmation can be done by going outside with a smartphone.
Check outside the home when in operation
From home, about 5-10m was the limit. (^^)>
It is surprising to check
A huge number of routers on the market, 70 hosts catch
I think that it is about 20 meters at most because it is a range of about 20m, but at most 4 cases and 4 families …
There is technical skill in the state that output is so high that it becomes very annoying.
There are some high-speed products that make hopping impossible,
For the time being, around the home, the ESP8266 radio waves are not so strong.
To worry about, there is nothing super, and once you set the time, you are not using quartz
It shouldn’t be affected by the environment, and there should be no gap for about a year.

これで、モジュールに何時から何時までは通電しないと設定できる。
Now, it can be set that the module is not energized from what time to what time.

Arduino:ESP8266で積んでいるモジュール?

ESP8266で積んでいるモジュール?
ロシアから、購入先ちょっとした質問があったので調べてみた。

Flushチップのメーカと、オンボード・アンテナの形状で判断できるようです。
ESP-12-Front
Modules loaded with ESP8266?
I got a little question from Russia where I bought it.

It seems that it can be judged by the manufacturer of the Flush chip and the shape of the on-board antenna.

左がESP-12F 右がESP-12E
ESP-12-Back
ESP-12F on the left, ESP-12E on the right

ESP-12E WinbondのW25Q32BV
ESP-12F BergMicroのBG25Q32
違いは、
FCCおよびCE認証済み。
アンテナ性能向上
これFの方が良いという事ですね。
フツーにそうでしょうが、勉強になりますね。
SDIOに関してちょっと違いがあるようですが。

The difference is
FCC and CE certified.
Improved antenna performance
This F is better.
That ’s right, but it ’s going to be a study.
There seems to be a little difference regarding SDIO.

スマートホームに向けて36a:各部屋センサーのユニット化

環境センサー72時間稼働させてすこぶる問題ない
そこで、実機の状況を確認した

IMG_20190804_132953

There are no problems with operating the environmental sensor for 72 hours
So we confirmed the situation of the actual machine

すべてにおいてこの温度から上がることはなかった。
問題なのは、非常に高温になった場合の安全確保である。
評価ユニットであるため、信頼性の確保を優先。
問題なし。
IMG_20190804_133216
Nothing went up from this temperature at all.
The problem is to ensure safety in the event of very high temperatures.
As it is an evaluation unit, priority is given to securing reliability.
no problem.

これで、
環境センサーのユニット化を実現できる。

with this,
It can realize unitization of environmental sensors.

まず購入すべきは、AC-DCモジュールユニット
通常スマートホンのアダプタや百均で購入できるアダプタでも良いが、
問題は、持続した構造になっているかどうか
今までを見るからに、結構無理を生じさせる構成のような?
なので、今回はスペースよりも安全性で
このモジュール
見たらわかるけど、ポリスイッチ搭載型
温度による物理スイッチなので、正確に切れます。
自作には、必ずつけました。
ESPは基本的に80-100mA程度あればよいはずなので、十分です。
月の電気料金は、0.14円ですね。

AC-DC module unit should be purchased first
Normally, you may use a smartphone adapter or an adapter that can be purchased on a pay-as-you-go basis.
The question is whether it has a sustained structure
In from view until now, such as the configuration to produce a pretty unreasonable?
So it’s safer than space this time
This module
You can see if you look at it, but with a poly switch
As it is a physical switch by temperature, it cuts off correctly.
To homebrew, we put always.
Basically, it should be around 80-100 mA for ESP, so it’s enough.

あとは、ESPモジュールと環境センサーモジュール
部屋の数、計測したい箇所数分

SnapCrab_NoName_2019-8-4_2-25-44_No-00

After, ESP module and environmental sensor module
Number of rooms, minutes to measure

これだけ多量なので、ルータの貧弱DHCPは使ってはいけないだろう。
Because this is a lot, you should not use poor DHCP on your router.

続きを読む スマートホームに向けて36a:各部屋センサーのユニット化