I have several days with problems when assembling the circuit of the image (it is a light bulb that turns on when you clap). To briefly describe the operation of the circuit, when the potentiometer is completely to the left, the led and the bulb remain on. When lowering the potentiometer until the LED and the bulb turn off, when clapping, the pulse is received and the led blinks, on the other hand, the bulb should remain on.

As for the DC part (the LED) blinks when I clap, so that's fine on that side. The problem is that, (before reducing the potentiometer) when I turn on the circuit (5V and 220V) the bulb does not stay on like the led, but it turns on in a fraction of time (it blinks or tries to turn on). Below is a video of what exactly happens anyway.

Vídeo: here NOTE: In the video you will see that the light bulb blinks, turns off and then comes back and blinks. The reason is because I disconnected the 120V source, when I go back and connect it the light bulb comes back and blinks. So basically I plugged it in twice just for you guys to see that the DC part works normal, however the AC doesn't.

  • I have searched a lot and in many cases they recommend changing the resistance of the TRIAC-BT136 gate, which I have already done by changing the 100 ohms by 180 ohms (calculated using the TRIAC datasheet) and with a 330 ohms. This has not worked for me.

  • I have tested all the components and they are in good condition, I also bought another CD4017 because the previous one was somewhat loose, however it did not mean anything.

I have come to think that maybe the problem occurs with the MOC3021 but I do not understand, because in the end it triggers. Should I make a few changes to the MOC's 1k resistor?


  • I tried with an incandescent bulb and the problem remains the same as with the led bulb.
  • I changed the 1k resistor from the moc3021 to 220 ohms (didn't work), then 270 ohms (didn't work, either).


The problem was neither the resistance of the moc, nor the micro, nor the type of CD4017 used. The circuit was well synchronized (AC and DC). The final problem was the use of jumpers. There were lines in which although they were conducting, due to any movement they were no longer conducting - I don't know if you understand me - the point is that the use of the jumpers did not produce effective connectivity in the circuit so I used utp cable and the circuit worked perfectly (Although the micro I had was a bit loose, I simply replaced it with another one and it already adjusted perfectly to the circuit).

Thank you very much anyway for the different ideas you gave me, I used them all and thanks to that I came to the solution which was quite simple haha.

If anyone has any ideas which they can contribute, it is really appreciated.

circuit template

  • 2
    \$\begingroup\$ Try an old fashioned incandescent bulb. Looks like you have an LED bulb, and some don’t work with triacs. \$\endgroup\$ Nov 20, 2020 at 5:35
  • \$\begingroup\$ I'll try it, thanks. \$\endgroup\$
    – aticboy
    Nov 20, 2020 at 13:47
  • 2
    \$\begingroup\$ Really nice drawing! It's a pity that this is an almost lost art. \$\endgroup\$
    – mguima
    Nov 24, 2020 at 19:37
  • 1
    \$\begingroup\$ Instead of microphone wire jumper? \$\endgroup\$
    – user263983
    Nov 27, 2020 at 20:06
  • 1
    \$\begingroup\$ @user263983, yes! that was the issue haha, thank you so much I finally solved! \$\endgroup\$
    – aticboy
    Dec 3, 2020 at 2:31

1 Answer 1


$$R_{in}=\dfrac{V-V_f}{I_f} = \dfrac{5V-1.2V}{15mA} \approx 250 \Omega$$

Definitely your 1k resistor is to be replaced. You could also have problems with load type switching. The LED bulb isn't just a LED, rather it has an internal power supply circuit. It would be more appropriate to use a circuit for inductive load:

enter image description here

  • \$\begingroup\$ Thanks for your contribution. I did the calculations too and checking the datasheet my Vf is 1.5V, no problem using either of the two? In my case it gave me a resistance of 230 ohms. On the other hand, I have a resistance of 330 ohms, would it be functional for the test? \$\endgroup\$
    – aticboy
    Nov 20, 2020 at 14:14
  • \$\begingroup\$ In my datasheet is 1.15V at If=10mA, the minimal If current is 8mA. 330 ohm should be good enough for test, but I have a further suspiction that CD4017 isn't capable of driving such current. \$\endgroup\$ Nov 20, 2020 at 14:41
  • \$\begingroup\$ Didn't work with 330 ohms, I'll try to get the resistor of 250 ohm (or similar) and an incandescent bulb too. \$\endgroup\$
    – aticboy
    Nov 20, 2020 at 18:10
  • \$\begingroup\$ Connect directly to the 5V without CD4017. By the way, how much current can CD4017 handle? \$\endgroup\$ Nov 22, 2020 at 7:19
  • \$\begingroup\$ It can handle 20mA max. Btw, you say connect the resistor directly to 5v and not to the second pin of the CD4017? \$\endgroup\$
    – aticboy
    Nov 24, 2020 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.