EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / THREE PHASE DETECTOR /PHASE FAILURE

THREE PHASE DETECTOR /PHASE FAILURE

|

Electronics › Electronics › THREE PHASE DETECTOR /PHASE FAILURE

  • This topic has 0 replies, 1 voice, and was last updated 9 years, 10 months ago by Dhananjaya.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • July 11, 2015 at 1:54 pm #3759
    Dhananjaya
    Participant
    Dear Sir/Madam please give any idea/concept for AC Phase detecting either Present/Absent (Logic 1/0)without converting DC volt to detect TTL PIC16F676 microcontroller someone already implemented this products but know i am also implementing  this concept on same circuits but I have dont know the logic/ C code for this know I am tried as follows but still i cant  able to detecting phase
     
    three phase (RY & B) AC analog inputs directly connected microcontroller pin without converting DC volts / reduced the voltage by using resistor divider circuit  series with of 2.2Mohm 0.5watt+5Mohm 0.25watt connected to microcontroller(PIC16F676 pins RA0,RA1 & RA2). and internal oscillator like
     
    #define _XTAl_FREQ 4000000
    __CONFIG(0x3FF4)
    #define R_phase RA0
    #define Y_phase RA1
    #define B_phase RA2
     
    #define Three_phase_LED RC0
    #define Two_phase_LED RC1
    #define Single_phase_LED RC2
    #define NO_phase_LED RC3
     
    char phaseRflag = 0;  // flag variables for each phase
    char phaseYflag = 0;
    char phaseBflag = 0;
     
    char single_phase_flag = 0;  // used for single phase detection test
     
    unsigned int sample = 0; // used to set "for loop" duration
     
    void main()
    {
      CMCON=0x07;
      ANSEL=0x00; 
      TRISA =0b001111;
      PORTA=0b001111;
      TRISC=0b000000;
      PORTC=0b00000;
     
      while(1) // while loop to test phases continously
        {
        phaseRflag = 0;  // phase flags are set to zero
        phaseYflag = 0;
        phaseBflag = 0;
       
       // a "for loop" tests the inputs for 20 milliseconds, setting a flag if a logic 1 is read
     
        for(sample = 16000; sample > 0; sample–)  // test all phases for at least 20 milliseconds
            {
            if(R_phase)        // if a 1 is detected on a phase set a flag to 1;
               phaseRflag = 1;
            if(Y_phase)
               phaseYflag = 1;   
            if(B_phase)
               phaseBflag = 1; 
            }                          // end of the  for loop   
     
        // phase tests running as before, except now looking at the flag settings
        // test for all phases on


      
        if(phaseRflag && phaseYflag && phaseBflag) 
           Three_phase_LED = 1;  // RC0 pin connected(Three_phase) LED will Glow ON
        else
           Three_phase_LED = 0;
     
        // test for phase R and B on


     
        if(phaseRflag && phaseBflag && !phaseYflag)
            Two_phase_LED = 1;    // RC1 pin connected(Two_phase) LED will Glow ON
        else
            Two_phase_LED = 0; 
     
        // test for a single phase on


     
     
        single_phase_flag = 0;  // set if only a single phase was detected
     
        if(phaseRflag || !phaseYflag || !phaseBflag)  // only R_phase is on
             single_phase_flag = 1;  
       
        if(!phaseRflag || phaseYflag || !phaseBflag)  // only Y_phase is on
             single_phase_flag = 1; 
       
        if(!phaseRflag || !phaseYflag || phaseBflag)  // only B_phase is on
             single_phase_flag = 1; 
       
        if(single_phase_flag == 1)   // if  a single phase was detected
             Single_phase_LED = 1;   // RC2 pin connected(Single_phase) LED will Glow ON
        else
             Single_phase_LED = 0;   // single phase LED off
        
        // test for no phases on


       
        if(!phaseRflag && !phaseYflag && !phaseBflag)
           NO_phase_LED = 1;    // RC3 pin connected(No_phase) LED will Glow On    
        else
           NO_phase_LED = 0;
       }   // end of while loop
    }      // end of main
     
     
    In this pregame only  
           NO_phase_LED = 1;    LED is On  always….  
  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • LED circuit for 1/6 scale diorama May 14, 2025
  • Can I use this charger in every country? May 14, 2025
  • Electronic board faulty?!? May 13, 2025
  • using a RTC in SF basic May 13, 2025
  • An Update On Tarrifs May 13, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise