BLE - UART DHT 功能

材料準備

  • AmebaD [AMB21 / AMB22 / AMB23 / BW16] x 1

  • DHT11 or DHT22 or DHT21

  • Android / iOS 智能手機

範例説明

介紹

在此範例中,從DHT溫度和濕度傳感器獲得的數據通過BLE UART服務傳輸到手機。有關使用DHT傳感器和BLE UART服務的詳細說明,請參閱其他範例。

步驟

如下圖,將DHT傳感器連接到Ameba板上。

AMB21 / AMB22:

../../../../_images/image16.png

AMB23:

../../../../_images/image1-1.png

BW16:

../../../../_images/image1-21.png

BW16-TypeC:

../../../../_images/image1-31.png

確保您的手機上已安裝兼容的BLE UART應用程序,該應用程序可在以下位置獲得:

– Google Play Store: https://play.google.com/store/apps/details?id=com.adafruit.bluefruit.le.connect https://play.google.com/store/apps/details?id=de.kai_morich.serial_bluetooth_terminal

– Apple App Store: https://apps.apple.com/us/app/bluefruit-connect/id830125974

Open the example, “Files” “Examples” “AmebaBLE” “DHT_over_BLEUart”.

../../../../_images/image25.png

Upload the code and press the reset button on Ameba once the upload is finished. Open the app on your smartphone, scan and connect to the Ameba board shown as “AMEBA_BLE_DEV” and choose the UART function in the app.

../../../../_images/image31.png ../../../../_images/image41.png

啟動UART功能後,應每5秒鐘收到包含所測溫度和濕度的通知。

../../../../_images/image52.png