IoTデータ 可視化サービスAmbientにENV III UNITのデータを送る

以前から触ってみようと思ってやっていなかったIoTデータを可視化するサービスAmbientを試してみました。

https://ambidata.io/

使い方は、書籍「IoT開発スタートブック ── ESP32でクラウドにつなげる電子工作をはじめよう!」やAmbientの公式ドキュメントに詳しく書かれていますが、試した内容をメモとして残しておきます。

Githubリポジトリ ESP8266/ESP32用Arduino・Ambientライブラリー にもサンプルが掲載されているのでこちらも参考になります。

センサーは、M5Stick-C ENV III Unitを使います。

ENV III Unit with Temperature Humidity Air Pressure Sensor (SHT30+QMP6988)
ENV III SKU:U001-C Description ENV III is an environmental sensor that integrates SHT30 and QMP6988 internally to detect temperature, humidity, and atmospheric pressure data. SHT30 is a high-precision and low-power digital temperature and humidity sensor, and supports I2C interface (SHT30:0x44 , QMP6988:0x70).QMP6988 is an absolute air pressure sensor specially designed for mobile applications, with high accuracy and stability, suitable for environmental data collection and detection types of projects.Product Features Simple and easy to use High accuracy I2C communication interface HY2.0-4P interface, support platform UIFlow , Arduino 2x LEGO compatible holes Include 1x ENV-III Unit 1x HY2.0-4P Cable Applications Weather station Storage barn environment monitoring Specification Resources Parameter Maximum temperature measurement range -40 ~ 120 ℃ Highest measurement accuracy 0 ~ 60 ℃/±0.2℃ Humidity measurement range/error 10 ~ 90 %RH / ±2% Maximum measured value of air pressure/resolution/error 300 ~ 1100hPa / 0.06Pa / ±3.9Pa Communication protocol I2C: SHT30(0x44), QMP6988(0x70) Working temperature 32°F to 104°F (0°C to 40°C ) Net weight 5g Gross weight 17g Product Size 24.2*32.2*8.1mm Package Size 67*53*12mm Case Material Plastic ( PC ) ENV version scheme comparison ENV I ENV II ENV III DHT12+BMP280 SHT30+BMP280 SHT30+QMP6988 PinMap M5Core(PORT A) GPIO22 GPIO21 5V GND ENV III Unit SCL SDA 5V GND Schematic Related Link Datasheet QMP6988 SHT30 Learn M5stack based PFD (Primary Flight Display) An attempt to create a realtime “Artificial Horizon” on the M5. Matrix Shelly Thermostat: A Serverless Approach A modular WiFi smart thermostat that doesn’t need you to maintain any infrastructure: deploy it everywhere, integrate with everything. M5Stack COM. LoRaWAN Using Arduino IDE M5Stack recently released an updated LoRaWAN module. This tutorial teaches you how to connect it to The Things Network using Arduino IDE. Smart Plant with M5Stack Make your plants smart and monitor water, temperature and humidity! M5StickC with HomeKit Automation Used StickC with ESPHap library to connect to HomeKit Smart Planting System Building a smart planting system using M5Stack to monitor the lights, humidity, temperature, watering your plant automatically. 3 in 1 Sanitiser Dispenser We have devised with an innovation that dispenses hand sanitiser, measures the temperature of user, shows the count of people in vicinity. CovidStop A technology which increases efficiency in signing in or out during peak hour areas when entering the campus while the SafeEntry implies. SEAM [Safe-Entry Access Machine] An automatic system to perform the tasks of Safe Entry. It consist an adjustable Thermometer, RFID / QR Code Check in and Counting. Example Arduino ENV III Unit Test

shop.m5stack.com

No Image


“IoTデータ 可視化サービスAmbientにENV III UNITのデータを送る” の続きを読む

M5Stack ENV III Unit 温湿度気圧センサ (SHT30+QMP6988) の使い方

M5StickC ENV-HAT IIが壊れてしまい[ENV III Unit 温湿度気圧センサー (SHT30+QMP6988)]を買ったので使い方をメモしておきます。

