Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Arduino & Microcontrollers

ESP32 BLE: Bluetooth Low Energy Beacon and Scanner

ESP32 BLE: Bluetooth Low Energy Beacon and Scanner

April 1, 2026 /Posted by / 0

Esp32 Ble Beacon Scanner — this detailed tutorial covers everything from hardware selection to complete working code, designed for Indian makers, students, and engineers.

Table of Contents

  • What is Bluetooth Low Energy?
  • Creating an ESP32 BLE Beacon
  • Building a BLE Scanner
  • Creating a GATT Server
  • Recommended BLE Apps for Testing
  • BLE Power Optimisation
  • Frequently Asked Questions

What is Bluetooth Low Energy?

BLE (Bluetooth Low Energy) operates at 2.4 GHz like Classic Bluetooth but uses significantly less power — as low as 10 µA in sleep mode. The ESP32 supports BLE 4.2 with both Central (scanner) and Peripheral (beacon/server) roles. Unlike Bluetooth Classic’s SPP model, BLE uses a GATT (Generic Attribute Profile) architecture with Services and Characteristics. Each service has a UUID and contains one or more characteristics that hold data values. For example, a temperature sensor might expose a service with UUID 0x181A (Environmental Sensing) containing a temperature characteristic.

🛒 Recommended: Waveshare ESP32-S3 1.85inch Round LCD Development Board, 360×360, Supports Wi… — Add a visual display to your ESP32 project.

Creating an ESP32 BLE Beacon

An iBeacon broadcasts a UUID, Major, and Minor value that nearby devices can detect. This is useful for indoor positioning, museum guides, and proximity-triggered actions.

#include <BLEDevice.h>
#include <BLEBeacon.h>

void setup() {{
  BLEDevice::init("");
  BLEServer *pServer = BLEDevice::createServer();
  BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();

  BLEBeacon oBeacon = BLEBeacon();
  oBeacon.setManufacturerId(0x4C00);
  oBeacon.setProximityUUID(BLEUUID("12345678-1234-1234-1234-123456789012"));
  oBeacon.setMajor(1);
  oBeacon.setMinor(100);

  BLEAdvertisementData oAdvertisementData;
  oAdvertisementData.setFlags(0x04);
  std::string strServiceData = "";
  strServiceData += (char)26;
  strServiceData += (char)0xFF;
  strServiceData += oBeacon.getData();
  oAdvertisementData.addData(strServiceData);

  pAdvertising->setAdvertisementData(oAdvertisementData);
  pAdvertising->start();
}}

void loop() {{
  delay(1000);
}}

This beacon can be detected by any BLE scanner app on both Android and iOS — unlike Bluetooth Classic which does not work with iPhones.

Building a BLE Scanner

The ESP32 can scan for nearby BLE devices and report their names, RSSI (signal strength), and advertised data:

#include <BLEDevice.h>
#include <BLEScan.h>

BLEScan* pBLEScan;

class MyAdvertisedDeviceCallbacks : public BLEAdvertisedDeviceCallbacks {{
  void onResult(BLEAdvertisedDevice advertisedDevice) {{
    Serial.printf("Device: %s  RSSI: %dn",
      advertisedDevice.toString().c_str(),
      advertisedDevice.getRSSI());
  }}
}};

void setup() {{
  Serial.begin(115200);
  BLEDevice::init("");
  pBLEScan = BLEDevice::getScan();
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setActiveScan(true);
  pBLEScan->setInterval(100);
  pBLEScan->setWindow(99);
}}

void loop() {{
  Serial.println("Scanning...");
  BLEScanResults results = pBLEScan->start(5, false);
  Serial.printf("Found %d devicesn", results.getCount());
  pBLEScan->clearResults();
  delay(5000);
}}

🛒 Recommended: Waveshare ESP32-S3 1.46inch Round Display Development Board, 412×412, Support… — Add a visual display to your ESP32 project.

Creating a GATT Server

A GATT server exposes data that BLE clients can read, write, or subscribe to with notifications. This is the foundation for custom BLE sensor devices. Create a service, add characteristics with properties (Read, Write, Notify), and set callbacks for client interactions. Popular use cases include custom sensor hubs, remote controls, and wearable devices that communicate with phone apps.

Recommended BLE Apps for Testing

Several free apps work excellently for testing ESP32 BLE projects:

  • nRF Connect (Nordic Semiconductor) — the gold standard for BLE debugging on both Android and iOS
  • LightBlue — simple and clean interface for iOS
  • BLE Scanner — basic but effective Android app

nRF Connect lets you discover services, read/write characteristics, and subscribe to notifications — essential for debugging GATT servers.

BLE Power Optimisation

For battery-powered BLE beacons, reduce advertising interval to save power. A 1-second interval uses ~12 mA, while a 10-second interval drops to ~1.5 mA average. Combine with ESP32 deep sleep: wake up, advertise for 30 seconds, then sleep for 5 minutes. A 2000 mAh battery can power such a beacon for over a year. Use esp_deep_sleep_start() with a timer wakeup source.

🛒 Recommended: Waveshare ESP32-S3 1.47inch Display Development Board, 172×320, 262K Color, U… — Add a visual display to your ESP32 project.

Frequently Asked Questions

Can ESP32 BLE work with iPhones?

Yes, BLE works with both Android and iOS. This is the main advantage over Bluetooth Classic, which does not support SPP on iPhones. Use GATT services for cross-platform compatibility.

What is the range of ESP32 BLE?

Typical indoor range is 30-50 metres, and outdoor line-of-sight can reach 100+ metres. Range depends on advertising power level, which you can set from -12 dBm to +9 dBm using esp_ble_tx_power_set().

How many BLE connections can ESP32 handle simultaneously?

The ESP32 can maintain up to 9 simultaneous BLE connections as a central device and 3 connections as a GATT server. For most projects, 3-4 connections work reliably.

Conclusion

The ESP32 platform continues to impress with its versatility and value for money. This project demonstrates just one of hundreds of applications possible with affordable microcontrollers. Indian makers have a unique advantage — access to affordable components, a growing community, and endless real-world problems to solve with technology. Whether you are building this for learning, a college project, or a commercial product prototype, the fundamentals covered here will serve you well.

Ready to start building? Browse our ESP32 development boards at Zbotic for the best prices in India with fast shipping!

Tags: Beacon, BLE, ESP32, Scanner
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Push Button Types: Momentary, ...
blog push button types momentary latching and toggle 613064
blog rotary switch multi position selection circuit 613071
Rotary Switch: Multi-Position ...

Related posts

Svg%3E
Read more

Arduino Batch Programming: Flash Multiple Boards Quickly

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Based Radar System with Ultrasonic Sensor

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Automatic Plant Monitor: Sunlight, Moisture, Temperature

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Lie Detector: GSR Sensor Polygraph Project

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading
Svg%3E
Read more

Arduino Metal Detector: Build a Treasure Finder

April 1, 2026 0
Table of Contents Introduction Components and Hardware Setup Wiring Diagram and Connections Complete Code with Explanation Customization and Improvements Troubleshooting... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now