EMC2101 Fan Controller and Temperature sensor
The emc2101 component allows you to control a cooling fan from ESPHome (datasheet). It also provides temperature
sensors and a tachometer. The fan can be controlled either by a PWM signal or by outputing a DC voltage
using its DAC.
The I²C Bus is required to be set up in your configuration for this sensor to work.

ℹ️ Note
Original image at https://learn.adafruit.com/assets/97827 created by by user Bryan Siepert under Creative Commons BY-SA 3.0 and modified for this documentation.
EMC2101 Component
# Example configuration entry
emc2101:
  pwm:
    resolution: 8Configuration variables
- address (Optional, int): Manually specify the I²C address of the sensor. Defaults to - 0x4C.
- inverted (Optional, boolean): Inverts the output so 0 means 100% duty cycle and 1 means 0%. Defaults to - false.
- pwm (Optional): Enable PWM output. - resolution (Optional, int): Determines effective resolution and the frequency of the PWM signal. Defaults to 23.
- divider (Optional, int): Value for the frequency divider. Defaults to 1.
 
- resolution (Optional, int): Determines effective resolution and the frequency of the PWM signal. Defaults to 
- dac (Optional): Enable DAC output. - conversion_rate (Optional, string): The number of digital to analog conversions perfomed per second. One of 1/16,1/8,1/4,1/2,1,2,4,8,16,32. Defaults to16.
 
- conversion_rate (Optional, string): The number of digital to analog conversions perfomed per second. One of 
The PWM signal frequency is determined by the following formula:
$$ \text{PWM Frequency} = \frac{360KHz}{2 \times resolution \times divider} $$ And the PWM resolution, the steps in the duty cycle, is calculated by the following formula:
$$
\text{PWM resolution} = \frac{100\%}{2 \times resolution}
$$
So, with the default values the PWM signal will have a frequency of 7.83KHz and a resolution of 2.17%. The maximum
resolution value is 31 which will configure a frequency of 5.81KHz with a resolution of 1.61%.
EMC2101 Output
output:
  - platform: emc2101
    id: fan_duty_cycleConfiguration variables
- id (Required, ID): The ID to use for code generation, and for reference by dependent components.
ℹ️ Note
When using the
emc2101output with a Speed Fan it is advised to configure the speed_count as twice the resolution so the number of speeds in the fan matches the number of steps in the fan controller.
EMC2101 Sensors
sensor:
  - platform: emc2101
    internal_temperature:
      id: internal_temperature_sensor
      name: "Internal Temperature Sensor"
    speed:
      id: speed_sensor
      name: "Speed Sensor"
    duty_cycle:
      id: duty_cycle_sensor
      name: "Duty Cycle Sensor"
    update_interval: 5sConfiguration variables
- internal_temperature (Optional): The internal temperature sensor. All options from Sensor. 
- external_temperature (Optional): The external temperature sensor. More accurate but it needs an additional transistor to be installed. All options from Sensor. 
- speed (Optional): The fan speed sensor in RPMs. All options from Sensor. 
- duty_cycle (Optional): Duty cycle sensor. All options from Sensor. 
- update_interval (Optional, Time): The interval to check the sensor. Defaults to - 60s.