BLE – DHT over BLE UART

Materials

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

  • DHT11 or DHT22 or DHT21

  • Android / iOS smartphone

Example

Introduction

In this example, the data obtained from a DHT temperature and humidity sensor are transmitted over a BLE UART service to a smartphone. Refer to the other examples for detailed explanations of using the DHT sensor and the BLE UART service.

Procedure

Connect the DHT sensor to the Ameba board following the diagram.

AMB21 / AMB22:

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

AMB23:

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

BW16:

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

BW16-TypeC:

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

Ensure that a compatible BLE UART app is installed on your smartphone, it is available at:

– 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

After starting the UART function, notifications should be received every 5 seconds containing the measured temperature and humidity.

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