ENV III Unit with Temperature Humidity Air Pressure Sensor (SHT30+QMP6988)
ENV III SKU:U001-C Description ENV III is an environmental sensor that integrates SHT30 and QMP6988 internally to detect temperature, humidity, and atmospheric pressure data. SHT30 is a high-precision and low-power digital temperature and humidity sensor, and supports I2C interface (SHT30:0x44 , QMP6988:0x70).QMP6988 is an absolute air pressure sensor specially designed for mobile applications, with high accuracy and stability, suitable for environmental data collection and detection types of projects.Product Features Simple and easy to use High accuracy I2C communication interface HY2.0-4P interface, support platform UIFlow , Arduino 2x LEGO compatible holes Include 1x ENV-III Unit 1x HY2.0-4P Cable Applications Weather station Storage barn environment monitoring Specification Resources Parameter Maximum temperature measurement range -40 ~ 120 ℃ Highest measurement accuracy 0 ~ 60 ℃/±0.2℃ Humidity measurement range/error 10 ~ 90 %RH / ±2% Maximum measured value of air pressure/resolution/error 300 ~ 1100hPa / 0.06Pa / ±3.9Pa Communication protocol I2C: SHT30(0x44), QMP6988(0x70) Working temperature 32°F to 104°F (0°C to 40°C ) Net weight 5g Gross weight 17g Product Size 24.2*32.2*8.1mm Package Size 67*53*12mm Case Material Plastic ( PC ) ENV version scheme comparison ENV I ENV II ENV III DHT12+BMP280 SHT30+BMP280 SHT30+QMP6988 PinMap M5Core(PORT A) GPIO22 GPIO21 5V GND ENV III Unit SCL SDA 5V GND Schematic Related Link Datasheet QMP6988 SHT30 Learn M5stack based PFD (Primary Flight Display) An attempt to create a realtime “Artificial Horizon” on the M5. Matrix Shelly Thermostat: A Serverless Approach A modular WiFi smart thermostat that doesn’t need you to maintain any infrastructure: deploy it everywhere, integrate with everything. M5Stack COM. LoRaWAN Using Arduino IDE M5Stack recently released an updated LoRaWAN module. This tutorial teaches you how to connect it to The Things Network using Arduino IDE. Smart Plant with M5Stack Make your plants smart and monitor water, temperature and humidity! M5StickC with HomeKit Automation Used StickC with ESPHap library to connect to HomeKit Smart Planting System Building a smart planting system using M5Stack to monitor the lights, humidity, temperature, watering your plant automatically. 3 in 1 Sanitiser Dispenser We have devised with an innovation that dispenses hand sanitiser, measures the temperature of user, shows the count of people in vicinity. CovidStop A technology which increases efficiency in signing in or out during peak hour areas when entering the campus while the SafeEntry implies. SEAM [Safe-Entry Access Machine] An automatic system to perform the tasks of Safe Entry. It consist an adjustable Thermometer, RFID / QR Code Check in and Counting. Example Arduino ENV III Unit Test

shop.m5stack.com

No Image

今回HATじゃなくてUNITの方にした理由としては、M5StackやATOMなどでも使い回したいという理由でUTNIにしてみました。
“M5Stack ENV III Unit 温湿度気圧センサ (SHT30+QMP6988) の使い方” の続きを読む

距離センサー VL53L0X の使い方 (Arduino、ESP32)

スイッチサイエンスで、PololuのVL53L0Xモジュールを購入してArduinoとESP32で試してみたメモです。

PololuのVL53L0Xモジュールのピンアサイン

Pololuのピンホールは7つあります。

シルク 説明
VDD 電源
VIN 主電源 (基本こちらを使う)
GND グランド
SDA I2Cのシリアルデータ
SCL I2Cのシリアルクロック
XSHOT ハードウェアスタンバイ
GP01 ???

“距離センサー VL53L0X の使い方 (Arduino、ESP32)” の続きを読む

小型のMP3プレーヤーモジュールDFPLayerの使い方

コピペテックで技術書典Vol8向けに書いた「ESP32 と obnizOS で作る IoT 電子工作」で使ったMP3プレーヤーモジュールのDFPlayer Miniの使い方についてまとめてみました。

ピンアサインの確認

こちらは、DFPlayerのデータシートに記載されているピンのラベル付きの写真です。

本記事で使用するピンは以下の通りです。

ピン 用途 備考
VCC 電源電圧 動作電圧は3.2から5.0Vに対応
RX UARTの入力信号端子
TX UARTの出力信号端子
SPK_1 スピーカー端子+ 3W以下
GND グランド
SPK_2 スピーカー端子- 3W以下
IO1 トリガーポート1 短く押すと前の曲、長く押すとボリュームを下げる
IO2 トリガーポート2 短く押すと次の曲、長く押すとボリュームを上げる
BUSY 再生ステータス LOWのときに再生中

“小型のMP3プレーヤーモジュールDFPLayerの使い方” の続きを読む

NeoPixelリングに使えるエフェクト実装例集

NeoPixelリングに使えそうなエフェクトをいろいろと自作してみました。
テープ状のLEDとリング上のLEDで向いているエフェクトがちょっと異なる気もしますが、今回はリング向けです。

サンプルは、Arduino UNOで動作を確認しています。

事前準備

Arduino IDEのセットアップして、ArduinoとNeoPixelリングを接続します。

NeoPixel制御用ライブラリのインストール

ライブラリはAdafruit_NeoPixelを使用します。
以下の手順で追加します。

  1. Arduino IDEのメニューから[ツール] > [ライブラリを管理…]を選択してライブラリマネージャを開きます。
  2. 「NeoPixel」で検索して「Adafruit NeoPixel by Adafruit」をインストールします。

Arduino UNOとNeoPixelリングを接続

以下の配線図に従ってArduino UNOとNeoPixelリングをつなぎます。

対応表

Arduino NeoPixelリング
DIGITAL 6 IN
5V V+
GND GND

Adafruit_NeoPixelの基本的な使い方

Adafruit_NeoPixelの使い方を以下のスケッチ例を使って説明します。

こちらは、GithubのREADMEにも載っている例simpleと同じです。

#include <Adafruit_NeoPixel.h>
#define PIN        6 // 信号用のピンを指定
#define NUMPIXELS 16 // LEDの数を指定

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 500

void setup() {
  pixels.begin(); // NeoPixel出力ピンの初期化
}

void loop() {
  pixels.clear(); // すべてのLEDの色を0にセット

  for(int i=0; i<NUMPIXELS; i++) {
    pixels.setPixelColor(i, pixels.Color(0, 150, 0));
    pixels.show();
    delay(DELAYVAL);
  }
}

“NeoPixelリングに使えるエフェクト実装例集” の続きを読む