TREASURE HUNT USING ESP32 (BLE SCANNER)

TREASURE HUNT USING ESP32 (BLE SCANNER)

The treasure hunt makes use of ESP32, OLED, and buzzer modulesESP32 has been specifically chosen due to its BLE functionality and OLED being one of the more simpler displays. Let us see how we can organize a treasure hunt using these components.

How does the treasure hunt happen?

  1. First of all, we need at least 2 ESP devices to have a treasure hunt
  2. One will broadcast a BLE Server and the other one will act as a scanner; it will make a sound using a buzzer when it comes close to the first device
  3. All you have to do is carry the second one around and find answers to the hints by moving towards the area where the frequency of beeps from the buzzer increases
  4. The first device will be throwing a BLE Server and will be kept somewhere near to the solution of the clue.
  5. Once you find this device, the next clue will be displayed on the OLED screen
  6. You have to keep doing this to move onto the next stage of the treasure hunt
  7. Note that we’ll need several devices depending on the number of players and clues; one scanner for each player and one server for each clue

IMG_257

Server & Client Flow

After getting a hold about the treasure hunt, let’s go through the program flow of the devices being used during the hunt.

  1. As mentioned above, 2 types of devices are being used: one acting as a BLE Server and the other as a BLE client
  2. The BLE server device advertises a server while the other device, known as the client, scans for that server
  3. The client has been programmed to look for our treasure hunt server and produce a sound when located in proximity to the server
  4. RSSI is used as a measure for the proximity of the client to the server
  5. Refer to the flowchart below to have an in-depth idea about the program flow of each device

IMG_258

Circuit for the Client & Server

Make the connections shown below to make the circuit for client and server. The buzzer connected to the ESP will produce a sound when you are near to the location of a clue by scanning for the server. In order to make your hunt more fun, you can hide the server making it hard for people to find.

IMG_259IMG_260

                Fig. 1 -Client                                          Fig. 2 - Server

Now let us see the whole setup in full action. The following video will show you the working of the BLE scanner and demonstrate the idea of planning your own treasure hunt using ESP32.

Tutorial

 

Maybe unlike us, you can put the servers inside Easter eggs while planning your hunt.

Link for the Programs:

Download the code from our GitHub page and upload it to your ESPs to get started with your hunt: https://github.com/Robocraze/BLE-Scanner

BLE Facts

Here are some fun facts about Bluetooth Low Energy (BLE). BLE is a power-conserving variant of Bluetooth. Unlike Bluetooth that is always on, BLE remains in sleep mode constantly except for when a connection is initiated. This makes it consume very low power, approximately 100x less than that consumed by Bluetooth. Additionally, BLE supports not only point-to-point communication, but also broadcast mode, and mesh network. BLE has great application in healthcare, fitness, tracking, beacons, security, and home automation industries.

ESP32 makes the implementation of these recent technologies such as BLE so easy. We hope you also think of similar applications and make your learning process more exciting.

Wishing you a happy and joyous Easter. Hope you have a blast solving clues and finding treasures.

Buy ESP32 Here

Buy Bluetooth Module

You may also like to read

Frequently Asked Questions

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.

You may also like to read