CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

how add hysteresis in my code
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tanveerriaz



Joined: 04 May 2012
Posts: 7

View user's profile Send private message

PostPosted: Fri May 03, 2013 7:05 am     Reply with quote

for Mike Walne.
this is prototype. i draw a sketch of my board.
i made this pcb for test code.
i understand the risks working on live mains.
i am not a programmer.
only a electronic/radio hobbyist.
my code work show voltage on lcd and on/off led.
i can not made relay driver board. and mains in put circuit.
i say when i complete it i show it.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sat May 04, 2013 2:58 am     Reply with quote

Quote:
this is prototype. i draw a sketch of my board.
Yes, I can see that.

Quote:
i made this pcb for test code.
i understand the risks working on live mains.
i am not a programmer.
I've survived over quarter of century working with live mains circuits.
I strongly advise you isolate your PIC from the mains input.
As shown your dealing with half-wave-rectified mains.
Dorinm has pointed out a serious flaw in your strategy.

Quote:
i can not made relay driver board. and mains in put circuit.
Does this mean you don't know how or have not yet done?

Mike
dorinm



Joined: 07 Jan 2006
Posts: 38

View user's profile Send private message

PostPosted: Thu May 09, 2013 2:57 pm     Reply with quote

so, if you want some help (and thank's Mike, I do know what it means to live betveen 6kV lines Smile ), first do what Mike suggested and isolate the PIC from your mains, anything else could lead to undefined behaviour (or fun elecronic fail;) );
there's something you might want to consider: an isolation transformer is never a wrong bet ;) ...you could actually use a two-winded transfomer (one for pic, one for feeding the adc, common ground wont'n be a problem), and rectify one winding for feeding the adc of your pic; use a zero-crossing detector, and you'll know exactly when to sample, and you have plenty of time (50-60HZ = 20-16mseconds), to determine the actual voltage on your mains
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group