Idiots guide to getting an esp32 to control AC Infinity Cloudline EC fans esphome/HA

Hi guys,

I'm not a EE, I only know basic electronics, but I want to be able to control the speed of a S8 fan that I got this year (UIS connector). It has a manual speed controller but I want to be able to control the speed with either EPS32 or Arduino, and eventually integrate it into Home Assistant.

I tried to read this thread in its entirety but due to my limited EE knowledge, it's hard to follow. Can someone more knowledgeable summarize the key learnings please? I think what I got from it is that it uses a 10V PWM, at perhaps 5000 HZ. I know a little bit about MOSFET and PWM. I wonder what's the simplest circuit I can build to do this? Moreover, there's some historical changes between the MOLEX connector and the UIS which further makes this thread hard to follow.

Is it possible to achieve what I need without messing with the circuitry/wires inside the fan electronic box? In other words, just build an external DIY controller that connects to the fan using UIS (or USB-C?).

Someone please make it a truly idiot's guide. Thanks

You got it right. I'm sure you can achieve control without needing with wires, but you'd have to confirm the pins on the connector.

PWM is 4,156hz on my S4. See my measured trace here at various duty cycles:


The fans are likely tolerant to some level of deviations, though, and it is also possible that other models have slightly different frequencies but unless someone plugs in a scope of other models, your guess is as good as mine.

Your best bet is to at least open the fan case to peek inside and see for yourself what connections are there. @ImaginaryTango posted a nice picture of his unit and this is likely resembling yours as well.

My take on the base circuit is here.

You can skip the fuse if you feel lucky. You can also skip the tachometer gpio too, although it's simple to add and brings interesting stats back.
 
Last edited:
You got it right. I'm sure you can achieve control without needing with wires, but you'd have to confirm the pins on the connector.

PWM is 4,156hz on my S4. See my measured trace here at various duty cycles:


The fans are likely tolerant to some level of deviations, though, and it is also possible that other models have slightly different frequencies but unless someone plugs in a scope of other models, your guess is as good as mine.

Your best bet is to at least open the fan case to peek inside and see for yourself what connections are there. @ImaginaryTango posted a nice picture of his unit and this is likely resembling yours as well.

My take on the base circuit is here.

You can skip the fuse if you feel lucky. You can also skip the tachometer gpio too, although it's simple to add and brings interesting stats back.

Thanks. I did read that someone was able to build a controller without modifying the internal electronics of the fan, such that they can still use the AC Infinity manual controller if needed. I also read that there is a 10V line inside and the PWM is coming off that. That 10V is DC, so is the motor actually a DC motor despite the S series being AC (in the sense you plug it into 110 - 220V AC)? Or is the 10V just for PWM?

It also seems like there the 10V for the PWM is being pulled up, such that when there is no controller connected, the fan is at full speed, and the purpose of the controller is to short it to ground in a periodic manner to achieve PWM. Did I understand it correctly?
Thanks
 
Thanks. I did read that someone was able to build a controller without modifying the internal electronics of the fan, such that they can still use the AC Infinity manual controller if needed. I also read that there is a 10V line inside and the PWM is coming off that. That 10V is DC, so is the motor actually a DC motor despite the S series being AC (in the sense you plug it into 110 - 220V AC)? Or is the 10V just for PWM?

It also seems like there the 10V for the PWM is being pulled up, such that when there is no controller connected, the fan is at full speed, and the purpose of the controller is to short it to ground in a periodic manner to achieve PWM. Did I understand it correctly?
Thanks
Yes you understood correctly. None of the suggestions here modify the inner circuit of the fan. Opening the fan cover merely gives you a different access to the wiring. Sending a PWM is a substitute for the out of the box controller. My post with scope captures were taken from the controller that came with the fan.
 
I had to set this aside to get some other work done, and now I'm finally able to get back to it. I want to be sure I'm doing things right before I hook my ESP32 up to the fans. I bought a low end o-scope and used it to verify the square wave signal from the ESP32. So, for immediate questions, I mainly want to know about the wiring. I'm using the wiring diagram from the top of the compartment on the AC Infinity fans:
IMG_2716-Smaller.png
(Note, to avoid confusion, earlier we determined PE is Power Earth, or the ground line in the AC cord and FG is Frame Ground, or the ground for the device. I refer to it as Fan Ground in a diagram - my mistake there!)

