Mi Band Detector Using ESP32 BLE

by Bavensky in Circuits > Arduino

14488 Views, 17 Favorites, 0 Comments

Mi Band Detector Using ESP32 BLE

1_C9c_3rxQ_Z_cBmFtQP6Osg.jpeg

Hello Maker m(- -)m

I read this article form 陳亮 (moononournation github) about how to use esp32 ble for scan the device so i had to try this code on github Arduino_BLE_Scanner. now i want to use my Mi Band 3 to unlock the door when i come to my office, Let's see how it's work !!!

Things used in this project

  1. ESP32 TTGO T1
  2. Mi Band 2 or 3
  3. Computer with in Arduino IDE install already

Library & Service

  1. ESP32_BLE_Arduino

Prepare Your Library

ble1.JPG
  1. Download and Install Library ESP32_BLE_Arduino
  2. Download the example code

Explore BLE-detector.ino

ble2.JPG

Compile and Upload Code to Your Board

ble3.JPG

When your upload this code to your board, you can see the program work on Serial monitor in baud rate 115200. Now you have to find the name of your mi band.

Edit Code for Detect Your Mi Band

ble4.JPG

On Arduino IDE, in line 65 - 82 is compare data form ble when the device name "Mi Band 3" that is your device. Next step you have to fine deviceAddress for make sure it's your Mi Band.

In line 74, You can change RSSI for adjust detection distant.

Look at the LED on Board When You Come Close the Device

1_6wjFWaVmAIj62fGdybLJ9w.jpeg
  • When ESP32 detect your Mi Band the LED onboard will turn ON
  • When ESP32 can not detect your Mi Band the LED onboard will turn OFF

Now You Can Make Another Cool Project and Happy Coding M(^-^)m

ปลดล็อคประตูด้วย Mi band 3