Cloudline AI-CLS6 (S6) PWM control with RPI

shimbob

Well-Known Member
I'm on the Mycodo train as well. Got a tasmota'd Sonoff 4CH pro that controls the far red and the main lights contactor, optoisolaters to PMW control 2 fans and the led driver, an esp8266 that broadcasts canopy temp&humidity and soil moisture over Mqtt, some other tasmota'd power gizmos, and hopefully soon a portable AC unit with its control board replaced by an esp32 that I'll control over mqtt. So flexible!
 

Lite Brite

Active Member
@shimbob Nice, tasmota made my configuration sooo soooo much easier to implement. Mycodo is a great piece of software. The maker is super diligent about updates and killing bugs. He implemented VPD option for us within 10 hrs of us mentioning it!
Good guy. I ended up going node red because at the time Mycodo wasn't flexible enough for my needs. It may have changed since but once I found node red and a way to implement stock sonoffs as well as tasmotized sonoffs I was hooked!

@craggin Glad to hear I'm not a hijacker
Yeah tasmota is definitely worth looking into. The amazing flexibility, customizability, and number of devices it can run on (basically anything w/ a esp chip) makes it a must have for me.
Fan hack update. A PC817 works just fine. Have it on the bench w/ a tasmotized sonoff basic r2.
I attached the 817 to the - and + of the blue element of the status led in the sonoff and the output to the - of the fan - and the + to the pwm input for the fan (see pics), am also hijacking 110V from the fan to power the sonoff (white n black wires).
Only configured GPIO13(the blue led) for pwm.

Been creeping along at 3% speed for about 2 hrs now and doin fine.
The only issue I see is that 50% on the slider is 3% but 100% is full speed.
Not really a big deal since I have the full speed range and plenty of step points between to ramp up and down the fan speed.
I'm sure there's settings to change the hz of the pwm signal (which I is 4K) or the slider range so am sure it could be fixed.
As a plus if you toggle it off in tasmota the fan 100% stops so I didn't even need to use the sonoffs inbuilt relay to control the 110v.

EDIT:Turns out if you use "LedTable 0" under console it will turn off LED gamma correct which gives you 3% speed at 20% slider position.
So about 80% slider use for ramp up/down. At this point it looks like it may be more a fan range limitation, like the sonoffs pwm range is wider than the fans "running" range.
 

Attachments

Last edited:

craggin

Active Member
@shimbob Nice, tasmota made my configuration sooo soooo much easier to implement. Mycodo is a great piece of software. The maker is super diligent about updates and killing bugs. He implemented VPD option for us within 10 hrs of us mentioning it!
Good guy. I ended up going node red because at the time Mycodo wasn't flexible enough for my needs. It may have changed since but once I found node red and a way to implement stock sonoffs as well as tasmotized sonoffs I was hooked!

@craggin Glad to hear I'm not a hijacker
Yeah tasmota is definitely worth looking into. The amazing flexibility, customizability, and number of devices it can run on (basically anything w/ a esp chip) makes it a must have for me.
Fan hack update. A PC817 works just fine. Have it on the bench w/ a tasmotized sonoff basic r2.
I attached the 817 to the - and + of the blue element of the status led in the sonoff and the output to the - of the fan - and the + to the pwm input for the fan (see pics), am also hijacking 110V from the fan to power the sonoff (white n black wires).
Only configured GPIO13(the blue led) for pwm.

Been creeping along at 3% speed for about 2 hrs now and doin fine.
The only issue I see is that 50% on the slider is 3% but 100% is full speed.
Not really a big deal since I have the full speed range and plenty of step points between to ramp up and down the fan speed.
I'm sure there's settings to change the hz of the pwm signal (which I is 4K) or the slider range so am sure it could be fixed.
As a plus if you toggle it off in tasmota the fan 100% stops so I didn't even need to use the sonoffs inbuilt relay to control the 110v.

EDIT:Turns out if you use "LedTable 0" under console it will turn off LED gamma correct which gives you 3% speed at 20% slider position.
So about 80% slider use for ramp up/down. At this point it looks like it may be more a fan range limitation, like the sonoffs pwm range is wider than the fans "running" range.
What is that circuit board that looks hacked? The 817?
 

Lite Brite

Active Member
What is that circuit board that looks hacked? The 817?
That's the back side of a sonoff basic r2. Wanted people to see what LED legs I soldered the PC817 to.
It's a positive common 2 element LED. The grounds are switched to turn on each color.
In the case of the Basic R2 the red LED element is switched only with the relay circuit which is why I
used the blue element which is the "status" led and can be switched(or PWMed) independently of the relay.


The chip you see dead bug soldered in the middle of the wires there is the sharp PC817 optocoupler chip.

The 50mA rating I mentioned earlier for the 817 is at 80V. Since we're talking 10V that'd be 400mA. Which should be just fine.
Pretty dead simple layout. And still merrily whirring away on my bench.
 
Last edited:

Lite Brite

Active Member
EDIT:Turns out if you use "LedTable 0" under console it will turn off LED gamma correct which gives you 3% speed at 20% slider position.
So about 80% slider use for ramp up/down. At this point it looks like it may be more a fan range limitation, like the sonoffs pwm range is wider than the fans "running" range.
Ok so turns out it's more like 25% before the fan starts but will go down to 20% and still run.
On the same topic "DimmerRange" command in console will adjust the min - max of the slider, playing around I have found "DimmerRange 30,255" to be pretty optimum The first notch on the slider gives 3% and the top notch is 100% full.
 
Wow nice craggin and Brite thank you for info lol I got a bag full of pc817 I have been reading up on node red integration into ha. I got everything working I ran the sensors threw pi so far until I do the tasmota adruino firmware and add it I'm just gonna run esp 32 for extra sensors. I can't wait to try what craggin and Brite just showed me I just got 3 more ac infinty cloudline t8s I'm about to sell all my 4s and 6s I got way too much grow stuff my kids getting into it my girl bitching I guess 15k in one year on grow equipment is a bit much half I don't use now I got any pwm,mosfet, transistor. Just need a 5 day vacation away from all my kids. And I can figure it out tried video chatting with craggin and my kids screaming freaking out. My 3vyears old didn't help distracted me I hooked 12v1 to one of my new pi 4s. Thank god I can use gpio still but only 3.3v some 5v but yeah. Thank you guys. I'm tinkering today .
 

Lite Brite

Active Member
Figured I'd add this here since I outlined my Cloudline tasmota hack here.
So what ya gonna do with that orphan temp/humidity sensor that came with your fan controller now that you converted your fan?

Well turns out that the sensor is a SHT3x made by Sensirion, it's a I2C interface. The pinout is as follows:
Base = GND
Ring3 = SCL
Ring2 = SDA
Tip = VCC (3.3-5V)

Arduino has a SHT3X library that works with this sensor and Tasmota supports it as well but not the stock firmware image
you have to use the "sensors" Tasmota firmware image.

For those who dread cutting the TRRS 4 pole headphone jack off to wire the sensor to something:

Wire colors on this are red n black are power and ground, white is SCL, Green is SDA.
Running fine with tasmota-sensors.bin firmware on a nodemcu V3.
 

Attachments

craggin

Active Member
Well turns out that the sensor is a SHT3x made by Sensirion, it's a I2C interface.
I'm humbled by your ninja skills, my good sir. I tried to accomplish this same thing, but was unable to determine the sensor type and/or mfgr. I even called AC Infinity and inquired about getting a datasheet for it, they said "sure!", but then never actually provide one. I ended up going with one of these:
 

Lite Brite

Active Member
Thanks, actually it was just luck though.
I went down the same rabbit hole as you and emailed AC Infinity as well and got the same BS story but never got a datasheet so I decided to take a magnified look at the hole in the sensor. Lo and behold I could make out most of the model # of the sensor!
The rest was just probing the controller to figure out what pins the power and ground were on.

BME280's are really good sensors, I have several in use for a while now. Mine are the cheap ones on small purple daughterbords
but they work great.
 

Attachments

Last edited:

Lite Brite

Active Member
Figured what the hell as the most I was expecting to see was the humidity membrane (which could possibly yeild some clues to the manufacturer) was pleasantly surprised to see an actual partial part number.
Btw tasmota has a PID controller baked right into their current firmware as of v9.3. Not using it as of yet as I found a rule setup in the "rule cookbook" that mimics a thermostat. Seems to work well like this so haven't bothered looking into the PID setup yet.
 

SnakeMM

New Member
Hi. I need help with proper wiring. Could someone draw a proper connection between esp32, mosfet module((sw-m221) and AC Infinity S series? also yaml config would be great.
 
@wieczorekfloorz
Kinda surprises that everyone is using big mosfets for pwm signaling, being real cheap price I guess no harm in overkill but I've poked around inside two of the three controllers AC uses and both use a pretty small and unmarked transistor for pwm signal driving. My guess is it's a 2n2222 or something similar, you could probably get away with a PC817 optocoupler directly. I use PC817's directly all the time to drive PWM dimming for meanwell drivers. Works beautifully. I have yet to find the time to test with a Cloudline fan but will soon.
Hey Lite Brite,
I've been working on a project using esphome to control a drying curing chamber based on the tech in a cannatrol. Its really pretty advanced with PID loops for almost everything as well as predictive control. What I am having issues with, is driving the Mean Well driver with the optocoupler.
Found this thread while looking to control my ac infinity fans, light and cloudforge humidifier with my esphome setup. Anyway, what do you do to control the mean well drivers? Heres my setup but its not really working the way I expected.

1694383800343.png

Would be happy to share my code on github if anyone is interested in customizing it to their needs.

1694383920505.png
 
Top