English
Español
yt_link
insta_link
fb_link
twitter_link
ADVERTISERS
ANENG
cooleme TV
PCBWay Ad







AFFILATE




Anet A8





Gearbest Anycubic I3 MEGA Full Metal Frame FDM 3D Printer
Anycubic I3 MEGA Full Metal Frame FDM 3D Printer only $379.99 with coupon "Anycubici3ch"
Gearbest Anet A8 Desktop 3D Printer
Anet A8 Desktop 3D Printer only $145.99 with coupon "A8KIDA"


Gearbest Tronxy X3S Aluminum Frame LCD Screen  3D Printer DIY Kit
Tronxy X3S Aluminum Frame LCD Screen 3D Printer DIY Kit only $259.99 with coupon "GBX3S"


Gearbest Min DS202 Oscilloscope 113€
Min DS202 Oscilloscope 113€


Gearbest UTD2052CL DIGITAL 2-ch Oscilloscope 275€
UTD2052CL DIGITAL 2-ch Oscilloscope 275€


Gearbest UT139C True RMS Digital Multimeter 29€
UT139C True RMS Digital Multimeter 29€


Gearbest SBK8586 Soldering station Hot Air + Iron 63€
SBK8586 Soldering station Hot Air + Iron 63€


Gearbest BAYANGTOYS X21 Brushless RC Quadcopter
BAYANGTOYS X21 Brushless RC Quadcopter 153€


BlueTooth controlled TRIAC dimmer



PART 3 The code

I mount everything on a breadboard. Remember, in order to control power, all we have to do is to control the time between the zero cross and when we fire the pulse at the TRIAC gate. For that, in the Arduino code, I read the value of a potentiometer and map that value to a delay between 1 and 10 milliseconds.


Full code here (potentiometer input):




valor = map(analogRead(A0),0,1024,10000,10);
    if (detectado)
    {
      delayMicroseconds(valor); //This delay controls the power
      digitalWrite(3,HIGH);
      delayMicroseconds(100);
      digitalWrite(3,LOW);
      detectado=0;
    }


Why these values? Well, I know that my AC signal has a 50Hz frequency. So, the period will be in this case 20 milliseconds, so half period will be 10 milliseconds. So, just by that, using the potentiometer I can change the firing angle of my AC signal and by that I can control the time that the power is applied to this light bulb.



AC TRIAC Arduino




See the full part list here:








PART 4 Bluetooth control

Use the schematic below. It is the same, just instead of a potentiometer add the HC06 bluetooth module. Remember, don't connect the module while uploading the code.


AC TRIAC Arduino bluetooth



With the scheamtic above, all I’ve done now, instead of using the potentiometer to change the delay, I’ll use my smartphone. I connect a Bluetooth module to the RX and TX pins of the Arduino as in this final schematic, upload the new code that you’ll find below, install this App that I’ve created in app inventor on to your smartphone. I connect to the Bluetooth module and now, I can dim the light bulb with my smartphone.



Full code here (bluetooth input):




Bluetooth Android App

AC TRIAC Arduino bluetooth

Download App:




Have in mind that not all devices will like this kind of power control, since there are fractions of time that no power is applied to the device. Use this kind of AC power control with motors, dimmer switches for incandescent light bulbs or as a soft starter.

So, there you go my friends. Now you know how to use TRIACs and fire pulses to control the amount of power. Use optocouplers and separate high voltage from low voltages.


You have all the schematics, the app and the example codes above so make sure you check those out. If my videos help you and you would like to help my projects, I have a Patreon campaign. The link is down below as always. I would really appreciate that guys. BTW, thanks to all my Patreons.