Tutorial - How to control a PWM fan with an ESP32 and Home Assistant

Поділитися
Вставка
  • Опубліковано 11 січ 2025

КОМЕНТАРІ • 106

  • @Americancosworth
    @Americancosworth Рік тому +40

    This was shockingly professional...who are you and what did you do with Jason?!

  • @IsmaelLa
    @IsmaelLa Рік тому +7

    This could be the most easy ESP32 tutorial to follow out there. Dispelled a lot of mysteries for me with these devices and it's use. So much thanks!

  • @bigbigspoon
    @bigbigspoon Рік тому +14

    Yes more ESP and Home assistant tutorials please. Love this stuff.

  • @adfjasjhf
    @adfjasjhf Рік тому +4

    I'm still kind of a new to Home Assistant even though I have setup some automatizations already but WOW! This was simplest and easiest tutorial which I've seen. I'd love to see more content like this.

  • @eclair4151
    @eclair4151 Рік тому +7

    Just a heads-up, you will need to make sure your fan actually accepts 3.3v for the PWM logic. Certain fans require a 5v PWM signal, so you will need a 3.3v -> 5v I2C Logic Level Shifter

    • @a2shadow
      @a2shadow 10 днів тому

      Can you please explain a bit more about this? How the fan that the video owner has is working with his setup? I did not see a mention of the 3.3v -> 5v I2C Logic Level Shifter and now concerned that my shopping of the items may not be enough.

    • @eclair4151
      @eclair4151 9 днів тому

      @@a2shadow each fan is different, most do accept 3.3v input for pwm, but you can check the tech sheet on most fans website which should have some more details

  • @Timi7007
    @Timi7007 Рік тому +3

    This is such a clean video, I was almost waiting for stuff to go sideways the whole time 😂 Well explained, Jason!

  • @victor2410
    @victor2410 Рік тому +3

    This video is like the old days of Plex tutorials. Nice tutorial video! Liking the new video bumper too!

  • @djlalorocks
    @djlalorocks Рік тому +5

    Would love to see how you incorporate the temp sensor! Great video, was just thinking how I would do this almost exactly!

  • @AshishRawal
    @AshishRawal Рік тому +7

    Great video! Very helpful. Have been looking for this to setup a cooling fan for my in-ceiling projector. Would really love to have the temperature sensor integrated in it. Would be a big help if you can make a short addendum video to this showing how to integrate the temperature sensor and the HA code too. 😊👍🏻

  • @tombloemker9434
    @tombloemker9434 Рік тому

    I'm working on a solar fridge idea, the required fan in my prototype was one of that last pieces to address. I'm resolved to your serendipitous timeing and content as miracle from God.

  • @TechySpeaking
    @TechySpeaking Рік тому +9

    Wow, this is actually a really good video Jason.

    • @scubieman
      @scubieman Рік тому +2

      Better than a movie review

    • @bigbigspoon
      @bigbigspoon Рік тому +1

      @@scubieman How about spoon reviews?

    • @scubieman
      @scubieman Рік тому

      @@bigbigspoon all the love

  • @dam_j4105
    @dam_j4105 Рік тому +14

    I NEED a temp / humidity upgrade to this. PLEASE!

    • @rikwisselink-bijker
      @rikwisselink-bijker 9 місяців тому +5

      My vote would be a CO2 and humidity upgrade to this, so you can ramp up the fan when a room is humid and/or has high CO2 levels

  • @koevoet7288
    @koevoet7288 Рік тому +5

    Great explanation! I’d watch an entire series on esphome.
    Only thing that could be better imo is a bit more zoom when screencapturing

  • @paul30003
    @paul30003 9 місяців тому +5

    You need a voltage divider on the tacho pin to make the 12v pulse compatible with the 3.3v logic.

  • @ShahzadKhanSK
    @ShahzadKhanSK 3 місяці тому

    Thanks for a good intro. You found a new subscriber. I already have a PWM fan. New to breadboard and wiring stuff but after seeing your tutorial, jumping straight to Amazon. Keep up with tutorials on ESP and Home Assistant.

  • @noryakky2159
    @noryakky2159 16 днів тому

    Bruh, that was good. I'm about to do exactly this and you saved me hours of research!

  • @MarcelodeSouzaSilva
    @MarcelodeSouzaSilva 7 місяців тому +3

    Great simple video! Please show the version with temperature sensor and automation... Thanks!

  • @rera1986
    @rera1986 Рік тому +8

    This video was the DEALbreaker for me, I’ve ordered som esp’s, and it will bee awesome, if you could show how the temperature sensor could bee in the installation also, it Will bee nice, then i will make it in ny network/server rack

    • @loproc
      @loproc 3 місяці тому

      captive_portal:
      sensor:
      - platform: pulse_counter
      pin: GPIO13
      name: PWM Fan RPM
      id: fan_pulse
      unit_of_measurement: 'RPM'
      filters:
      - multiply: 0.5
      count_mode:
      rising_edge: INCREMENT
      falling_edge: DISABLE
      update_interval: 3s
      - platform: dht
      pin: GPIO2
      temperature:
      name: "Serverskab temperature"
      humidity:
      name: "Serverskab humidity"
      model: DHT11
      update_interval: 10s

  • @RonUSMC
    @RonUSMC 10 місяців тому

    I followed the tutorial and the fan would do all kinds of powering up and down. I thought it was because the pwm voltage was low, but Noctua said that 3v pwm is fine. Then I finally read the warning at the beginning of the "logs" command in ESPHOME about GPIO12 being a pin you should avoid. I switched it to GPIO15, the 3rd post on the other side and it worked like a charm.

    • @HannesSchleeh
      @HannesSchleeh 6 місяців тому

      That is not right, it works with 3 Noctua 14" fans in my installation!

  • @Ploughedcoconut
    @Ploughedcoconut 8 місяців тому

    Exactly the tutorial I have been looking for and you executed the presentation excellently. Many thanks 🎉

  • @JamieStuff
    @JamieStuff Рік тому +4

    The first Jason + electricity video I've seen that didn't make me cringe... :)

  • @coochoocoocoo
    @coochoocoocoo 3 місяці тому +1

    Can you add an example with an addition of a DHT11 humidity sensor to turn on/off the fan? BTW, super simple guide , thanks.

  • @ronsum232
    @ronsum232 Рік тому

    First of your vids I've come across... very well done!

  • @mobi8138
    @mobi8138 Рік тому +1

    Yeah, let's see the temp sensor also. Thanks!

  • @youham7066
    @youham7066 Рік тому +4

    Do we need to lower the tach pin down to 3.3V with two voltage dividers resistor? Does straight connect tach pin to esp32 safe?

  • @bigbronx
    @bigbronx Рік тому +5

    Isn't the PWM signal expected to be 5V? But the ESP32 outputs 3.3V right?
    Same with the rev counter signal coming from the fan, isn't that 12V? And you are putting that directly into the 3.3V ESP32, ain't that a bad idea?

    • @aaronalquiza9680
      @aaronalquiza9680 3 місяці тому +1

      thank you for noticing that, i was about to do the same as the video.

  • @PWOODHAMS
    @PWOODHAMS 11 місяців тому

    Love the diy esphome stuff. Please sir, may I have another.

  • @zaaap0
    @zaaap0 8 днів тому

    Great tutorial. Maybe you know why when it's OFF it stays at 1570RPM? Noctua 60mm 12V PWM

  • @bestgoprovideo
    @bestgoprovideo Рік тому +1

    Really nice tuto, thanks for sharing this with us. I would really appreciate another video about the temperature sensor integration. What is the name of the adaptor for connecting the DC connector to the breadboard?

  • @lethuer
    @lethuer Рік тому +2

    Why you connected tachosignal directly to an esp gpio? If I‘m right tachosignal is a 12v pulse and max voltage for gpio pin is VDD (max 3.6v) + 0.3v… so you possibly could destroy the pin.

  • @EmilePolka
    @EmilePolka Рік тому +5

    that 12v to 5v regulator is not needed, all ESP32 devboard comes with ASM1117 voltage regulator, it can accept 5v - 24v via VCC pin.

    • @Bytemybits
      @Bytemybits  Рік тому

      Well damn.. I thought they could only do 5v. 😂 oops

    •  Рік тому

      is that true for *ANY* ESP32? The internet seems to be not sure about this and you read a lot of "should work" :D

  • @skltfz4997
    @skltfz4997 3 місяці тому

    the moment sublime the moment transcend

  • @Motomurphy
    @Motomurphy Рік тому

    perfect. never thought of doing this. thanks.

  • @simoneggersdorfer5305
    @simoneggersdorfer5305 2 місяці тому

    what's that component at 3:57 called? or rather the blue part??

  • @DavidWierwille
    @DavidWierwille Рік тому +2

    Hi, I have a question. Why are you able to completely stop the fan? When I try to do that, the fan continues to run even when turned off. In other videos, they use a relay in between. Why does it work for you without one :-) Thanks

    • @ThomasKlinder
      @ThomasKlinder Рік тому

      In this video he doesn't show the relay. Without a relay, the fan continues to run at the minimum speed because with PWM control there is always 12V on the fan.

  • @giollaliddy5817
    @giollaliddy5817 10 місяців тому

    great video. id like to do this project but have multiple fans (15 total). They dont need to be indivual speed control. If I wanted to connect multiple fans and have all speed controlled together as one fan. . . is it a case of using fans that can be daisy chaimed. . such as phanteks T30-120??? assuming of course that power supply is capable of enough amperage

  • @wilk36
    @wilk36 8 місяців тому

    This is great for my mini pc home server/nas/router cabinet!! And u were saying we can add in a Temp sensor, my question is, since my HA is running on my mini pc server(pve), and HA can read the pc cpu temp, is it possible for HA to auto adjust the fan speed according to the temp of my mini pc?

  • @vonwerderc
    @vonwerderc Рік тому

    Fantastic video. Would this work with daisy-chained arctic P14 fans? I saw designs for making a corsi rosenthal box with pc fans instead of a box fan for more silent operation. This seems like an absolutely perfect implementation for powering the fans.

  • @nilsal7442
    @nilsal7442 6 місяців тому

    Wow! what an easy to follow and high-quality tutorial! Thanks this was exactly what i need 😊😁 would that also work with an 24v powered noctua fan? If i have the right stepdown converter?

  • @J0stik
    @J0stik Рік тому

    in next video can you tell us how to control L298N with esp32 in home assistant ? for example to control peristaltic pumps, and make very simple automation of dosing few ml of liquid ? would probably save my sanity ......

  • @val.lak4321
    @val.lak4321 Рік тому

    Thank you for this tutorial!

  • @vcistrate
    @vcistrate 4 місяці тому

    Hello Mister. Can you tell me how i can do exactly what you did but with a 2 wire fan? I need to do a home assistant automation that controls the rotation of a 2wire fan based on the internal temperature of a device, temperature that i already have in HA. Control will need to be done automatically by HA as i don't have how to stay and turn the regulation switch between low & High all the time. Thanks!

  • @MrSuperSnuiter
    @MrSuperSnuiter Рік тому

    Awesome tutorial please make lots more. 😀

  • @fredrikjag
    @fredrikjag 2 місяці тому

    Can this be done cleaner some how?
    Would it be possible to use the ESP it self to power the fan instead with the use of a boost converter or something?
    Without having to include the secondary power adapter?

  • @dennisb.4655
    @dennisb.4655 Місяць тому

    @Byte My Bits does that also Work with a 24V pwm Fan?

  • @RND-USA
    @RND-USA 10 місяців тому

    Hi, this is so cool! Do you know if there are any Home Assistant or Homekit (or smart device) diy projects that support pwm for monochromatic LEDs that only have the two pins (ground and positive) and no data? I have some LED signs that only have about 120 leds on each one of them but they are super bright! I’m dying to use one of my extra microcontrollers. I bought some mosfet modules just in case I can find a project. Any thoughts would be very appreciated.

  • @hundsboog
    @hundsboog Рік тому

    Great great great!! Thank you for that video! Question: Is there a way to control an array of more fans as well? I mean not controlling one by one individually but that whole array? It is for blowing air against an area of an basement where mold gets up easily. Thank you!

  • @HannesSchleeh
    @HannesSchleeh 6 місяців тому

    Hi, done this before and it worked. Tried it again but with a M5Stack Atom Lite. There is no GPIO12 and 13 on this ESP. Can I change the GPIO to work with the M5Stack Atom Lite?

  • @MyGoogleYoutube
    @MyGoogleYoutube Рік тому +1

    Could this be used to control a brushless 12v fan?

  • @martenkl-71
    @martenkl-71 11 місяців тому +1

    I am looking for any solution that follows PC-fan-specs which this sadly do not, the PWM clock should be @25kHz, anyone know if this is possible with ESP32?

  • @elmonte7834
    @elmonte7834 Рік тому +1

    @bytemybits I followed your video and have added a esp32 to Home Assistant. I can see fan switch and rpm reading in my discovered entity. Changing fan speed works but off/on does not. What can I do to turn off the fan from HA?

    • @vanDyk101
      @vanDyk101 Рік тому

      @Bytemybits Same here. It always spins minimal speed when turned off.

    • @ThomasKlinder
      @ThomasKlinder Рік тому +1

      In this video he doesn't show the relay. Without a relay, the fan continues to run at the minimum speed because with PWM control there is always 12V on the fan.

    •  Рік тому +1

      @@ThomasKlinder in which video is the relay shown?

  • @simonemastellonephotography
    @simonemastellonephotography 6 місяців тому

    hi thank you for the guide, however i am able to read rpm of the fun but not to turn off or reduce rpm, any reason why?

  • @lordtyroxx
    @lordtyroxx 10 місяців тому

    I’m guessing these computer fans don’t have the physical capability of running in reverse? I thought I could avoid my engineering jank just this once, but alas. Guess I’ll just have to manually flip the fan around if I want it blowing the other way for more flexible ventilation

  • @OnkleHo
    @OnkleHo 5 місяців тому

    First of all, thank you for the great video.
    I have my fan running with HA!
    Does anyone have 2 fans running on an ESP with HA? I would like to connect a second fan and control it via HA.

  • @damian007567
    @damian007567 6 місяців тому

    How does this work? I think the esp32 can only output 3.3v pwm signals while a standard pc fan expects 5v, isn't there a logic switcher needed?

  • @Gawkowy
    @Gawkowy 8 місяців тому

    great tutorial!
    im tring to make fan control for rack cabinet. for me control of pwm is not possible :( i can only turn off and on. i see actual pwm value, it is always maximum 2400 rpm. when i move slider nothing happens.
    would be great to have also temperature controlled pwm fan!

    • @Gawkowy
      @Gawkowy 8 місяців тому

      i found that there was missing "" in the code on frequency: "10000 Hz". but now rpm are fluctuating if i set other value than 100%. any help?

  • @nicolapevere968
    @nicolapevere968 10 місяців тому +1

    No pull up resistor?

  • @keramssj3
    @keramssj3 8 місяців тому +2

    I can control my fan but I can't turn off :(

  • @Pro4TLZZ
    @Pro4TLZZ Рік тому

    I have no need for this video but it was great so i left a like

  • @RixtronixLAB
    @RixtronixLAB Рік тому

    Creative video, well done, thanks for sharing it :)

  • @elmonte7834
    @elmonte7834 Рік тому +1

    subscribed. thanks for good video

  • @lavacat720
    @lavacat720 Рік тому

    Are we nerds on the same brain wavelength? I was thinking about this yesterday and saw this today!

  • @theusuario-pb5xk
    @theusuario-pb5xk Рік тому

    do yoy know if this can be done with a Wemos D1 mini or a esp8266?

  • @mrbeats4065
    @mrbeats4065 8 місяців тому

    and how does it work to make an own app that can be controlled via phone

  • @bestgoprovideo
    @bestgoprovideo Рік тому

    Does someone have a blueprint or an automation to make the RPM fluctuate in relation with the increase/decrease of a temperature sensor. (Just an idea for a future video)

  • @enriqueenrique-hd7zj
    @enriqueenrique-hd7zj Рік тому

    Dear friends, I have assembled two Noctua NF-A8 PWM fans and apparently everything works as expected. I can turn the fans on and off and change the speed all with an ESP32 without a TTL converter board.
    I have connected them directly, 12V power supply for the fans and the 2 control signals directly from the fans to the ESP32. I use 2 different power supplies, 5v for the esp32 and 12v for the fans. I have joined the gnd of both feeders together with that of the esp32 so that everything works ( It works more or less well, from 0% to 9% the fans are stopped and from 10% to 100% the speed varied perfectly, I don't understand this error range from 1% to 100% but it more or less meets my expectations )
    I have found a bug. While the fans are spinning, if I disconnect the power from the esp32 and reconnect it, the esp32 protects itself and does not start, the esp32 feeder making noise. I have to turn off the power to the fans, wait for the esp32 to start and then plug in the power to the esp32 and everything works fine again. Another option to solve the problem is to disconnect the Output pwm pin of the esp32, then the esp32 boots correctly. It seems that some noise is sneaking through the output control pin.
    It's not a big problem but it makes it impossible for me to use a single 12v power supply for the fans with a 12v to 5v converter to power the esp32. Has anyone had this problem and how to solve it?
    I would greatly appreciate the help. I have tried with some filtering capacitors connected from the output pwm to gnd pin but the operation of the fans varies although the esp32 starts correctly depending of the capacity of capacitors. Thanks everyone for your help. Kind regards

    • @petervidic1301
      @petervidic1301 10 місяців тому

      Did you solve this issue? I'm planning to assemble controller for 2 of my Noctua industrial pwm 3000 fans. I need something reliable.

  • @g.s.3389
    @g.s.3389 11 місяців тому

    just one question:
    why? filters:
    - multiply: 0.5

  • @timnerenberg
    @timnerenberg 4 місяці тому

    Great Video but you don´t have to Step down the voltage. Your ESP32 has a build in Voltage Regulator. Just pluf the 12V in to the Vin Pin. Do not Plug it into 5V!!!

  • @MarkusBurrer
    @MarkusBurrer Рік тому +2

    The typical PWM ferquency for PWM fans like this is 25kHz. Maybe your 10kHz might be to low for some fans

  • @moldo.cel.barbos
    @moldo.cel.barbos 7 місяців тому

    cant the VIN pin take up to 20v or so you wouldn't need any converting? Im a noob as well so this is a legit question not a corection

  • @nathanwalledge368
    @nathanwalledge368 Рік тому

    My fan never fully turns off it slowly spins, at full ramp HA displays 55000 RPM?

    • @andriyripka3802
      @andriyripka3802 5 місяців тому

      hi, I have the same problem, have you found how to switch it off?

    • @nathanwalledge368
      @nathanwalledge368 5 місяців тому

      @@andriyripka3802 unfortunately not

  • @scubieman
    @scubieman Рік тому +3

    First.... Hell with you nate!

  • @shephusted2714
    @shephusted2714 Рік тому

    cut out the breadboard

  • @Jasoonsan
    @Jasoonsan 10 днів тому

    Pin Pin Pin....Vervy Nice!!!!! Pin Pin Pin

  • @timmyfingaz100
    @timmyfingaz100 Рік тому

    cough *mosfet*

  • @CGGC0202
    @CGGC0202 Рік тому

    Whats with this new informative format video ? totally not your style, its almost professional video

  • @EvoPortal
    @EvoPortal 8 місяців тому

    Just use a 555 timer... why bother with all this nonsense?

    • @kukumalu255
      @kukumalu255 7 місяців тому

      can you connect it to home assistant ?

    • @EvoPortal
      @EvoPortal 7 місяців тому

      @@kukumalu255 You sure can but who the heck use all that home assistant garbage?

  • @jonathan.sullivan
    @jonathan.sullivan Рік тому +2

    First, S**k it Nate

    • @bigbigspoon
      @bigbigspoon Рік тому +2

      I look forward to this comment on all BMB videos! SAhk it NATE!

    • @TechySpeaking
      @TechySpeaking Рік тому +2

      Yeah, fuck that guy.

  • @rallygallery
    @rallygallery Рік тому +3

    First

  • @DarrenChin60Days
    @DarrenChin60Days 3 місяці тому

    INFO ESPHome 2024.9.2
    INFO Reading configuration /config/esphome/server-fan.yaml...
    ERROR Error while reading config: Invalid YAML syntax:
    mapping values are not allowed here
    in "/config/esphome/server-fan.yaml", line 34, column 8
    i follow the same, but getting this msg

    • @vanlongit
      @vanlongit 2 місяці тому

      u can try this
      sensor:
      - platform: pulse_counter
      pin: GPIO13
      name: PWM Fan1 RPM
      id: fan_pulse
      unit_of_measurement: 'RPM'
      filters:
      - multiply: 0.5
      count_mode:
      rising_edge: INCREMENT
      falling_edge: DISABLE
      update_interval: 3s
      output:
      - platform: ledc
      pin: GPIO12
      frequency: 25kHz
      id: fanhub_pwm
      fan:
      - platform: speed
      output: fanhub_pwm
      name: "PWM Fan1"