Measure Volts whit digital pin

Hello.
Is there a sensor to measure volts using a digital pin connected via esp01s?
Thanks

AC volts or DC volts?

There are a few i2c devices that home assistant supports that can measure DC voltage (and current). But i2c requires two GPIO pins (data and clock).

e.g.

More here: https://esphome.io/#electricity

ESP01S doesn’t really have these two pins?
SCL and SDA?

So I can’t make it with this board?

I had I2C running on ESP01 for BMP280 on TASMOTA. You just had to assign SCL and SDA to 2 of its pins. Don’t see why you couldn’t do this in ESPhome.

Don’t connect I2C sensor until you come out of flash mode.

Thanks for answer
I’ll try as soon as the sensor comes and I’ll let you know how it turned out :slight_smile:

I still prepared the code. It’s fine?

substitutions:
  device_name: ESP-Vodomer
  friendly_name: ESP-Vodomer

esphome:
  name: esp-relay1
  platform: ESP8266
  board: esp01_1m


sensor:   
  # TCRT5000 pulse counter
  - platform: pulse_counter
    id: water_pulse_counter
    name: "${friendly_name} water consumption"
    pin: GPIO1
    update_interval: 2sec
    internal_filter: 100ms
    unit_of_measurement: "L/min"
    accuracy_decimals: 0
    icon: "mdi:water"
    filters:
      # Divide by 60
      - multiply: 0.0167
      - lambda: return abs(x);

#INA226 DC current and power sensor
  - platform: ina226
    address: 0x40
    shunt_resistance: 0.1 ohm
    current:
      name: "INA226 Current"
    power:
      name: "INA226 Power"
    bus_voltage:
      name: "INA226 Bus Voltage"
    shunt_voltage:
      name: "INA226 Shunt Voltage"
    max_current: 3.2A
    update_interval: 60s

Remember to add in section something like

i2c:
  sda: 0
  scl: 2
  scan: True
  id: bus_a
1 Like