Interfacing PIC microcontroller to a TRIAC for AC load control

Discussion in 'Embedded Systems and Microcontrollers' started by jean120, Jul 29, 2016.

  1. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    I am using PIC16F1936 and want to control the speed of an AC single phase motor using the switch interfaced to a PIC via PORTA.
    I have implemented a circuit for controlling the speed of an AC Single phase motor using the switch interfaced to a micro-controller where each of the four switch allows the PIC to create a delay which is referred to as a firing angle.
    Here below is the circuit with the code I tested and found that they are ok as with simulation in proteus it is giving correct firing angles.Unfortunately physical implementation is not working at all.
     
  2. crutschow

    Expert

    Mar 14, 2008
    12,981
    3,221
    "Below" does not show up.
     
  3. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    sorry,attaching an image has been a problem for me;
     
  4. bertus

    Administrator

    Apr 5, 2008
    15,644
    2,344
  5. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,674
    899
    Also, seeing the phase angle change is simulation may bot be a good representation of how your particular motor will respond.
    1) What type of single phase motor is it?
    2) Will a manual triac speed control, e.g., a light dimmer, work as you want?
    3) Does "not working at all" mean the motor won't run regardless of the triac setting?

    John
     
  6. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    http://www.microchip.com/forums/m941365.aspx Yes the motor doesn`t work regardless of motor type.The motor I am using is the one of a fan requiring 230VAC at 50Hz and 1A.
    it turn at a very low speed which can`t be adjusted even if the delay time fo the TRIAC is changed.
    When a bulb is connected it flick,it turns on-off and so on it is not keeping stable with light variation.

    see the circuit here
     
  7. bertus

    Administrator

    Apr 5, 2008
    15,644
    2,344
    Hello,

    I still do not see any picture.
    Are you using a zero crossing circuit for synchronisation with the AC?

    Bertus
     
  8. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,771
    1,103
    How have you synchronised the triac driving with the mains zero-crossings?

    Edit: Bertus beat me to it!
     
  9. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,674
    899
    You haven't quite addressed my question(s).

    1) Can the motor you are trying control be controlled with a triac? That is a simple test. If it cannot be controlled with a triac, then adding a PIC to the equation won't change that fact.
    2) New question: If the motor doesn't work as you wish when connected directly to the mains (i.e., it turns too slowly), it will not go faster when connected to the triac. Is that interpretation of the underlined comment correct?

    John
     
  10. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    For zero cross detection I used a BJT Transistors ,ope now you can find a complete circuit I designed.

    Kind Regards,
     
  11. bertus

    Administrator

    Apr 5, 2008
    15,644
    2,344
    Hello,

    You have only 4.5 mA going through the optocoupler, but is asks for 15 mA, according the datasheet.

    You might want to look at this appnote for the zero crossing detection:
    http://sound.westhost.com/appnotes/an005.htm

    Bertus
     
  12. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    I added a BJT transistors BC548 with RB=1Kohm and RC=500ohm but no succes,how should I increase more that current up to the 15mA required?Please advise!!
     
  13. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
    Also check out the Fairchild App note AN-3006 for correct zero cross detection with opto isolation to a Pic etc.
    Max.
     
  14. bertus

    Administrator

    Apr 5, 2008
    15,644
    2,344
    Hello,

    You could try the following output stage:

    jean120_output circuit.png

    Bertus
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,507
    2,367
  16. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    I checked that one of Tahmid blog but it didn`t help a lot.
    Are you advising that if I change those resistors the circuit should work?With AC Single Phase motor?

    Regards,
     
  17. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    I tried to place 150Ohm at the collector of that transistor controlling the MOC3020 but even when the PIC is not in the board the motor turns at maximum speed,so the PIC is no longer controlling the motor.Even with 180ohms the motor turns at maximum speed even when the PIC is not in the board.

    Please help!!
     
  18. nestbulala

    Member

    Dec 12, 2015
    68
    1
    Jean,

    Try this circuit I used for the fan motor of air conditioning unit. You just vary the delay from the PIC as per Tahmid Blogs and it should be running fine. It worked for me for 15 watt PG Motor.
     
  19. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    I designed a soft start circuit for an amplifier.
    I just used a 390K resistor into a PIC input for mains zero crossing detection, worked great.
    To drive the triac I used an opto coupler.
     
  20. jean120

    Thread Starter Member

    Jan 24, 2016
    75
    1
    Dear nigelwright7557,could you share the circuit with me? You can send me a PM, thank you very much.


    Mod note:
    Please don't show your Email box on forums, because it will bring the spam robots to the forum and your email box, thank you.
     
Loading...