ESPHome Support for BMP390 Sensor

I need some help installing the BMP390 Sensor using the ESPHome and ESP-WROOM-32.
I’m looking for the pin-outs connections, and any other code besides ESPHome.com web site.
The ESPHome.com web site doesn’t show any pin-outs connections for the BMP388/BMP390 Sensor.

Thank you for any help on this.
-William

What pinout do you need? You have only SDA and SCL on the sensor to connect (beside +3.3V and GND).
I run BMP390 on my ESP quite fine.

Thanks Mr. Pavel for fast response… I need to know what pins on the ESP32 to connect it to. Also what code should I use for the ESPHome install it. My ESP32 is already setup in ESPHome already, just add the sensor script for the new sensor now.

Thank you,
-William

You connect sensor to those two pins you configured in I2C settings in esphome:

i2c:
  sda: 21
  scl: 22
  scan: true
  id: bus_a

In above example these pins are GPIO21 and 22. You can change that as desired.

Here’s an example for BMP39’ sensor:
https://esphome.io/components/sensor/bmp3xx.html

1 Like

Is there anyway to show the Altitude?

i2c:
sda: 5
scl: 18
scan: true
id: bus_a

Example configuration entry

sensor:

  • platform: bmp3xx
    temperature:
    name: “Outside Temperature”
    oversampling: 16x
    pressure:
    name: “Outside Pressure”
    address: 0x77
    update_interval: 60s

It is:
https://esphome.io/cookbook/bme280_environment.html

However, as i already said for relative pressure, i think that formula is wrong, because temperature is already taken into account inside sensor before it sends absolute pressure, so calculating it again si wrong. But, try out and see if your altitude will change with temperature or not…

Hi Pavel, please help a brother out :), I’m fairly versed in HA however I am only trying my first sensor via ESPHome integration. I use a BMP388 and a D1 mini. I’ve added the i2c section to the esphome sensor yaml.
i2c:
sda: 4
scl: 5
scan: true
id: bus_a

but I am unsure where to add the platform section (in the sensor yaml file or in the HA configuration file) and if the platform is correct (bmp3xx or should be bmp388?):
sensor:

  • platform: bmp3xx
    temperature:
    name: “Attic Temperature”
    oversampling: 16x
    pressure:
    name: “Attic Pressure”
    address: 0x77
    update_interval: 60s

would you be so kind as to point me in the right direction?

Add the platform to the ESPHome YAML. I would use the log facility to observe the node is working correctly.

Ok, so you added I2C section into esphome. Now you must add a BMP sensor into esphome also - so you add this code into esphome, under “sensors”:

sensor:
#define BMP3xx pressure/temperature sensor 
  - platform: bmp3xx
    temperature:
      name: "Outside temperature"
      oversampling: 16x
    pressure:
      name: "Ouside absolute pressure"
      id: abs_pressure_out
    address: 0x77
    update_interval: 60s

Then you can also add relative air pressure, which is calculated:

  - platform: template
      name: "Outside relative pressure"
      icon: "mdi:gauge"
      lambda: |-
        const float STANDARD_ALTITUDE = 315; // in meters, see note
        return (id(abs_pressure_out).state)/powf((1-((float)(STANDARD_ALTITUDE))/44330), 5.255);
      update_interval: 60s
      unit_of_measurement: 'hPa'
      accuracy_decimals: 1

Just change your “STANDARD_ALTITUDE” height to match your area.

Note that HERE is an example of relative air pressure sensor formula, but it includes temperature, which is WRONG. BMx sensors already DO take temperature into account when they send out absolute pressure information. I did point out this erorr a while ago , but there was no particular interest of this fault, so formula on that page is still wrong.
After that you run and connect your D1 mini board to your wifi and HA should recognize it and you’ll have your sensors in HA.

1 Like