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

AdaBill

Member
@AdaBill do you have any concerns about having the Esp32 ground hooked directly to the fan’s ground?

I like your approach, because I prefer not to have to mess with the wiring inside the Cloudline fan control box, but was wondering if isolation is a concern. Someone in another thread mentioned that optoisolators are the “correct” way to manage pwm, but I don’t know enough about electrical circuits to understand why that is more correct than using a mosfet the way you are. I saw this post where the poster is using a PC817 optocoupler plus a couple of resistors to control pwm (via an esp32) without an additional MOSFET, either inside the fan housing, like @zen0n and @Kervork have demonstrated, or outside the housing, like your solution, but don’t know if that is a “better”/safer solution or not.

@shimbob I saw your post in one of the related threads and it sounds like you’re managing your system in a similar was to what I’m hoping to accomplish and using optoisolators for pwm fan control. Do you mind describing how you’re controlling fan pwm? Are you adding a mosfet in wiring in the fan’s control box, or just running Esp32 > optocoupler > resistor > fan?
I like the concept of using OptoCouplers (OC's), It is the safest way to connect to devices in the outside world. I always buy the OC relays for my Arduino projects, just out of habit,I figure why not. The MOSFET id just a Solid State Relay in my mind. I started with the MOSFET and since I have everything captive to my project I'm not too concerned about noise from the Infinity fan. I think they have done a much better engineering job than me so I'm not worried. That said, If I do expand my SW to do more functionality and I start seeing funny results, they I'll convert to the OC's.

The dual MOSFETS will give me more current capability but I haven't measured the draw on the PWM and don't think that is a concern. The in cord PLUG had 10VDC in it and I'm assuming that is what is driving the PWM inside the fan. I'm more concerned with not harming the $175 FAN and not so much with my $10 ESP32. I also was very happy to stay OUTSIDE the fan. All my connections are only through the 4 pin connector. I have made no internal mods and if I want to use the fan in some other mode, I just unplug my ESP and plug the original fan's 10 speed controller back in. No harm no fowl.

I did order and have received the PC817 optocoupler parts but unless I have problems I'll save them for another project.
Thanks again @shimbob. Any chance you could share the additional 10v power supply you're using? I wasn't sure if I'd need an additional power supply for just the Cloudline S4, since it sounded like the 10V from the fan would be sufficient, but it sounds like it might be worth adding anyway. I'd like to use the same ESP32 to control PWM for a Mean Well LED driver (HLG-240H-48AB) on another opto-isolatior, so it'd be great if I could use the same 10v supply for both breakout boards.
 

AdaBill

Member
I'm NOT adding any voltage to the circuit, it is all internal to the fan. The connection with PWM isn't tied into the + side of the supply, it just completes the ground connection. Remember that when the plug is disconnected that the fan runs at 100%. 0 PWM (open circuit) = 100% fan, reverse logic.

The PWM signal does not provide power to the device itself, it just controls the SSR or equivalent that does the actual power transfer. So the actual current (Load) in the PWM circuit should be very LOW. These PWM circuits operate at a frequency. Just make sure that the required PWM frequency can be met by the intermediate device you choose. The MOSFET module I'm using can support the 5K i'm using for the PWM on the fan. Someone in one of the blogs mentioned this freq. As I remember the OC has a more limited range. Nothing is every easy.

From your driver numbers above, here is the link to your driver.
From the looks of it you can just put a 10K POT between the DIM + - connections and their chart shows the various %PWM with equivalent power output. Page 4/10. Do not add any external power, just use what is provided by the Meanwell.

I'm not an EE but I think you are correct by keeping the supplies seperate with a OC. If I had more than just the fan in the circuit I also would use an OC. If you give it a try with just the LED portion hooked up, it should tell you if it works or not. With the OC, I THINK that you would achieve the required isolation between various power supplies. When in doubt, add the OC to the fan also, belt and suspenders. You are starting to get into $$$ if you burn out the devices. Good luck and let me know how it went.
 

HVACker

New Member
Hey everyone, been lurking for a few weeks. It looks like there's an ongoing debate about whether to use power MOSFETs, opto-isolators, or a combination of both. I thought I would contribute to the discussion. My background is in engineering, but I'm not a pro EE, so please take my advice with a grain of salt!

A friend of mine recently bought the new Cloudline A6 lite (with the new USB-C "UIS" controller, NOT the molex-connector). A USB-C cable drops down from the fan unit and plugs into the Controller 62. It looks like the input voltage is 10V DC (as expected from other posters), and the power rating is a mere 0.5W. The label on the back specifies that the output is a PWM signal.

I opened up the controller and inspected the circuit board to learn a bit more. It appears that there is a microcontroller in here that controls the LEDs and drives the PWM signal, as expected. The entire board is powered directly from the fan's 10V DC power output, which is regulated by a fairly low-power voltage regulator (CJ78L05). From what I can tell, the PWM signal is output by the MCU, which drives an NPN transistor (package says J3Y) which is likely stepping up the voltage to the 10V PWM output to the fan. According to the datasheet, that PWM transistor dissipates a maximum of 0.3W.

Without seeing the schematic, I can't know exactly how these parts are wired up. But from visual inspection, I can infer a few things:
  1. The 10V DC power output from the fan must be susceptible to rippling/dips, which is why there are two electrolytic capacitors (a 47 uF one between the 10V input and the voltage regulator, and another 100 uF one after the output of the voltage regulator). If you plan on powering your MCU directly from the fan's 10V DC power, you might want to consider adding a couple of shunt capacitors like these.
  2. At least for these newer AC Infinity Fans with the USB-C interface (not the molex ones), the power MOSFETs are probably overkill, since the controller they provide is very low power. Low power transistors will probably suffice.
  3. I don't see any opto-isolators on the PCB of the Controller 62, which leads me to believe that opto-isolation may also be unnecessary--the manufacturer doesn't even do it for their own controllers.
I'm not sure if the older fan models with the molex connector is any different, so again take these inferences with a grain of salt. However, considering that AC Infinity sells molex<>USB-C adapters, I'm led to believe that the PWM power requirements would be the same for the new and old fans. Maybe someone can do a similar investigation with the older molex connector controller.

I'm going to buy some parts and see if I can make a drop-in replacement controller driven by an ESP32. The plan is to wire the PWM signal to a molex connector, and then plug that molex connector into the molex -> USB-C adapter that AC Infinity sells. I'll report back if/when I get it working.
 

Attachments

AdaBill

Member
Hey everyone, been lurking for a few weeks. It looks like there's an ongoing debate about whether to use power MOSFETs, opto-isolators, or a combination of both. I thought I would contribute to the discussion. My background is in engineering, but I'm not a pro EE, so please take my advice with a grain of salt!

A friend of mine recently bought the new Cloudline A6 lite (with the new USB-C "UIS" controller, NOT the molex-connector). A USB-C cable drops down from the fan unit and plugs into the Controller 62. It looks like the input voltage is 10V DC (as expected from other posters), and the power rating is a mere 0.5W. The label on the back specifies that the output is a PWM signal.

I opened up the controller and inspected the circuit board to learn a bit more. It appears that there is a microcontroller in here that controls the LEDs and drives the PWM signal, as expected. The entire board is powered directly from the fan's 10V DC power output, which is regulated by a fairly low-power voltage regulator (CJ78L05). From what I can tell, the PWM signal is output by the MCU, which drives an NPN transistor (package says J3Y) which is likely stepping up the voltage to the 10V PWM output to the fan. According to the datasheet, that PWM transistor dissipates a maximum of 0.3W.

Without seeing the schematic, I can't know exactly how these parts are wired up. But from visual inspection, I can infer a few things:
  1. The 10V DC power output from the fan must be susceptible to rippling/dips, which is why there are two electrolytic capacitors (a 47 uF one between the 10V input and the voltage regulator, and another 100 uF one after the output of the voltage regulator). If you plan on powering your MCU directly from the fan's 10V DC power, you might want to consider adding a couple of shunt capacitors like these.
  2. At least for these newer AC Infinity Fans with the USB-C interface (not the molex ones), the power MOSFETs are probably overkill, since the controller they provide is very low power. Low power transistors will probably suffice.
  3. I don't see any opto-isolators on the PCB of the Controller 62, which leads me to believe that opto-isolation may also be unnecessary--the manufacturer doesn't even do it for their own controllers.
I'm not sure if the older fan models with the molex connector is any different, so again take these inferences with a grain of salt. However, considering that AC Infinity sells molex<>USB-C adapters, I'm led to believe that the PWM power requirements would be the same for the new and old fans. Maybe someone can do a similar investigation with the older molex connector controller.

I'm going to buy some parts and see if I can make a drop-in replacement controller driven by an ESP32. The plan is to wire the PWM signal to a molex connector, and then plug that molex connector into the molex -> USB-C adapter that AC Infinity sells. I'll report back if/when I get it working.
I'll be interested in seeing what you come up with. If you use the 10VDC supplied by the fan that would eliminate my current need for a external power supply (Wall Wart) for the ESP. One less part. I ran the system that I designed for a couple months (7x24) with no problems. I like you are keeping everything outside the fan and controller so you to can just unplug your controller and use the one provided with the fan. Good Luck.
 

noiprox

New Member
I'll be interested in seeing what you come up with. If you use the 10VDC supplied by the fan that would eliminate my current need for a external power supply (Wall Wart) for the ESP. One less part. I ran the system that I designed for a couple months (7x24) with no problems. I like you are keeping everything outside the fan and controller so you to can just unplug your controller and use the one provided with the fan. Good Luck.
Can you explain how you added the 10k POT into the mix? Maybe just a simple wiring diagram to show all of the connections? I don't need the entire thing with LCD etc. just the ESP to MOSFET / POT and to the fan connector, I do understand how the MOSFET is connected to the fan from your previous posts so detail on that isn't needed.

Also are you able to control the fan from both the 10k POT and the software without any physical changes and how do they interact if used together (ex. POT overrides the software)? I'd love to add the POT into my final design to have manual control on top of the automation for when I open the grow tent so the automations don't go crazy.

Would you be able to provide the code from the software side? I'm assuming you are using HA with ESPHome so just a copy paste of the yaml file would be fine if you don't mind.

I have ordered some optoisolators to see if I can work them into the mix, link below. I may also try a step down or buck converter to use the 10v from the fan molex to power the ESP32, I'll post an update for you if I manage to figure it out.

 

noiprox

New Member
I'll be interested in seeing what you come up with. If you use the 10VDC supplied by the fan that would eliminate my current need for a external power supply (Wall Wart) for the ESP. One less part. I ran the system that I designed for a couple months (7x24) with no problems. I like you are keeping everything outside the fan and controller so you to can just unplug your controller and use the one provided with the fan. Good Luck.

I've ordered a pack of these to try for the 10v to ESP32 power, seems a safe way to do it directly through the USB port of the ESP32 at 5v and let the onboard regulator do it's job the rest of the way:

 

shimbob

Well-Known Member
I suspect trying to power the esp32 from the fan's 10V is going to overdraw current and make the fan unhappy.
 

noiprox

New Member
I suspect trying to power the esp32 from the fan's 10V is going to overdraw current and make the fan unhappy.
Very possible, will report back once I try it later this weekend if I have time. I'm using a low power ESP32 board and only one environment sensor on it plus the fan control so hopefully it doesn't draw any more than the original fan controller would have. I'm not great with electronics, more the computer and software side so the basics of electronics is all I've got hence why I have no clue how to integrate a POT into the system as AdaBill did above :(
 

AdaBill

Member
Can you explain how you added the 10k POT into the mix? Maybe just a simple wiring diagram to show all of the connections? I don't need the entire thing with LCD etc. just the ESP to MOSFET / POT and to the fan connector, I do understand how the MOSFET is connected to the fan from your previous posts so detail on that isn't needed.

Also are you able to control the fan from both the 10k POT and the software without any physical changes and how do they interact if used together (ex. POT overrides the software)? I'd love to add the POT into my final design to have manual control on top of the automation for when I open the grow tent so the automations don't go crazy.

Would you be able to provide the code from the software side? I'm assuming you are using HA with ESPHome so just a copy paste of the yaml file would be fine if you don't mind.

I have ordered some optoisolators to see if I can work them into the mix, link below. I may also try a step down or buck converter to use the 10v from the fan molex to power the ESP32, I'll post an update for you if I manage to figure it out.

I'm reading the valve of the 10K pot (Analog Read) and using that value to determine what PWM signal to send to the fan. I started out 0 to 100% but then realized that the PWM for the fan only ran thru a small portion of that range. I think I mapped it from 40 to100%. You can play with the numbers to see what range you want your fan to run within. I wasn't using any outside service, the controller was stand alone. I was just trying it out to see if it would make enough difference in my houses stratification for me to proceed. The basement was cold (where my office is and I waned to raise the temp without having to change the thermostat on the first floor ( where my wife spends most of her time (Happy Wife...). I was using an 8" unit tied into my cloths chute (older home) and was sucking the hot air from the 2nd floor into the colder basement, tempering the temperature. It worked to a degree but I think I would have upgraded to a 10" or12" unit to get more airflow at a reasonable noise level.

I didn't measure the current draw of the unit setup so I can't add anything to the overdraw question from the existing fan supply. I didn't make any attempts at efficiency for the prototype. I used a 9VDC 1 amp wall supply thru the USB cable. During testing I ran the unit via the USB into PC for debug printing so it ran with less than 500ma which I think in the max for my Windows PC.
 

noiprox

New Member
Very possible, will report back once I try it later this weekend if I have time. I'm using a low power ESP32 board and only one environment sensor on it plus the fan control so hopefully it doesn't draw any more than the original fan controller would have. I'm not great with electronics, more the computer and software side so the basics of electronics is all I've got hence why I have no clue how to integrate a POT into the system as AdaBill did above :(
I'm reading the valve of the 10K pot (Analog Read) and using that value to determine what PWM signal to send to the fan. I started out 0 to 100% but then realized that the PWM for the fan only ran thru a small portion of that range. I think I mapped it from 40 to100%. You can play with the numbers to see what range you want your fan to run within. I wasn't using any outside service, the controller was stand alone. I was just trying it out to see if it would make enough difference in my houses stratification for me to proceed. The basement was cold (where my office is and I waned to raise the temp without having to change the thermostat on the first floor ( where my wife spends most of her time (Happy Wife...). I was using an 8" unit tied into my cloths chute (older home) and was sucking the hot air from the 2nd floor into the colder basement, tempering the temperature. It worked to a degree but I think I would have upgraded to a 10" or12" unit to get more airflow at a reasonable noise level.

I didn't measure the current draw of the unit setup so I can't add anything to the overdraw question from the existing fan supply. I didn't make any attempts at efficiency for the prototype. I used a 9VDC 1 amp wall supply thru the USB cable. During testing I ran the unit via the USB into PC for debug printing so it ran with less than 500ma which I think in the max for my Windows PC.
Thanks for the extra info, so you used the pot via the controller not to independently control the fan or override the setting from the controller? I wasn't sure if it was possible, I was hoping to have the option to say set the POT to 50% and have it take priority in case the ESP failed since the fan goes to 100% without the controller in place. Or is some cases to manually adjust the fan when entering the tent and then to turn it back to automatic after.

My setup seems to be working as I planned with power for the ESP32 from the fan 10V off the molex connector, though I would appreciate comments from anyone who knows more about electronics to tell me if I am doing anything wrong or if I stand a chance of damaging anything or a fire hazard.

I used this buck converter:


And this MOSFET module:


Diagram below, it's my first fritzing and I couldn't find the right components but it's close. The output of the buck converter is USB A and connects to the ESP32 via a USB A to USB C cable. As in the previous posts above (thanks to everyone who contributed) I have used a molex connector from a PC to connect to the fan molex from the controller end. I connected the ground from the molex to the negative in of the buck converter and the +10v from the molex to the buck converter positive. The negative and PWM cables from the molex go to the MOSFET negative in and out respectively as in other posts above. For the signal and groung connections to control the MOSFET module I used pin 15 on my ESP board (DFRobot Firebeetle 2) as GPIO5 on my board was input only and the ground of the MOSFET to the ESP ground.

I do see that using 1k for the frequency and adjusting the fan it doesn't move until 30% so I will need to figure out how to remap that to 0% in the ESPHome YAML next but it's working for now between 30% and 100% for the slider.

Any comments/corrections or recommendations would be greatly appreciated, especially a way to use a 10k POT as an override or or how to remap the scale for the fan to 30-100 in ESPHome YAML.

Thanks again to all who have added to this thread, I wouldn't have known where to start without it!
 

Attachments

Hello, this is my first post. I'm havin trouble acheiving what @zeon has documented. Did the same wiring and triple checked it, The mosfet PCB LED does not turn on on both pcb i've bought thwe fan turns on full speed. I can see the integration in HA and play with the card, but nothing happen the fan just stays on 100%. I've just ordered 2 new pcb mosfet hope those 2 were DOA.
 
The 2 center pins of the connector are the ones used. A drawing of the connector and the molex is in above thread. Pins 2 and 3 of the Connector. On the dual mosfet the + connectors go straight through, they are not switched, always connected. The switching is done on the - connections. If you look at the bottom of the module you will see VIN- and VOUT-, this is where your connections are made. The Molex, chamfer UP (from the fan) from left to right 1, 2,3, 4. Pin#4 is +10VDC from the fan, not used in this connection, Pin#3 is ground-connect to VIN- on Mosfet, Pin#2 is PWM signal Ground signal to the fan, switched by the Mosfet., Pin#1 is not connected or used. ALSO, please note that Vin_ is directly connected to the ground side of the Mosfet module. In other words, the fan's ground is directly connected to your MCU's ground (ESP32). It hasn't caused any problems with my setup, using for a couple weeks now. If you don't like this cross connection use an Octo-coupler to separate the two supplies.

I have included a picture of the Molex connector(s). The Black one is from the fan, chamfer up. Pin #4 is power. It is FEMALE.
The White one is my add-on (MALE PINS). Pin #3 goes to VIN- on the mosfet module. Pin#2 goes to VOUT- on the module.
You can see that the chamfer is UP in the picture.
View attachment 5126977


I also show a closeup of the Mosfet Module.
The upper LEFT Screw Connection is for the VIN- Pin#3 (also connects to MCU Ground)
The upper RIGHT screw connector is for VOUT- Pin#2. when activated by the MCS it provides a PWM signal ground for the fan.


View attachment 5126979

Hopefully that answers your request.
So I've tried your method instead but it still doesn't work. Here's a diagram of how the esp32 is connected. The led of the MOSFET does not light up, so it could be a defect. Also the esp32 is plugged via usb so yes it gets power. Can't see how I would wire this all wrong. Am I missing something. I know the thread is aging but if somebody has any idea let me know.

schema.PNG
 

HVACker

New Member
@illegalmexican what does your code look like?

One way to test out if the MOSFET is defective would be to connect the signal/PWM pin of the MOSFET module to the 3.3V pin on the ESP32 board (i.e., pull that pin HIGH). If the LED turns on, that means your code is not controlling that pin (looks like GPIO5 from your fritzing diagram).

By the way, GPIO 5 is probably not the best pin to use on the ESP32 for your fan PWM signal. It's used by the ESP32 during boot up and might output a signal that messes with your fan every time you turn it on. I would consider using GPIO 16 or 17 instead (and make sure you update your code accordingly).

If that all looks good, are you sure there's a common ground? That is, are the ESP32 ground and the "ground" side of the fan PWM connected (the black wire from the ESP32 and the red wire between the MOSFET and the molex connector)?
 
@HVACker
Here's the yaml code for esphome. The entity is picked up by HA as it should, i'm able to add the entity to my dashboard and view the slider with the On/Off toggle. I'll try your recommendations tomorrow night as i'm away from my home. As for the connections i'll double check tomorrow, i've tried both of the suggestion in the thread (including with the optocoupler).

YAML:
esphome:
  name: ac-infinity

esp32:
  board: nodemcu-32s

logger:

api:

ota:
  password: !secret ota_password

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "Grow-Tent-Fan-Temp"
    password: !secret wifi_backup_password

captive_portal:

output:
  - platform: ledc
    pin: GPIO5
    id: intake_fan_op
    inverted: true
    frequency: 1000
    
fan:
  - platform: speed
    output: intake_fan_op
    name: "Tent intake fan"
    speed_count: 10
    id: intake_fan
 
@HVACker So instead of pulling the pin HIGH, I hooked up a 3.3v source (using a buck down converter) and connecting the board through the 3.v3 does make the LED light up on both of my MOSFET boards. I've also tried GPIO17 and GPIO16 (on 2 different ESP32)

So if I had to guess it would be the wiring. I tried multiple wiring combination again and nothing works and the LED on the MOSFET still does not light up. So in the attached file. MOLEX PIN 3 goes to VIN- on the MOSFET module. Pin#2 goes to VOUT- on the module. I also tried to switch them. It does prevent the fan to spin but i assume it's because the MOSFET pcb is not receiving therefore the fan does not spin. Could you show me youre wiring ?

So if i had to guess the following would be true:

MOSFET -> WORKS
ESP32 -> WORKS
YAML -> WORKS
WIRING -> Probably Wrong


MOLEX Pin 3 (BLACK) goes to VIN- on the MOSFET module.
MOLEX Pin 2 (RED) goes to VOUT- on the MOSFET module.
BLUE wire goes to GND on the ESP32.
YELLOW wire goes to GPIO16 on the ESP32.

Am I missing something?
 

Attachments

zen0n

Member
I'm just re-implementing my setup using native mqtt instead of esphome and came here for a reference on how I did this originally. Glad some others have found it usefull.

Currently working on getting my esp32 working to control 2 fans, 2 lights, 1x dht22 and 8x ds18b20 temp probes using mqtt and node red.
 

HVACker

New Member
@illegalmexican sorry for the radio silence! Were you able to get it working?

The fan that we were using was the Cloudline Lite A6, which has a non-removable USB-C cable that is supposed to plug into an accompanying controller. We ended up getting the wrong adapter (the molex to male USB-C), so decided to get a female-to-female USB-C adapter to connect it all up.

I did this project for a friend, and don't have the actual circuit in front of me anymore. Here's a diagram of what I initially wired up--which turned out to be wrong. I don't have time to modify the photo right now, so I'll just explain what changes I made. Note that I have a component in here that taps into the 10VDC power, so the ESP32 is powered directly from the fan.

IMG_3760.jpg

When we first wired it up, it didn't work. Turns out we had the pin order reversed at the MOLEX connector. I'm not sure if the numbers I wrote on the diagram were incorrect, or if I had something else flipped...but the point is that when I reversed the order of the pins (swap 1<->4 and 2<->3), it started working.

To clarify, have you tried swapping your MOLEX pin 2 and 3 connections? So, MOSFET VIN- to MOLEX Pin 2, and MOSFET VOUT- to MOLEX Pin 3? It sounds like that what you said but I wanted to confirm.

If you change the wiring and the fan stops spinning, I believe that means that the MOSFET is either being driven HIGH constantly, or is being driven HIGH at a duty cycle that is sufficiently high that the fan stops spinning (note -- the fan speed control is inverted, so higher duty cycle = slower speed). Have you tried wiring up the fan in the configuration where it stops spinning, and then adjusted the speed in HA?

Based on your YAML, it also looks like you're controlling GPIO5 as the PWM signal, but you mentioned that the MOSFET is wired up to GPIO16. Are you sure you're programming the correct GPIO pin to be used for the PWM signal (ledc)?
 

waring192

Active Member
Hey guys, finally got my esp32 properly controlling my 6" AC Infinity Cloudline EC motor fans and figured I would lay it all out for you. As the title suggests I'm an idiot and just getting back into electronics, so be kind if i'm off on terminology haha. Most of the hard lifting for this stuff was not done by myself. Big thanks to the posters in the following threads that put me on the right track. Just had to have a few bowls to make it all come together :)

Particular thanks to @Kervork and @juanmaria of whose images I will most graciously borrow for this post.


For starters, this guide is for the EC motor cloudline fans, you can quickly determine which one you have by opening the panel and looking at the wires, if you have a 7 wire connections, you're good. 4 and you have the other DC motor. Other guides cover this I'm sure. Not 100% sure if this method will work or not. YMMV

We will be using ESPhome on the esp32 with home assistant controlling the fan. Won't be covering automation at this time because that part is next on the figure this shit out list. Assuming you have esphome addon configured and working in HA.

Parts required.
esp32
MOSFET Trigger Switch Driver Module x how ever many fans
pc817 optocoupler x how ever many fans *
100ohm resister x how ever many fans *
4 pin male molex connector x how ever many fans **
breadboard
various jumpers

* not 100% sure whether an optocoupler is required for the pwm circuit coming from the cloudline motor. I've wired it up both ways and it works both ways.
** I just molested some old PCs I had kicking around for their 4 pin molex power connectors. That's what you're looking for. The old kind of power connector.

Wiring up the fan

Here is a pic of the stock wiring diagram
View attachment 4903926

Backside of the mosfet for pin reference
View attachment 4903930

And here is my slightly modified version of Kervorks original design. For our application, disregard the fact that it's going to a pi and whatever pins. Just know that the only wires you care about are the yellow (pwm) and black (gnd). We'll get back to those on the other esp side.

View attachment 4903933

And here is a pic of it all wired up.
View attachment 4903938


Inside the panel, with it oriented like above, disconnect red, yellow and black wires on the right hand side. The 3 bottom right wires in this pic. Run the red wire to VOUT+ on the mosfet, run the yellow wire to VOUT- on the mosfet. I made a jumper from the ground wire on the terminal block, connected it and the black wire to gnd pin on the mosfet. Only had white hookup wire, but you can see the ground pin on the mosfet has 2 wires coming out of it. Make sure you're jumpers are long enough so the mosfet will tuck into the corner nicely. I dabbed some hot glue on the live points on the backside of the mosfet pcb.

Leave the fan aside for bench testing or roll the dice and seal er up! :P

Wiring up the esp32

Depending on if you want to run an optocoupler or not, the esp side is pretty dead simple. You just need to make sure you're working with the correct wires on the control connector coming from the cloudline.

Here is a shot of the 2 wires you will be using from the cloudline, from the female side we will be providing from a pc or whatever you have.
View attachment 4903961

The yellow wire is the pwm signal from the fan, and black is the ground. Note the notches in the connector for pin orientation. Looking at the pic now, the connector housing is female, but the pins are male. So I may have misgendered this connector. I'll monitor twitter for someone educate me on gender, I'm sure it will trend hahaha Anyhow, knocking these pins out and moving the wires around is easy enough with a precision screwdriver if you're color anal.

And I managed to bang out a fritzing diagram for the esp side, don't judge, first one :P In the diagram I've included both a circuit with the optocoupler (yellow wire coming from esp) or just straight wired to the gpio (green wire). Of note the resister in the opto circuit is 100ohm. The dpi settings on my desktop frigged up the pin labels in the image, but red is the 3.3v rail, blacks are grounds and yellow is GPIO4 and green is GPIO5 (but use whatever pwm applicable pins you want, use esp32 pinout ref to find out what will work for you.


View attachment 4903963

And that should wrap it up hardware wise.

ESPHome and Home Assistant
* Again, assuming you know you to add esphome add on, and create a new blank esp32 device. I find it convienent to build the empty config and upload right away just to enable OTA updates going forward.

On the esp32 we will be using the ledc output to control the pwm duty cycle. That it's called ledc might seem a little off, but just know it's essentially a library for controlling pwm signals.


Edit your esp32 device to bring up the yaml editor, and paste the following

of note: make sure inverted reads true, or as it sounds 100% will be off, and 0 will be full speed. Make sure id is unique. frequency of 1000 seemed to work well enough for me.

speed_count will give you X amount of steps between 0 and 100, 10 seems to match up pretty well with what AC infinity was using before. Make sure output in the fan section matches the id from the output section. name is the display name you'll see in HA, id is it's internal name essentially.

change the pin to whatever you're using.

YAML:
output:
  - platform: ledc
    pin: GPIO5
    id: intake_fan_op
    inverted: true
    frequency: 1000
   
fan:
  - platform: speed
    output: intake_fan_op
    name: "Tent intake fan"
    speed_count: 10
    id: intake_fan
validate then upload to your esp.

Now head into Configuration->Integrations in Home Assistant. You should see your esphome device listed as a newly discovered device. Follow the configure prompts for that device. When your're done you should have the name of your esp device listed in the ESPHome integrations box. When you click on it, it should have 1 device and 1 entity.

Now head back into overview, depending on how you have your areas setup the control may be in that area. I haven't done much ui massaging yet and just use the default overview with everything. I added my esp device to my tent area so it shows up in there for me

View attachment 4903980

Clicking on the fan name takes you to the speed control screen, you can't tell by the screenshot, but the slider on the bottom does in fact increment in 10s, so 0,10,20...80,90,100. And the software toggle will turn on and off the fan.

View attachment 4903981

I _think_ thats it? I've been typing a long time now and the boss just got home from work so I have to go put some time in. Let me know what you guys think I may have fucked up haha. And again thanks to all the original posters for their skills.
Sorry to bump up an old thread @shimbob but I have all the circuits done but was wondering how the molex plugs into anything? Could I not just wire the yellow and black into the AC Infinity compartment or hide an ES8266 in the box with the MOSFET?
 

shimbob

Well-Known Member
You can do whatever you want, as long as you don't make sparks and set fire to your house.
The cord with the molex can be taken out and tossed into your box of spare parts.
 

waring192

Active Member
You can do whatever you want, as long as you don't make sparks and set fire to your house.
The cord with the molex can be taken out and tossed into your box of spare parts.
Ha I don't plan on that but I do an autofire extinguisher and cutoff.

That sounds perfect, will just have a 5v USB with the main power going to it. Thinking of making a 3D printed top so I can pop a rotary end
coder in also.
 
Top