Increase ESP32 BLE LE Power

I have researched the ESP32 but was unable to find an example of which file, and how to modify the code to increase the Bluetooth power in HomeAssistant. One of the soil moisture sensors is about 20 ft from the device and is having difficult connecting at that distance.

Any assistance is greatly appreciated, Ron

Normally you would put an ESP32 close to the bluetooth source you want to communicate with and connect that esp32 over wifi. I don’t think you can increase the bluetooth signal strength.

This is a sample of an esp32 I use for a xiaomi plant sensor. The extra binary sensor is there because the battery sensor does not work, so I track if I can still find the plant sensor (there are other ways, but this works just fine too):

  name: ble-tracker-1

  board: esp32dev
    type: arduino



  password: !secret ota_password_ble_tracker_1

  ssid: !secret wifi_ssid
  password: !secret wifi_password

    ssid: "Ble-Tracker-1 Fallback Hotspot"
    password: !secret fallback_hotspot_password_ble_tracker_1


    interval: 165ms
    window: 165ms
    duration: 61sec
    active: false

  - platform: ble_presence
    mac_address: C4:7C:8D:6E:16:12
    name: "Buitenplant"
    device_class: presence
  - platform: xiaomi_hhccjcy01
    mac_address: 'C4:7C:8D:6E:16:12'
      name: "Buitenplant temperatuur"
      name: "Buitenplant vochtigheid"
      name: "Buitenplant lichtintensiteit"
      name: "Buitenplant geleiding aarde"
      name: "Buitenplant batterijniveau"

That is the exact esp32.yaml and sensor I am using. What distance can you reliably connect to the sensor?

I know there is a way of increasing the ESP32 BLE LE power, but I have not been able to find the file containing the values in the HomeAssistant installation.


I do not think there’s an easy answer to the distance. I put one in my garden shed for the back garden, and one in my utilities cabinet for the front garden. That works fine, but it all depends on walls and other things in between.

The xaiomi moisture sensor is in a planting container outside a greenhouse where the ESP32 and other system components are located. I agree it would be advisable to keep the sensor as close as possible but I am stuck with this 20 ft distance.

Isn’t it the strength of the xiaomi plant sensor that needs the power increase then? The esp32 is only listening.

I would expect the antenna to be of great influence. Maybe there’s an esp32 with an external bluetooth antenna connector? I know that is possible for wifi, but not sure for bluetooth.

1 Like

Just read: wifi and bluetooth share the same antenna, so an esp32 with external antenna should work better. And as I said before, The esp32 isn’t transmitting, just listening. So I do not think there’s any point in increasing transmission strength.

I have seen that some of the ESP32 boards support an external antenna and some of the boards share an antenna between WiFi and BLE. I don’t know if it is possible to increase the power on the sensor, so I was starting with the ESP32. With no obstructions are you getting over 20 ft?

I have obstructions, and not 20ft. I can move away a bit more, but then I’d still have the obstructions. Besides, your mileage may vary as boards may have different quality antennas. But inside I have one under a couch at 15 feet working just fine.

Here are my range results for info: