Hi,
A couple of years ago I bought an oscillating heater fan from Lidl which has been working great until now. The only problem that it had was that every time that I decided to turn it on, it only heated the room to the 21º Celcius that it had programmed by default. I had it under a table, so each time, I had to bend over, crawl under the desk, and press the "Up" button 9 times in a row to set it to a comfortable 30º. That bugged me, so I decided to tamper with the PCB to add a microcontroller that, via an optocoupler, "pressed" the button for me when every time I turned it on.
While tampering with it I shorted Vcc to GND and broke the microcontroller IC that it came with, and since it had its name erased, I could not figure out the model, so I had to toss the board away.
I finally decided to ditch the old electronics and make my own. Luckily for me, the heater unit came with 2 PCBs. One is responsible for the power conversion, and it has the relays, triacs, and whatnot, and the other one -the one I broke-, just has the microcontroller, a couple of buttons, and an LCD display. They were attached via a JST 6 pin cable, so, after further investigation, I concluded that those 6 wires, in order, were:
VCC
GND
Fan
Rotating Base
Heater element 1
Heater element 2
The original board was pretty straightforward to understand. A first approach showed that the microcontroller just shorted the mentioned pins to VCC to turn them on. Temperature control was done by just turning off the heaters when the desired temperature was reached and then back on when it started cooling down.
So, I quickly put together a prototype on a perfboard, just an Arduino, 4 resistors, and 4 optocouplers, and since it worked just fine, I moved to an ESP8266 to avoid crawling under the desk. (I linked to my home automation server.)
That's the PCB I ordered. It works great in theory, but as it turns out, it has a minor problem. All functions work fine, except for the fan. It spins, but way too fast. When it had the original board you could barely hear it and now it's a jet engine. So that got me thinking if maybe, the original board controlled the motor via PWM, so I checked the "Power Board" and found that the motor was controlled by a triac, the BT131-600, which was directly connected to the microcontroller in the original board. I thought that that was kind of dangerous, even though the datasheet specified that the triac was designed for that purpose and so I could be directly connected to a uC. The motor is one of those cheap shaded pole motors, the yj58-12.
Now to the fun part, there's no zero crossing detector or anything, just a direct connection between the PCB and the triac. (I added an optocoupler, the PC817, in order to isolate both circuits). I should also mention that GND is connected directly to the AC neutral wire.
Do you guys know if it's possible to control the motor via PWM with this setup? The old board did something to slow the motor down, but it seems kind of dangerous to do it as it "was" done (as in no zero crossing detector, no optocoupler isolation, etc...). The board that I have now is the one I linked earlier.
Thanks in advance,
Alex