PICDIM Lamp Dimmer for the PIC12C508 - PICREF-4


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161

    Default PICDIM Lamp Dimmer for the PIC12C508 - PICREF-4

    Hello All,

    I am planning to build a Lamp Dimmer as mentioned in the PICREF-4 design. I would like some help in code for this project using PICBASIC PRO.

    Thank you in advance.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    hi,
    For the benefit of all here's the link for Microchip APP NOTE PICREF-4

    http://ww1.microchip.com/downloads/e...tes/40171a.pdf

    which part of the code you need to know??? On which frequency your AC line work... not too important but...

    IMO, i prefer using other circuit design for that... no transformer AAAAARRRRGH! Safer to use cheap transformer+opto isolator between PIC and TRIAC. But i always use the safer method... not the cheaper one. I may be wrong here but... i'm still on the market and alive
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default

    Hello Steve,

    I am looking for a code using PICBASIC Pro, It would be much easier to understand and modify.

    AC - 230V @ 50 Hz.

    I would then be interested in coupling this circuit with some IR chip set and making it totally remote operated. The IR would be ready made solution and not integrated withing the PIC itself.

    regards

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    O.k

    all you need to know @50Hz

    Period : 20 ms
    1/2 period :10 ms

    i'll prefer to detect begining of each cycle using the appended circuit...

    You must detect begining of cycle, then activate output to TRIAC for a maximum delay of 10ms including when your PIC is detecting the begining of the cycle. Let's say your PIC is detecting the cycle after 1ms of the begining, you must wait a maximum of 9 ms. Can be intelligent to use a PIC who have internal voltage comparator here.


    try the following code as a begining.

    Code:
    'Using PIC16F628
    @ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF 
    
    TRISB=%00000001
    
    BeginingCycle    var PORTB.0
    OutputToTriac    var PORTB.1
    delay            var byte
    Hold             var word
    
    while BeginingCycle
    wend
    start:
    For delay=0 to 8
         for Hold=1 to 100
              while BeginingCycle=0
              wend
         
              OutputToTriac=1
              Pause delay
              OutPutToTriac=0
              While BeginingCycle
              Wend
         Next
    next
    
    goto start
    Attached Images Attached Images  
    Last edited by mister_e; - 20th December 2004 at 23:12.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking Based on PIC12F675

    Hi,
    I do one code based on a PIC12F675. Wiring is the same as in the PICREF. But i choose a full wave rectify AC for input to PIC.

    Hope this help you.

    have fun!!!


    regards
    Attached Files Attached Files
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Sep 2003
    Location
    INDIA
    Posts
    161


    Did you find this post helpful? Yes | No

    Default

    Thanks a lot steve. I shall try and get back to you in a couple of days.

    Just enjoying the HAMFEST hosted by some local HAM club here in India.

    I shall post my developments soon.

    VU2UPX

  7. #7
    Join Date
    Sep 2015
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Based on PIC12F675

    Hi,

    I am trying to control an AC lamp with 230V 50Hz using PIC12F1572. Is it possible with this MCU??. Please help me in understanding the working of the circuit and program flow. I am using MPLAB X with xC8 compiler.

    The Data sheet of PIC12F1572 is attached in the link.

    http://ww1.microchip.com/downloads/e.../40001723D.pdf

    Thanks in Advance

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Based on PIC12F675

    Quote Originally Posted by AnupPravin View Post
    Hi,

    I am trying to control an AC lamp with 230V 50Hz using PIC12F1572. Is it possible with this MCU??. Please help me in understanding the working of the circuit and program flow. I am using MPLAB X with xC8 compiler.

    The Data sheet of PIC12F1572 is attached in the link.

    http://ww1.microchip.com/downloads/e.../40001723D.pdf

    Thanks in Advance
    You will be better off asking on a forum for XC8, this forum is for PicBasic.
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Sep 2015
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Based on PIC12F675

    If i use the same PIC12F1572 with PicBasic is it possible?

Similar Threads

  1. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 09:44
  2. Lamp Dimmer on ME Website
    By jw666 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st August 2007, 18:14
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 18:27

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts