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

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ค. 2024
  • A quick tutorial on how to remotely control a regular computer PWM fan with Home assistant and an ESP32 Micro-Controller.
    Components:
    ESP32: amzn.to/3uiLMC4
    USB Power Adapter: amzn.to/46hdAE9
    PWM Fan: amzn.to/46663bq
    Breadboard: amzn.to/3METMUm
    Jumper Wires: amzn.to/46fO1Dw
    DC Connector: amzn.to/3MGCciG
    (As an Amazon Associate, I earn from qualifying purchases)
    CODE:
    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
    output:
    - platform: ledc
    pin: GPIO12
    frequency: 10000 Hz
    id: fanhub_pwm
    fan:
    - platform: speed
    output: fanhub_pwm
    name: "PWM Fan"
    🔥These links support my madness🔥
    💲 NordVPN: www.bmbsucks.com
    💲 Members-Only Punishment: bit.ly/bmbmembers
    💯These are my other Socials💯
    🔹Twitter: bit.ly/BMBTw
    🔹Instagram: bit.ly/bmbinstagram
    🔹Tik-Tok: bit.ly/bmbtock
    🔹Discord: bit.ly/BMBDISCORD
    ✉️P.O. Box for Mail✉️
    Byte My Bits
    P.O. Box 77
    Haysville, KS 67060
    00:00 Intro
    00:17 Components
    01:01 Need to know
    01:24 Plug In ESP32
    02:46 Edit Code
    03:46 Wire 12v Power
    04:32 3rd Pin Tach
    05:02 4th Pin PWM
    05:19 ESP32 Power
    05:53 Pre-Flight Check
    06:39 Plug In and control
    07:42 Can add more sensors
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 78

  • @Americancosworth
    @Americancosworth 10 หลายเดือนก่อน +33

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

    • @lonewolfgeoff
      @lonewolfgeoff 10 หลายเดือนก่อน +3

      scarey! very prof indeed

    • @bigbigspoon
      @bigbigspoon 10 หลายเดือนก่อน +4

      Who is Jason?

    • @jarska92
      @jarska92 10 หลายเดือนก่อน +2

      I know right, it almost felt weird! But this just confirms he can do things really well when he's in the right state of mind, but not all the time, which results in unfinished things and chaos. It's a very familiar thing for me with ADHD.

  • @bigbigspoon
    @bigbigspoon 10 หลายเดือนก่อน +8

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

  • @IsmaelLa
    @IsmaelLa 10 หลายเดือนก่อน +4

    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!

  • @Timi7007
    @Timi7007 10 หลายเดือนก่อน +3

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

  • @adfjasjhf
    @adfjasjhf 10 หลายเดือนก่อน +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.

  • @jarska92
    @jarska92 10 หลายเดือนก่อน +8

    You managed to research and put everything together in a well thought out video. You know what, I say this honestly, I'm proud of how well you did this thing, knowing how things can easily get out of hand with your projects 😄 This looks really good, I'm happy for you. And thanks for the tutorial for others wanting to do the same thing, everything was easy to follow.

  • @victor2410
    @victor2410 10 หลายเดือนก่อน +3

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

  • @tombloemker9434
    @tombloemker9434 10 หลายเดือนก่อน

    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.

  • @Ploughedcoconut
    @Ploughedcoconut 14 วันที่ผ่านมา

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

  • @ronsum232
    @ronsum232 10 หลายเดือนก่อน

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

  • @AshishRawal
    @AshishRawal 10 หลายเดือนก่อน +4

    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. 😊👍🏻

  • @djlalorocks
    @djlalorocks 8 หลายเดือนก่อน +2

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

  • @Motomurphy
    @Motomurphy 9 หลายเดือนก่อน

    perfect. never thought of doing this. thanks.

  • @MrSuperSnuiter
    @MrSuperSnuiter 9 หลายเดือนก่อน

    Awesome tutorial please make lots more. 😀

  • @koevoet7288
    @koevoet7288 10 หลายเดือนก่อน +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

  • @TechySpeaking
    @TechySpeaking 10 หลายเดือนก่อน +8

    Wow, this is actually a really good video Jason.

    • @scubieman
      @scubieman 10 หลายเดือนก่อน +2

      Better than a movie review

    • @bigbigspoon
      @bigbigspoon 10 หลายเดือนก่อน +1

      @@scubieman How about spoon reviews?

    • @scubieman
      @scubieman 10 หลายเดือนก่อน

      @@bigbigspoon all the love

  • @val.lak4321
    @val.lak4321 10 หลายเดือนก่อน

    Thank you for this tutorial!

  • @JamieStuff
    @JamieStuff 10 หลายเดือนก่อน +4

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

  • @rera1986
    @rera1986 10 หลายเดือนก่อน +7

    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

  • @bestgoprovideo
    @bestgoprovideo 7 หลายเดือนก่อน

    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?

  • @dam_j4105
    @dam_j4105 10 หลายเดือนก่อน +7

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

    • @rikwisselink-bijker
      @rikwisselink-bijker หลายเดือนก่อน

      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

  • @Bianchi77
    @Bianchi77 9 หลายเดือนก่อน

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

  • @mobi8138
    @mobi8138 4 หลายเดือนก่อน +1

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

  • @PWOODHAMS
    @PWOODHAMS 3 หลายเดือนก่อน

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

  • @elmonte7834
    @elmonte7834 9 หลายเดือนก่อน +1

    subscribed. thanks for good video

  • @RonUSMC
    @RonUSMC 2 หลายเดือนก่อน

    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.

  • @eclair4151
    @eclair4151 3 หลายเดือนก่อน +1

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

  • @Pro4TLZZ
    @Pro4TLZZ 10 หลายเดือนก่อน

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

  • @vonwerderc
    @vonwerderc 6 หลายเดือนก่อน

    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.

  • @hundsboog
    @hundsboog 10 หลายเดือนก่อน

    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!

  • @everythingquads
    @everythingquads หลายเดือนก่อน

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

  • @youham7066
    @youham7066 6 หลายเดือนก่อน +1

    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?

  • @lethuer
    @lethuer 7 หลายเดือนก่อน +1

    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.

  • @RND-USA
    @RND-USA หลายเดือนก่อน

    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.

  • @giollaliddy5817
    @giollaliddy5817 หลายเดือนก่อน

    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

  • @lavacat720
    @lavacat720 10 หลายเดือนก่อน

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

  • @J0stik
    @J0stik 9 หลายเดือนก่อน

    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 ......

  • @MyGoogleYoutube
    @MyGoogleYoutube 10 หลายเดือนก่อน +1

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

  • @bigbronx
    @bigbronx 5 หลายเดือนก่อน +1

    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?

  • @nathanwalledge368
    @nathanwalledge368 7 หลายเดือนก่อน

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

  • @elmonte7834
    @elmonte7834 9 หลายเดือนก่อน +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 9 หลายเดือนก่อน

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

    • @ThomasKlinder
      @ThomasKlinder 6 หลายเดือนก่อน +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.

    •  4 หลายเดือนก่อน

      @@ThomasKlinder in which video is the relay shown?

  • @theusuario-pb5xk
    @theusuario-pb5xk 6 หลายเดือนก่อน

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

  • @user-oo1oy2qr5u
    @user-oo1oy2qr5u 6 หลายเดือนก่อน +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 6 หลายเดือนก่อน

      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.

  • @bestgoprovideo
    @bestgoprovideo 5 หลายเดือนก่อน

    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)

  • @mrbeats4065
    @mrbeats4065 17 วันที่ผ่านมา

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

  • @EmilePolka
    @EmilePolka 10 หลายเดือนก่อน +3

    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  10 หลายเดือนก่อน

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

    •  4 หลายเดือนก่อน

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

  • @Gawkowy
    @Gawkowy 22 วันที่ผ่านมา

    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 22 วันที่ผ่านมา

      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?

  • @lordtyroxx
    @lordtyroxx 2 หลายเดือนก่อน

    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

  • @martenkl-71
    @martenkl-71 3 หลายเดือนก่อน

    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?

  • @g.s.3389
    @g.s.3389 3 หลายเดือนก่อน

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

  • @nicolapevere968
    @nicolapevere968 2 หลายเดือนก่อน

    No pull up resistor?

  • @enriqueenrique-hd7zj
    @enriqueenrique-hd7zj 3 หลายเดือนก่อน

    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 2 หลายเดือนก่อน

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

  • @scubieman
    @scubieman 10 หลายเดือนก่อน +3

    First.... Hell with you nate!

  • @MarkusBurrer
    @MarkusBurrer 10 หลายเดือนก่อน +1

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

  • @keramssj3
    @keramssj3 9 วันที่ผ่านมา

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

  • @shephusted2714
    @shephusted2714 9 หลายเดือนก่อน

    cut out the breadboard

  • @timmyfingaz100
    @timmyfingaz100 9 หลายเดือนก่อน

    cough *mosfet*

  • @EvoPortal
    @EvoPortal 4 วันที่ผ่านมา

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

  • @CGGC0202
    @CGGC0202 10 หลายเดือนก่อน

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

  • @jonathan.sullivan
    @jonathan.sullivan 10 หลายเดือนก่อน +2

    First, S**k it Nate

    • @bigbigspoon
      @bigbigspoon 10 หลายเดือนก่อน +2

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

    • @TechySpeaking
      @TechySpeaking 10 หลายเดือนก่อน +2

      Yeah, fuck that guy.

  • @rallygallery
    @rallygallery 10 หลายเดือนก่อน +3

    First