From 59e58c23083ebaa825357841b517b41630479256 Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 2 Jun 2018 23:36:38 +0200 Subject: [PATCH] ESP32 Hall Sensor --- esphomeyaml/components/sensor/esp32_hall.rst | 49 ++++++++++++++++++ .../sensor/images/esp32_hall-ui.png | Bin 0 -> 2719 bytes esphomeyaml/components/sensor/index.rst | 1 + esphomeyaml/images/magnet.svg | 1 + esphomeyaml/index.rst | 19 ++++--- esphomeyaml/sensor.csv | 1 + 6 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 esphomeyaml/components/sensor/esp32_hall.rst create mode 100644 esphomeyaml/components/sensor/images/esp32_hall-ui.png create mode 100644 esphomeyaml/images/magnet.svg diff --git a/esphomeyaml/components/sensor/esp32_hall.rst b/esphomeyaml/components/sensor/esp32_hall.rst new file mode 100644 index 000000000..ae0336d4c --- /dev/null +++ b/esphomeyaml/components/sensor/esp32_hall.rst @@ -0,0 +1,49 @@ +ESP32 Hall Sensor +================= + +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 (with quite poor accuracy). + +Please make sure that nothing is connected to pins ``GPIO36`` and ``GPIO39`` if this +component is enabled, as those pins are used for the internal low-noise amplifier used +by the hall sensor. + +.. figure:: images/esp32_hall-ui.png + :align: center + :width: 80.0% + +.. code:: yaml + + # Example configuration entry + sensor: + - platform: esp32_hall + name: "ESP32 Hall Sensor" + update_interval: 15s + +Configuration variables: +~~~~~~~~~~~~~~~~~~~~~~~~ + +- **name** (**Required**, string): The name of the hall effect sensor. +- **update_interval** (*Optional*, :ref:`config-time`): The interval + to check the sensor. Defaults to ``15s``. See :ref:`sensor-default_filter`. +- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. +- All other options from :ref:`Sensor ` and :ref:`MQTT Component `. + +.. warning:: + + The values this sensor outputs were only calibrated with a few magnets and no real "truth" sensor. + Therefore the values could very well be off by orders of magnitude. Besides, this sensor should + only be used to detect sudden high changes in the magnetic field. + + If you have a real magnetic field calibration setup and want to contribute your values to esphomelib, + please feel free to do so 😺. + +See Also +^^^^^^^^ + +- :ref:`sensor-filters` +- :doc:`adc` +- :doc:`/esphomeyaml/devices/esp32` +- :doc:`API Reference ` diff --git a/esphomeyaml/components/sensor/images/esp32_hall-ui.png b/esphomeyaml/components/sensor/images/esp32_hall-ui.png new file mode 100644 index 0000000000000000000000000000000000000000..f061c9cfb5f0416ef65b5449d6443ba2df1cfd83 GIT binary patch literal 2719 zcmb`J_d6R37srFzrLIxxqV}HknwP3rA*2!25~^xdv_b4uMH{uMHWgwdwrCKPR;$8| z+G5nMEv=~5xHhln{R{37?=PQo&hvb~=lj!no|6cLSa5L&a{vGUE=!Op3;FMdUwKWQbg2iIB zw6w;@$8BtEZrr%>^yyP6DJf-TWqEn|=H_M(508_RlkM&8gM)*lq$E5ZUs+kHrlz*F zwY9gm*U->VS67EXAVNYyyu7?jOiXljb!TQ~?Ck7r-MS?sBXe|g1OkDmRBCQ+?%COy ztE=n1d-pmzI$~pE+uPe)TU*o8()|4Ve$aoy;cx>3gWdhZnwpxy!9g?{O{3AKrlz{O zxg((0*M9bXU1{r^Eo|<8f%}BYY(k{gmz0!%LP{1E7F^Qk|*Nv9nnP} z?#5KwgyUR@*+2k*-O19__)gd~eYBOmLmhBQoi)?%98EUPCsjp>Zx+|LuN54JKcE24 z4xhj{$Ksl*m`kn(K{iWV8C1?(&D3J3bwd@f^~{ zXns~*dJ3s=vQkML8GPCS7rV~8^RA0|84>#eIK(2HO~yAS_pqd-n#YAX7xI!}-;XLr ztHoGlf$h%Xo_-)r=+=}vZuus1T-md5zKH}$OIo@N^fy28d7buSCGia-5hxzjZI?$x z@(~|p=`$u}>9TAaVJ5&&glx1S8g*m=zWWRo`$5|2Z^=4e1%1$dbxBN$C@*A=pE z0{%&ngLzQ~GYbJ~^2i%+)0A z?UAW4+HMXhm9eWonSj{qnv1Z~FyW9j|%b-C=@GKt>I z^K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m&sRcU-o94hDx7fnY5M#fc=&(x1^qIR)Cg ziUU6~#VYVJWZ3)K;QNTF>fz`yQRew85ce^#XuJQiq}a?YN{D79C*m}j6j^*wdQIzb zhILI)cmT}zXaX-2$cM4&9P3&OxU&cRkdnRDY*c%?+26jCbW#}^ayMH|k^ImMW}k`M zHq6ALLPU6pr9cGZS>e5ofkg_@}j_|Wc{{hEgpsz0b>8Pl{3z0D!AF+hOS3hXn527*^r2I9tyD c2f_)#4R2YU^fql{FFsCyr5VJu4(J;9U*1 \ No newline at end of file diff --git a/esphomeyaml/index.rst b/esphomeyaml/index.rst index 3f2b88f32..5a507abea 100644 --- a/esphomeyaml/index.rst +++ b/esphomeyaml/index.rst @@ -182,21 +182,21 @@ Sensor Components -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- `BMP085`_ `Dallas`_ `DHT`_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -|DHT12|_ |HDC1080|_ |HTU21D|_ +|DHT12|_ |ESP32 Hall Sensor|_ |HDC1080|_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -`DHT12`_ `HDC1080`_ `HTU21D`_ +`DHT12`_ `ESP32 Hall Sensor`_ `HDC1080`_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -|MAX6675|_ |MPU6050|_ |Pulse Counter|_ +|HTU21D|_ |MAX6675|_ |MPU6050|_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -`MAX6675`_ `MPU6050`_ `Pulse Counter`_ +`HTU21D`_ `MAX6675`_ `MPU6050`_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -|Rotary Encoder|_ |SHT3X-D|_ |Template Sensor|_ +|Pulse Counter|_ |Rotary Encoder|_ |SHT3X-D|_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -`Rotary Encoder`_ `SHT3X-D`_ `Template Sensor`_ +`Pulse Counter`_ `Rotary Encoder`_ `SHT3X-D`_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -|TSL2561|_ |Ultrasonic Sensor|_ +|Template Sensor|_ |TSL2561|_ |Ultrasonic Sensor|_ -------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -`TSL2561`_ `Ultrasonic Sensor`_ +`Template Sensor`_ `TSL2561`_ `Ultrasonic Sensor`_ ================================================== ================================================== ================================================== .. |Sensor Core| image:: /esphomeyaml/images/folder-open.svg @@ -229,6 +229,9 @@ Sensor Components .. |DHT12| image:: /esphomeyaml/images/dht12.jpg :class: component-image .. _DHT12: /esphomeyaml/components/sensor/dht12.html +.. |ESP32 Hall Sensor| image:: /esphomeyaml/images/magnet.svg + :class: component-image +.. _ESP32 Hall Sensor: /esphomeyaml/components/sensor/esp32_hall.html .. |HDC1080| image:: /esphomeyaml/images/HDC1080.jpg :class: component-image .. _HDC1080: /esphomeyaml/components/sensor/hdc1080.html diff --git a/esphomeyaml/sensor.csv b/esphomeyaml/sensor.csv index db8c554ce..0fd2e5b89 100644 --- a/esphomeyaml/sensor.csv +++ b/esphomeyaml/sensor.csv @@ -8,6 +8,7 @@ BMP085, components/sensor/bmp085, bmp180.jpg Dallas, components/sensor/dallas, ds18b20.jpg DHT, components/sensor/dht, dht22.jpg DHT12, components/sensor/dht12, dht12.jpg +ESP32 Hall Sensor, components/sensor/esp32_hall, magnet.svg HDC1080, components/sensor/hdc1080, HDC1080.jpg HTU21D, components/sensor/htu21d, htu21d.jpg MAX6675, components/sensor/max6675, max6675.jpg