Microcontroller › PIC › PIC 16F676 C CODE for analog i/p signal detect
- This topic has 9 replies, 4 voices, and was last updated 7 years, 1 month ago by Ashutosh Bhatt.
-
AuthorPosts
-
July 3, 2015 at 2:06 pm #3741DhananjayaParticipant
Sir, i am trying to detect a three phases lines i.e which phase is available or not by using pic16f676 .(three phases like R, Y & B Phases individually connected to pic16f676 micro controller pins RA0,RA1 & RA2 respectively) using series of 2.2M ohm 1/2 watt+5M ohm 1/4 watt to PIC pin RA0 and 10K ohm connected to ground & PIC RA0.
if R,Y & B phases (Three phase present) all are available RC0 pin connected(Three_phase) LED will Glow ON
if only R phase is available RC1 pin connected(Single_phase) LED will Glow ON
if R & B phases are available & Y phase failure RC2 pin connected (Two_phase)LED will Glow ON
i don't want digital conversion only phase is available OR not so how to detect these phases are available or not for C code …
i am initialize like this
#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
void main()
{
CMCON=0x07;
ANSEL=0x00;
TRISA =0b001111;
PORTA=0b001111;
TRISC=0b000000;
PORTC=0b00000;
while(R_phase&&Y_phase&&B_phase)
{
Three_phase_LED = 1; ///RC0 pin connected(Three_phase) LED will Glow ON
}
while(R_phase&&B_phase)
{
Two_phase_LED = 1; ///RC1 pin connected(Two_phase) LED will Glow ON
}
while(R_phase||Y_phase||B_phase)
{
Single_phase_LED = 1; ///RC2 pin connected(Single_phase) LED will Glow ON
}
while(!R_phase&&!Y_phase&&!B_phase)
{
NO_phase_LED = 1; ///RC3 pin connected(No_phase) LED will Glow ON
}
}
I have tried this concept but only NO_phase_LED = 1; LED Glow ON
finally i want detect AC mains either three/two/single phase available please let me know the program concept
thanking with u…July 5, 2015 at 8:27 am #13039rahulParticipantcan u plz share circuit diagram with us??
fst thing is that u can not measure ac signal directly u need to convert it in TTL form or use adc..
it wil be fine if u can communicate on my mail id [email protected]
July 6, 2015 at 6:55 am #13040DhananjayaParticipant
To get the input voltage from the voltage divider resistors voltage is 3.5 volts its not working but when i connect DC 3 volts its working good
The input to RA0 positive D/C voltage sufficient to indicate a logic "1" , when the phase is present, and a logic "0" when the phase is absent. how to convert TTL form as your sugession otherwise please let me ADC code…July 6, 2015 at 10:17 am #13041rahulParticipantpost your mail id i will share adc logic with u.
July 6, 2015 at 11:29 am #13042rahulParticipantpost ur email id and circuit diagram
July 6, 2015 at 1:26 pm #13043DhananjayaParticipantthank u for advance… i have to try for ADC in microchip PIC16F676 for 3 channels (3 analog inputs i.e.RA0,RA1 & RA2)-AN0,AN1,AN2) please give me ADC configuration bits /ADC initialize…for this chip.in C code
email id [email protected]
October 15, 2016 at 2:00 pm #14196AnonymousGuestI do not know the configuration of pic for adc application.Data sheet can not help mw. what i want is a set of codes that read analog input. Are there any one who can help me.
October 21, 2016 at 10:09 am #14208Ashutosh BhattParticipantthis is not the way to connect direct 3 phase lines with any micro controller
use Zero Cross Detector circuit (ZCD)
this will continuous pulses till the particular phase is present
September 22, 2017 at 7:14 am #14663AnonymousGuesthello sir, i am working on 16f676. i want to read adc values from sensor and send the values through serial. i required the program, can u please help me with that?
my mail id is [email protected]
thank you.
October 19, 2017 at 1:23 pm #14674Ashutosh BhattParticipantyou need 3 saparate ZCD – zero cross detector circuits one for each phase
the output of ZCD is continuous pulses till AC is present
as soon as AC gone – the pulses will disappear
so continuously monitor pulses from 3 sides and when any one or more is absent turn on the LED
thats all
-
AuthorPosts
- You must be logged in to reply to this topic.