Finding a Lost Bluetooth Device With LilyGO TTGO T-display ESP32
by RonFrtek in Circuits > Arduino
2154 Views, 6 Favorites, 0 Comments
Finding a Lost Bluetooth Device With LilyGO TTGO T-display ESP32
In this Tutorial we will learn how to track and find a Lost Bluetooth Device with LilyGO TTGO T-display ESP32 and Visuino.
What You Will Need
- TTGO ESP32
- Piezo module
- Some Bluetooth device that you will try to locate like a smart bracelet ,etc
- Visuino program: Download Visuino
Connecting the Piezo Module
- Connect Piezo module pin S to TTGO Board pin 12
- Connect Piezo module pin Vcc to TTGO Board pin 5V
- Connect Piezo module pin GND to TTGO Board pin GND
Start Visuino, and Select the Arduino TTGO T-Display ESP32 Board Type
The Visuino: https://www.visuino.eu needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "TTGO T-Display ESP32" as shown on Picture 2
In Visuino Set Bluetooth LE
- Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Bluetooth LE>Operations
- Click on the Operations 3 Dots
- In the Operations window drag "Search Bluetooth Devices" to the left side and in the properties window set "Active" to true
- Close the Operations window
In Visuino Set Display
- Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Display>Orientation
- Set Orientation to:goRight
- Select TTGO T-Display ESP32 board and in the properties window expand "Modules>Display>Elements
- Click on the Elements 3 Dots
In the Elements window:
- Drag "Draw Bitmap" to the left side and in the properties window set Y to 10 and Click on the Bitmap 3 dots button
- In the Bitmap Editor Load the Bluetooth Icon (added in the pictures here), Close the Bitmap Editor
In the Elements window:
- Drag "Draw Text" to the left side and in the properties window set color to "aclCornflowerBlue", size to 2, Text to "Count:", X to 40, Y to 15
- Add "Text Field" to the left side and in the properties window set size to 3, X to 130, Y to 5
- Drag "Draw Text" to the left side and in the properties window set color to "aclLime", size to 2, Text to "Strength::", Y to 90
- Add "Text Field" to the left side and in the properties window set size to 3, X to 110, Y to 90
- Add "Text Field" to the left side and in the properties window set size to 2, Y to 60, color to aclYellow
Close the Elements window:
In Visuino Add Components
- Add "Compare Integer Value" component
- In the properties window set "Compare Type" to ctBiggerOrEqual and Value to 1
- Add "Play Frequency Tone" component and in the properties window set "Initial Frequency (Hz)" to 100 and click on the "Enabled" pin button and select Boolean SinkPin
- Add "Clock generator" component
In Visuino Connect Components
- Connect "Operations [0] > Count Devices" to Text Field1 pin In and CompareValue1 pin In
- Connect "Operations [0] > Signal Strength" to Text Field3 pin In
- Connect "Operations [0] > Device Name" to Text Field32 pin In
- Connect "ClockGenerator1" pin Out to "Operations [0] > Scan
- Connect "CompareValue1" pin Out to "PlayFrequency1" Pin Enabled
- Connect "PlayFrequency1" pin Out to TTGO Board pin GPIO (MISO1) 12
Generate, Compile, and Upload the Code
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
Play
If you power the TTGO ESP32 module it will scan for a Bluetooth device, one it finds the device it will display how many devices was found, Device name and Signal strength. And a sound will be made by a Piezo module.
The closer you are to the device the higher the number of the Signal strength will be, -100 >> -60, etc
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu
Downloads
Troubleshooting
When you power the TTGO display might Blink on scanning, this should stabilize after 30+ seconds.