Problem with AC motor

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

JST

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

PCB

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

It was not using PWM. It’s basic voltage regulation by ac phase control. That’s all you can do with the circuit you describe.

Since the triac was connected directly the processor, that connection was the source of the zero crossing detector. Atmel published an app note on how to do this.

You would be well advised not to attempt to recreate this capability, I provided the link only to show that it can be done.

It is evident you recognize the dangers of high voltage but I think you’re outside your knowledge/comfort zone and you need to understand how easy it is to blow stuff up (or worse) mucking about with directly connected mains. Keep everything optically isolated, triac and zero crossing circuit included and error the side of safety - post your schematic and pc board for review and comment by those that have the necessary experience with mains voltage.

Thanks,

I only have one concern with your answer. In the pdf that you linked, it's shown that the uC needs a input, sort of "sensing" pin to detect the zero crossing. But as I said, the original uC only has one pin dedicated to the fan. Wouldn't it need another pin to switch the triac on?

In the worst case scenario, could I just simply turn the triac (optically isolated) with my uC on and off in what'd be a poor man's PWM, as in 1 second on/1 second off, and not by varying the frequency.

Thanks,
Alex

Since you can no longer test the behavior of the old board, what’s the point? Could some form of PWM work? If the fan mass and torque requirements are low enough, maybe. Have I ever seen it done? No.

Either use the most logical approach to control the speed of the motor, which is phase angle controlled variable voltage or experiment with whatever you think might work. We know the first method works, if you’ve convinced it’s PWM, try it out and let us know.

Just out of curiosity, what happens if you just put a power diode in series with the motor?

avr_fred:
Since the triac was connected directly the processor, that connection was the source of the zero crossing detector. Atmel published an app note on how to do this.

I doubt it. OP doesn't mention AC ground (a requirement for this zero crossing detection to work as described in the AN), or any direct connection of an AC wire to the MCU. Just the MCU to triac.

As this is a heater, it switches on/off every few seconds at the most. The developers probably didn't bother with AC phase detection, instead just control the TRIAC gate. Much easier. It'll switch off upon zero crossing by itself, just the on switching is not that nice, but happens rarely enough to not cause much noise, probably still less than a physical switch (like a bimetal based thermostat).

OP: Why do you connect the GND of the heater at all? It doesn't seem to have any function here, as the outputs are just connected to the Vcc or left open. The connection of the GND pin of that 6-pin connector breaks the electrical isolation offered by the optocouplers.

If size is not a major concern I can suggest a potential solution.

It seems the original circuit was connected to the mains. We all seem to believe this type of circuit connected to the mains is not safe in a DIY environment.
To do phase control of the TRIAC one needs a zero crossover detector.

Perhaps a small transformer between the mains and the Arduino. It could provide both power and a Zero xover reference. The Triac would have to be triggered by an opto isolator. Here I don't know if there is power in the remaining circuitry for the opto to switch.