I'm using, as reference, the wiring photo from the first post on the thread. It looks to me like this is how I should wire the MOSFET:
MOSFE-Smaller.png
Can someone please verify for me thta I have the write wiring diagram for this?

Also, I see different valued resistors in the PWM OUT line from the ESP32 (I'm using GPIO4 for this). This is the same MOSFET everyone seems to be using (but without a screw terminal for the GND and TRIG lines. Do I need a resistor there, on the yellow line on the right, that runs from the ESP32 GPI4 to the TRIG on the MOSFET?

If I have this all correct and can make it work, then I have a few other questions. I've brought this issue up before, but I don't see an answer to it. With this particular setup, I want to control 2 fans and, of course, if I can do it with one ESP32, that'd save cost and setup time (and maintenence in the long run, keeping up 1 controller instead of 2).

If I'm using one ESP32 to control more than one fan, can I tie the ground lines from all the fans together? I would think, since they're all powered on the same AC circuit (all on the same breaker), they'll all have the sme PE, so it shouldn't be a problem. But, there's also the issue of the +10V lines from the fans. Can I tie them together, as well? I would think so, but I'd rather hear from someone who knows what they're talking about than trust my limited experience in this. I've seen discussion about using the +10V line from the fan to power the ESP32. That'd be quite useful! I would think just using the line from the 1st fan would do that, but I'm wondering if there would be an issue drawing power from only 1 fan out of 2 or more.

One reason I'm looking at this is I'm thinking of making a circuit board that would go in a box, like the original fan controller, and it'd hook up to the fan through the USB-C cable that is used for the original controller. That includes a +10V power supply on the USB connectors. If I could use that for power, there'd be no need for an AC adaptor to power the ESP32.
 
I had to set this aside to get some other work done, and now I'm finally able to get back to it. I want to be sure I'm doing things right before I hook my ESP32 up to the fans. I bought a low end o-scope and used it to verify the square wave signal from the ESP32. So, for immediate questions, I mainly want to know about the wiring. I'm using the wiring diagram from the top of the compartment on the AC Infinity fans:
View attachment 5428863
(Note, to avoid confusion, earlier we determined PE is Power Earth, or the ground line in the AC cord and FG is Frame Ground, or the ground for the device. I refer to it as Fan Ground in a diagram - my mistake there!)

I'm using, as reference, the wiring photo from the first post on the thread. It looks to me like this is how I should wire the MOSFET:
View attachment 5428864
Can someone please verify for me thta I have the write wiring diagram for this?

Also, I see different valued resistors in the PWM OUT line from the ESP32 (I'm using GPIO4 for this). This is the same MOSFET everyone seems to be using (but without a screw terminal for the GND and TRIG lines. Do I need a resistor there, on the yellow line on the right, that runs from the ESP32 GPI4 to the TRIG on the MOSFET?

If I have this all correct and can make it work, then I have a few other questions. I've brought this issue up before, but I don't see an answer to it. With this particular setup, I want to control 2 fans and, of course, if I can do it with one ESP32, that'd save cost and setup time (and maintenence in the long run, keeping up 1 controller instead of 2).

If I'm using one ESP32 to control more than one fan, can I tie the ground lines from all the fans together? I would think, since they're all powered on the same AC circuit (all on the same breaker), they'll all have the sme PE, so it shouldn't be a problem. But, there's also the issue of the +10V lines from the fans. Can I tie them together, as well? I would think so, but I'd rather hear from someone who knows what they're talking about than trust my limited experience in this. I've seen discussion about using the +10V line from the fan to power the ESP32. That'd be quite useful! I would think just using the line from the 1st fan would do that, but I'm wondering if there would be an issue drawing power from only 1 fan out of 2 or more.

One reason I'm looking at this is I'm thinking of making a circuit board that would go in a box, like the original fan controller, and it'd hook up to the fan through the USB-C cable that is used for the original controller. That includes a +10V power supply on the USB connectors. If I could use that for power, there'd be no need for an AC adaptor to power the ESP32.
Did you ever get any further with this, I'm looking to buy a Cloudline fan and would like to have external control of the fan speed via ESp32 and home assistant.
A
 
Did you ever get any further with this, I'm looking to buy a Cloudline fan and would like to have external control of the fan speed via ESp32 and home assistant.
A
I did get it working - basically I used the info from here and got a schematic together. I don't have my notes here - I'm at the workshop and they're on my the computer in the house. I don't have a PCB or anything, I just have it running on a breadboard using the ESPHome config given.
 
I did get it working - basically I used the info from here and got a schematic together. I don't have my notes here - I'm at the workshop and they're on my the computer in the house. I don't have a PCB or anything, I just have it running on a breadboard using the ESPHome config given.
Thats good news, I have seen a few different schematics and configs, when you get a chance would you be able to let me have details of the ones you used as they work. Did you just manage to plug it into the fan using the USB connection?

Thanks
 
Thats good news, I have seen a few different schematics and configs, when you get a chance would you be able to let me have details of the ones you used as they work. Did you just manage to plug it into the fan using the USB connection?

Thanks
What I do remember is that the fan provides +10VDC through the USB-C connector. That's helpful here, but bad otherwise. For a USB-C connector, most hardware will expect +5VDC, and NOT 10, so when they do this, that could break a person's hardware.

Here's what I remember about what I did:

I used 4 USB-C connectors in the design, so it can work for up to 4 fans from one board. There is no power supply from an outside source. I drew power directly from the +10V line on the USB-C cable. I put diodes in to isolate the power line for each USB connector, so there won't be problems with one fan getting +10V when it's not plugged in. As long as one fan is plugged in, the board gets power. (And if it's not connected to a plugged-in fan, it doesn't need power because it's not doing anything!) I used a simple +5V power regulator chip to provide +5V (come to think of it, I might have used 3.3V - not sure) and used that to power the ESP32. I used one GPIO per fan, it drives a MOSFET and there are a few other components for each fan, like pull-up or pull-down resistors. (Have to find the schematic to be sure!) It's a simple circuit that I just used 4 times, once per fan. I did not use the MOSFET several people used here (and have photographed), since that costs more and is on its own small PCB and harder to set up, on a breadboard or on a PCB when I can finally design and use one, and found a MOSFET that does the job fine, for a lower cost and for using less space.

I used the configuration given in this thread for ESPHome. I found, when I tried to use ESPHome for other uses, or tried to add or modify features, to be overly complex in some things, but I found I could always get help on the forums for it on the Home Assistant forums. I looked into other software for the ESP32, but didn't always get the help I needed. ESPHome has forums, and others have Discord channels. (Some don't even have a subreddit.) I find that a forum or a subreddit is better for getting help since, in chat, your request can scroll off and if people don't catch it in real time, it can be tough to get help. (And fewer people see your questions than if it's in a forum.) I did look at one other system that has PWM in their configuration, but the PWM frequency is a lot higher than the one the AC Infinity fans are known to work with. I could never verify it was true PWM because I have a cheap $40 oscilloscope and am not yet at the point where I can justify spending the $300-$350 to get a good one. (So mine doesn't work for but so high a frequency.) On one of them, I tried compiling it myself, using a smaller number for the PWM frequency - but, again, my cheap scope didn't show a true PWM wave. Supposedly it works, but I could only verify the output was a true PWM signal at VERY low frequencies. I've blown out one fan before, and I'm not going to trust a fan with a control circuit unless I know it's outputting the frequency and signal I know is compatible with the fan.

The more I write about this, the more I remember about it, so I'll try to answer what questions I can at this point, since it seems like this thread has dried up and not many people are responding anymore.
 
Found it!

VentFanSchematic.png

So it was a transistor - I can't remember the specs, but it's fast enough. I bought all the parts from Amazon. The ESP32 is a WROOM, so be aware that the pin numbers might change depending on which version of the ESP32 you use.
 
Back
Top