Esphome: hallsensor on ESP8266

hello,

i ve a external analog hall sensor
image

how can i use it with esphome?
i had try this:

sensor:
  - platform: esp32_hall
    pin: 2
    name: "ESPhome_Gaszaehler"
    unit_of_measurement: 'm^3'

but dont work

INFO Reading configuration /config/esphome/gaszaehler.yaml...
Failed config

sensor.esp32_hall: [source /config/esphome/gaszaehler.yaml:19]
  
  Component sensor.esp32_hall doesn't support ESP8266

Post your complete ESPHome YAML source file. If you’re attempting to use an ESP8266 device, apparently the platform ESP32_hall won’t work. Try with an ESP32 device, instead.

1 Like

Searching a bit more, you may not be able to use that particular device. :frowning:

The KY-003 hall sensor module is based on the 3144EUA-S hall-effect sensor and has a higher operation voltage between 4.5V and 24V. Therefore the KY-003 module can be connected to an Arduino, but not to an ESP8266 or ESP32 microcontroller board because the operation voltage of 3.3V is too low. The KY-003 is smaller in size because there is only a digital output signal from the sensor module.

1 Like

i havent a ESP32. i ve only the ESP8266 with a external sensor.

it seems, that esphome have no solution for me. thx

i ve a KY-035

Hard to know how this got past you

The esp32_hall sensor platform allows you to use the integrated hall effect sensor of the ESP32 chip to measure the magnitude and direction of magnetic field around the chip

I think the ky-035 should be able to be used with the adc pin.

i had try it, but i see no value changes if a add a magnet in the near of the hall sensor…

esphome:
  name: gaszaehler
  platform: ESP8266
  board: nodemcuv2

wifi:
    ssid: "my_ssid"
    password: "my_pass"
    manual_ip:
        static_ip: 192.168.1.112
        gateway: 192.168.1.1
        subnet: 255.255.255.0
        dns1: 192.168.1.1
    ap:
      ssid: "Gaszaehler Fallback Hotspot"
      password: "my_pass"
    
sensor:
  - platform: adc
    pin: A0
    name: "ESPhome_Gaszaehler"
    unit_of_measurement: 'm^3'



api:
    password: "my_pass"
    
ota:
    password: "my_pass"
    
logger:
  level: DEBUG

I know this topic is super old, but replying to help someone who lands here looking for a solution.

I have the exact same Hall sensor - KY-003. Few things to note
Its Operating voltage is 4.5V…24V and the Output is Digital therefore won’t work as platform: adc

Mine is hooked up to a Sonoff SV which is an ESP8266-based relay. I configured it as a binary sensor i.e. something that tells me if its ON or OFF

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO14
      mode: INPUT_PULLUP
      inverted: True
    name: "Door State"

and this is how my cables are connected
Red circle is the Vcc ( since the minimum Voltage req is 4.5, this pin works best )
Green circle is the Gnd
Blue circle is a Signal
sonoff_sv

these is the corresponding connectors on KY-003
ky-003-hall-sensor

Hope this helps someone.

5 Likes

Thanks @rahulvij , I found this when trying to setup an M5Stack Hall Effect Sensor (A3144E).
That’s worked brilliantly for me too, on my M5Stack Atom Lite.
Had to leave a comment in case someone else is trying to setup the A3144E with ESPHome, though I tweaked it a little further when I realized I could specify device_class etc :slight_smile:

# A3144E, magnet over the "I" or "GND"
binary_sensor:
  - platform: gpio
    pin:
      number: 32
      mode: INPUT_PULLUP
      inverted: true
    name: "Second Door"
    id: "second_door"
    on_press:
    - logger.log: "Door closed"
    icon: "mdi:magnet-on"
    device_class: door

Hello, I could get my KY-003 up and running on a ESP8266 d1 mini clone with these information.
Thanks for sharing!

Regards
Christoph

1 Like

Wrong, wrong, wrong. If you can’t help someone or don’t know what your talking about then don’t post wrong information and tell people it’s not possible or they need a different esp board. You can absolutely use the ky-003 or any of them. First, you just need to look at the data sheet, that needs to be your first stop always. This is a digital sensor and doesn’t output an analog signal so it only outputs High/Low. If you don’t know how to use a 4.5v or higher sensor voltage, you asking for help and not giving wrong help. A simple transistor or logic level converter is all they needed to make this work with an esp8266.

Apparently the esp32_hall doesn’t work with an 8266? Ya think?

Hey Christoph,

Can you share your Code?
I’m on the same thing right now trying to get this to work.