I am working on an IoT project to control the speed of my ceiling fan through my mobile.
The problem is that the TRIAC and the fan speed circuit just won't work when it is on a PCB. I know it sounds weird but I don't know what's going on. First I prototyped the whole circuit on a breadboard. It worked and I began to work on a PCB. It worked for a day and then all of a sudden stopped working, though I did notice the TRIAC getting quite hot as soon as I powered it up driving an inductive load for test (a piston pump used in soldering iron stations.)
Then I took the whole circuitry out, reconfigured it, and found that I was missing a snubber circuit which miraculously made my circuit work again and I could dim the speed once again. I still don't understand this, because conventional cheap dimmers work without any.
Long story short, it worked for some time just like the previous time and now it is just stuck again. It won't work as I intended it to. I don't have an oscilloscope to see what is really going on down there.
Previously when the circuit went bad without the snubber, the TRIAC got extremely hot and the pump worked on full voltage, but now the TRIAC gets a little warm and it's as if you are powering the pump with 20 VAC. The circuit diagram is given below.
