Well it's the holiday season and like Tim Allen it's time for me to start
working on my Christmas Lights. I decided this year to soften the chasing
lights scene and to use fading in and out of different strings. While my
Motorola MOC3010 type circuits works fine, for dimming I need to detect
zero crossings. I plan to turn the lights one an off for whole cycles instead
of trying to triggerfor a portion of the cycle which generates that buzzing
sound.
Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
but I have to ask the dumb question: What's the return on the AC line? I can't
see how connecting just the hot line of the AC power is going to get you
anywhere and I'm damn scared to connect the neutral up anywhere near the
microcontroller.
1) That's not a dumb question - you can have lots of fun with mains failure
when you bring the neutral close to the "ground".
2) Provided your circuit operates from the live and neutral ONLY, you may
attach the neutral to the 0V (ground) - unless of course some dumb idiot
wire the power to you with the live and neutral swapped - do first check that.
3) Use an isolating 1:1 transformer - but if you do this you might as well
use the supply transformer (if you have one).
4) I once got my 50Hz timing info by wrapping a wire around a fluorescent
light and taking the SINGLE wire into the PIC. I made a digital (wall) watch
that hasn't lost a 1/50th of second in 5 years. PS. To see how little
current you need to switch a PIC input, take a window device, run a program
that waits in a loop for a pin to go high, then low, before toggling another
pin and see how the period varies as you vary the amount of light let in
through the window.
Hope this helps.
Jan van der Watt
[I went to ACTIVE-WORLDS and virtually stayed there]
In message <spam_OUT199612060422.XAA32389TakeThisOuTgemini.cc.gatech.edu> .....PICLISTKILLspam@spam@MITVMA.MIT.EDU
writes:
> Well it's the holiday season and like Tim Allen it's time for me to start
> working on my Christmas Lights. I decided this year to soften the chasing
> lights scene and to use fading in and out of different strings. While my
> Motorola MOC3010 type circuits works fine, for dimming I need to detect
> zero crossings. I plan to turn the lights one an off for whole cycles instead
> of trying to triggerfor a portion of the cycle which generates that buzzing
> sound.
>
I did this once, but found flicker at low intensities was too much.
Some quick sums:
If you go for 6 bits of brightness, at minimum brightness, you
will have 1 cycle on every 64 cycles, which in the UK (50Hz)
works out as 1.28 seconds between flashes.
I went over to switching mid-cycle to avoid the flicker.
Byron A Jeff wrote:
>
> Well it's the holiday season and like Tim Allen it's time for me to start
> working on my Christmas Lights. I decided this year to soften the chasing
> lights scene and to use fading in and out of different strings. While my
> Motorola MOC3010 type circuits works fine, for dimming I need to detect
> zero crossings. I plan to turn the lights one an off for whole cycles instead
> of trying to triggerfor a portion of the cycle which generates that buzzing
> sound.
>
> Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
> but I have to ask the dumb question: What's the return on the AC line? I can't
> see how connecting just the hot line of the AC power is going to get you
> anywhere and I'm damn scared to connect the neutral up anywhere near the
> microcontroller.
We've been down this path before..
You're best off using a transformer; you can often steal the ac input to
the bridge and diode clamp it to come up with a suitable cmos level
signal. All you need to do is overdrive the diodes enough to get fast
edges, maybe 3 to 5 times, and this works out to be the input to, say,
the 12v or 15v supply in a multi output supply. If you need a separate
transformer, you can get by with a really wee one.
With PIC processors you can get by with a wee transformer and gross
input to the bridge because the power is going to so low. In this case
the same transformer winding can perform both jobs. I use a typical
poorly regulated ac wall wart for this; the 5v regulator gets between 13
and 19 volts, and the ac peaks above that.
For power switching zero crossing detection this gets you plenty close
enough, and you're not connected directly to that high compliance
source..
>
> Byron A Jeff wrote:
> >
> > Well it's the holiday season and like Tim Allen it's time for me to start
> > working on my Christmas Lights. I decided this year to soften the chasing
> > lights scene and to use fading in and out of different strings. While my
> > Motorola MOC3010 type circuits works fine, for dimming I need to detect
> > zero crossings. I plan to turn the lights one an off for whole cycles
instead
> > of trying to triggerfor a portion of the cycle which generates that buzzing
> > sound.
> >
> > Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
> > but I have to ask the dumb question: What's the return on the AC line? I
can't {Quote hidden}
> > see how connecting just the hot line of the AC power is going to get you
> > anywhere and I'm damn scared to connect the neutral up anywhere near the
> > microcontroller.
>
> We've been down this path before..
> You're best off using a transformer; you can often steal the ac input to
> the bridge and diode clamp it to come up with a suitable cmos level
> signal. All you need to do is overdrive the diodes enough to get fast
> edges, maybe 3 to 5 times, and this works out to be the input to, say,
> the 12v or 15v supply in a multi output supply. If you need a separate
> transformer, you can get by with a really wee one.
Well the transformer is definitely a possibility. But the Microchip engineers
seemed to be real proud of the fact that the diodes on the I/O pins could
be used for the purpose with just a resistor to limit current.
Another thing is that the same issue I raised is still present. Presuming
I use a transformer and I tie one leg of the secondary to the PIC input pin,
where does the other leg go? GND? All the transformer does is change the
voltage, it does not address the issue of how to integrate the return...
>
> 1) That's not a dumb question - you can have lots of fun with mains failure
> when you bring the neutral close to the "ground".
I thought so.
>
> 2) Provided your circuit operates from the live and neutral ONLY, you may
> attach the neutral to the 0V (ground) - unless of course some dumb idiot
> wire the power to you with the live and neutral swapped - do first check that.
Yup that is definitely a possibility. I was planning to drive this circuit
with a wall wart. But it's easy enough to build a quick 5V supply. But the
same issue are still there. Presuming I'm using an integrated bridge rectifier
does it matter which leg of the secondary is connected to ground and which
leg is connected to the input pin?
> Another thing is that the same issue I raised is still present. Presuming
> I use a transformer and I tie one leg of the secondary to the PIC input pin,
> where does the other leg go? GND? All the transformer does is change the
> voltage, it does not address the issue of how to integrate the return...
Well, it does. With a transformer you can safely tie one side of the
secondary to ground. With mains input directly, you need to tie
the neutral to the PIC "ground", but you must not connect this to a real
ground, since not only can't you be sure the active and neutral are not
reversed, even if the neutral really is neutral, connecting it to
ground will trip earth-leakage detectors due to ground-loop currents.
The transformer primary is easily protected from fingers; the entire
PIC circuit is not. If you do want to float the PIC at mains potential,
then use an isolation transformer during testing, and even then
you still have to be careful of the transformer secondary, since it
can kill you too. A low-voltage transformer is much safer.
Mind you, you Yanks only have to be careful of 115V - 240V will
kill you twice as fast!
--
Clyde Smith-Stubbs | HI-TECH Software, | Voice: +61 7 3354 2411 clydeKILLspamhitech.com.au | P.O. Box 103, Alderley, | Fax: +61 7 3354 2422 http://www.hitech.com.au | QLD, 4051, AUSTRALIA. |
---------------------------------------------------------------------------
Download a FREE beta version of our new ANSI C compiler for the PIC
microcontroller! Point your WWW browser at http://www.hitech.com.au/
>
> Byron A. Jeff wrote:
>
> > Another thing is that the same issue I raised is still present. Presuming
> > I use a transformer and I tie one leg of the secondary to the PIC input pin,
> > where does the other leg go? GND? All the transformer does is change the
> > voltage, it does not address the issue of how to integrate the return...
>
> Well, it does. With a transformer you can safely tie one side of the
> secondary to ground. With mains input directly, you need to tie
> the neutral to the PIC "ground", but you must not connect this to a real
> ground, since not only can't you be sure the active and neutral are not
> reversed, even if the neutral really is neutral, connecting it to
> ground will trip earth-leakage detectors due to ground-loop currents.
That's the answer I've been looking for. Thanks. Any reason why the App
Note doesn't address these issues? Rhetorical question mind you...
>
> The transformer primary is easily protected from fingers; the entire
> PIC circuit is not. If you do want to float the PIC at mains potential,
> then use an isolation transformer during testing, and even then
> you still have to be careful of the transformer secondary, since it
> can kill you too. A low-voltage transformer is much safer.
But one or two other issues are raised. Since I'm trying to do zero crossing
will the transformer have any phase effects? Also since the voltage is smaller
will it not take longer from the zero crossing for the secondary to reach the
2V threashold? Meaning that the PIC detecting the zero crossing will be much
longer than if I was trying to detect directly from the 120V line.
Mind you this isn't worth getting killed over so I will use the transformer,
but I was just wondering.
Byron A Jeff wrote:
>
...........
> Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
> but I have to ask the dumb question: What's the return on the AC line? ......
Byron:
The idea in AN521 is to use the clamping action of the input protection
diodes
to turn the 115 VAC mains voltage into a square wave. The app note
shows a
5 meg resistor between the hot (black wire in US) and the input pin. I
think
your question is what to do with the white neutral wire. I think the
answer
is to put a 5 meg ohm resistor in series with it to the PIC ground.
This way
you are not concerned about improper house wiring.
On a similar note, when the origional fuzz busters came out the
manufacturer
gave instructions for the truckers to connect one wire to ground and the
other to a hot wire(no polarity needed). This worked because they used
a full wave bridge rectifier in the DC powered fuzzbuster.
PMFJI, I have not seen Appl. Note 521, but a transformer is considered to be a
separately derived voltage source by the National Electrical Code(N.E.C.)
and the voltage
across the secondary windings is of course ungrounded unless you connect one of
the windings to ground. If we are talking about 115 volts(nominal), then
normally
this is a single phase voltage and one side(one of the secondary windings)
is the
hot and one side(the opposite winding from the hot) is the grounded
neutral. Therefore, the secondary of isolation(120 volt to 120 volt) transformer
should have one winding connected to ground. This can connect to the equipment
grounding conductor(the third wire in a 3 wire plug that is not the hot or
neurtal)
or to grounded building steel, a ground rod, or other acceptable methods per
the
N.E.C. This derived ground(grounded neutral) on the secondary of the transformer
is then also connected to the power ground connection of the PIC chip. Rather or
not this is also signal ground also is a whole other topic for discussion. I
hope
this helps.
Bernie Parent, P.E.
>>
>> Byron A Jeff wrote:
>> >
>> > Well it's the holiday season and like Tim Allen it's time for me to start
>> > working on my Christmas Lights. I decided this year to soften the chasing
>> > lights scene and to use fading in and out of different strings. While my
>> > Motorola MOC3010 type circuits works fine, for dimming I need to detect
>> > zero crossings. I plan to turn the lights one an off for whole cycles
> instead
>> > of trying to triggerfor a portion of the cycle which generates that buzzing
>> > sound.
>> >
>> > Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
>> > but I have to ask the dumb question: What's the return on the AC line? I
> can't
>> > see how connecting just the hot line of the AC power is going to get you
>> > anywhere and I'm damn scared to connect the neutral up anywhere near the
>> > microcontroller.
>>
>> We've been down this path before..
>> You're best off using a transformer; you can often steal the ac input to
>> the bridge and diode clamp it to come up with a suitable cmos level
>> signal. All you need to do is overdrive the diodes enough to get fast
>> edges, maybe 3 to 5 times, and this works out to be the input to, say,
>> the 12v or 15v supply in a multi output supply. If you need a separate
>> transformer, you can get by with a really wee one.
>
>Well the transformer is definitely a possibility. But the Microchip engineers
>seemed to be real proud of the fact that the diodes on the I/O pins could
>be used for the purpose with just a resistor to limit current.
>
>Another thing is that the same issue I raised is still present. Presuming
>I use a transformer and I tie one leg of the secondary to the PIC input pin,
>where does the other leg go? GND? All the transformer does is change the
>voltage, it does not address the issue of how to integrate the return...
>
>BAJ
>
>
>
> PMFJI, I have not seen Appl. Note 521, but a transformer is considered to be a
> separately derived voltage source by the National Electrical Code(N.E.C.)
> and the voltage
> across the secondary windings is of course ungrounded unless you connect one
of
> the windings to ground.
App Note 521 specifically talks about wiring the 115V directly to the PIC
without the use of an isolation transformer. After reading here I've decided
that it's a bad idea and I plan to use a transformer.
> I hope this helps.
It really does. I'll go ahead and step the voltage down to 9VAC and detect the
zero crossings from there.
All this talk of bulky transformers and direct line connection to the
PIC makes many people nervous. Perhaps a small optoisolator to
facilitate zero detection, and a triac to 'fire' your lights ?
>----------
>From: Byron A Jeff[SMTP:.....byronKILLspam.....CC.GATECH.EDU]
>Sent: Friday, December 06, 1996 12:26PM
>To: Multiple recipients of list PICLIST
>Subject: Re: Dumb question on Application Note 521
>
>>
>> PMFJI, I have not seen Appl. Note 521, but a transformer is considered to
>>be a
>> separately derived voltage source by the National Electrical Code(N.E.C.)
>> and the voltage
>> across the secondary windings is of course ungrounded unless you connect
>>one
> of
>> the windings to ground.
>
>App Note 521 specifically talks about wiring the 115V directly to the PIC
>without the use of an isolation transformer. After reading here I've decided
>that it's a bad idea and I plan to use a transformer.
>
>> I hope this helps.
>
>It really does. I'll go ahead and step the voltage down to 9VAC and detect
>the
>zero crossings from there.
>
>BAJ
>
>
> >
> > PMFJI, I have not seen Appl. Note 521, but a transformer is considered to be
a
> > separately derived voltage source by the National Electrical Code(N.E.C.)
> > and the voltage
> > across the secondary windings is of course ungrounded unless you connect one
> of
> > the windings to ground.
>
> App Note 521 specifically talks about wiring the 115V directly to the PIC
> without the use of an isolation transformer. After reading here I've decided
> that it's a bad idea and I plan to use a transformer.
>
> > I hope this helps.
>
> It really does. I'll go ahead and step the voltage down to 9VAC and detect the
> zero crossings from there.
>
> BAJ
I'm glad that you folks all have a healthy respect for mains potential,
and transformers have lots of wonderful properties, especially for those
working on the circuit itself.
However, zillions of PRODUCTS operate safely without transformer
isolation, benefiting from improvements in size, weight, efficiency, and
cost. These products are properly INSULATED, of course. Remember, even
transformers depend on INSULATION for their isolation.
I don't hesitate to design without transformer isolation. Many of my
products use series capacitor power supplies, and any mention of this
always brings out dozens of responses of the "You're crazy if you don't
use a transformer!" variety. I take comfort in the simple fact that the
vast majority of electrical products in the world don't use a
transformer. However, it is too true that knowledge and care are
essential. Electricity can kill. I use isolation transformers, battery
operated scopes, differential probes, etc. Take care.
--
>I don't hesitate to design without transformer isolation. Many of my
>products use series capacitor power supplies, and any mention of this
>always brings out dozens of responses of the "You're crazy if you don't
>use a transformer!" variety. I take comfort in the simple fact that the
>vast majority of electrical products in the world don't use a
>transformer. However, it is too true that knowledge and care are
>essential. Electricity can kill. I use isolation transformers, battery
>operated scopes, differential probes, etc. Take care.
Could you start me off on the practical design of a series capacitor supply?
I've got a 2 channel sequencer using a 16C84 which uses a resistor-zener
supply from the 120V, 120V through a resistor for zero crossing and two
triacs driven directly from PIC pins. However, the current required by
PIC and triac drive means that the resistor has to be low enough that it
gets somewhat warm. I can see the idea of using a capacitor there but
don't know where to start in terms of cap. value or type etc.
> In article <KILLspam32A85C12.10AEKILLspamwhidbey.com>,
> Paul Mathews <RemoveMEoptoengTakeThisOuTwhidbey.com> wrote:
>
> >I don't hesitate to design without transformer isolation. Many of my
> >products use series capacitor power supplies, and any mention of this
> >always brings out dozens of responses of the "You're crazy if you don't
> >use a transformer!" variety. I take comfort in the simple fact that the
> >vast majority of electrical products in the world don't use a
> >transformer. However, it is too true that knowledge and care are
> >essential. Electricity can kill. I use isolation transformers, battery
> >operated scopes, differential probes, etc. Take care.
>
> Could you start me off on the practical design of a series capacitor supply?
> I've got a 2 channel sequencer using a 16C84 which uses a resistor-zener
> supply from the 120V, 120V through a resistor for zero crossing and two
> triacs driven directly from PIC pins. However, the current required by
> PIC and triac drive means that the resistor has to be low enough that it
> gets somewhat warm. I can see the idea of using a capacitor there but
> don't know where to start in terms of cap. value or type etc.
>
> Thanks.
>
Just some thougths:
type:
The capacitor should at least be built for the AC-voltage you are using.
Important: The value for the maximum voltage for the capacitor
('Spannungsfestigkeit') has to be for 'AC' ! I think such
capacitors are called 'Mains Voltage Capacitors'
(Netzspannungskondensatoren).
value:
Let's say the maximum average current of your circuit is Iav .
The capacitor has to supply your circuit in one half-wave -->
IC_average = 2*Iav.
now the average Voltage of the capacitor during loading your circuit :
UC_average = ( sqrt(2) * 120 / pi ) - U_Zener (Hope that's right, haven't
any reference handy now)
and with Q=U*C=I*t -->
C = I*t/U = IC_average * 1/(2*f) / UC_average
Another thing:
IMHO you should use a X-capacitor ('Schaltfester
Netspannungs-Kondensator') Oh where's my english dictionary right now
???? :-(
A X-capacitor is a capacitor which works with MAINS-voltage and you can
short-circuit (also if fully loaded) without damaging it.
If you use a 'normal' main-voltage capacitor then you should use a
small series resistor (say 220 Ohm --> Imax = sqrt(2)*120 / 220 = 0.8 A)
for protecting the capacitor.
One addition:
Because of the capacitor you get a phase shift between the AC-voltage and
your load-current pulses , so your zero-detect circuit has to be
connected directly with a resistor to the AC-voltage.
bernhard.
PS.: Hope all is correct and you can understand it ! For those
words I wasn't sure about I wrote the german translation :-)
>
> In article <TakeThisOuT32A85C12.10AEEraseMEspam_OUTwhidbey.com>,
> Paul Mathews <RemoveMEoptoengTakeThisOuTwhidbey.com> wrote:
>
> >I don't hesitate to design without transformer isolation. Many of my
> >products use series capacitor power supplies, and any mention of this
> >always brings out dozens of responses of the "You're crazy if you don't
> >use a transformer!" variety. I take comfort in the simple fact that the
> >vast majority of electrical products in the world don't use a
> >transformer. However, it is too true that knowledge and care are
> >essential. Electricity can kill. I use isolation transformers, battery
> >operated scopes, differential probes, etc. Take care.
>
> Could you start me off on the practical design of a series capacitor supply?
> I've got a 2 channel sequencer using a 16C84 which uses a resistor-zener
> supply from the 120V, 120V through a resistor for zero crossing and two
> triacs driven directly from PIC pins. However, the current required by
> PIC and triac drive means that the resistor has to be low enough that it
> gets somewhat warm. I can see the idea of using a capacitor there but
> don't know where to start in terms of cap. value or type etc.
>
> Thanks.
For 120VAC nominal, 1.0uF film capacitor rated 400VDC or 250VAC will
provide 35mA or so at a low DC voltage. You can scale the capacitance
and voltage rating up or down for other situations, but you will
probably find that many considerations lead to taking other approaches
if you need more than about 50mA. Some people insist that you should
use 2 capacitors of twice the capacitance, one connected to each line
(mains) input wire, to further isolate the circuit from the line,
especially with unpolarized plugs. My own view is that this is
unnecessary, provided that you insulate everything properly. If you
need to drive your triac(s) directly, the 2 capacitor approach
complicates things (see below).
It's wise to put some resistance in series with the AC capacitor,
preferably a carbon comp type of 100 Ohms or so, to limit the effects of
transient turn-on and high frequency noise currents. If you use SMT
thickfilm resistors, at least 3 '1206' resistors in parallel should be
substituted. Also, I recommend transient absorbing avalanche breakdown
diodes (tradenames like 'Tranzorb') instead of MOVs to protect
everything. MOVs degrade over time. One popular tranzorb P/N is
P1.5KE120CA.
The load seen by the line with series capacitance must conduct current
in both directions, and there are lots of diode and regulator
arrangements that work. Perhaps the simplest is a bridge rectifier with
a shunt regulator such as a zener diode. Of course, you need a filter
capacitor across the zener, and you may need further regulation,
depending on your requirements. The zener conducts any current not used
by the remainder of the circuitry. For a 5.1V zener, it will have a
worst case dissipation of less than a quarter Watt. If you want to use
a 5V regulator, choose a zener voltage high enough to keep the regulator
happy, > 7.5V for 78L05.
Regarding how to drive the triacs: You will discover that your circuit
'ground' is at a slightly different potential than one of the line
inputs (the rectifier forward voltages) and at a radically different
potential compared to the other (the voltage across the capacitor). One
approach to the problem of putting the triac cathode at the appropriate
potential for direct gate drive is to use additional diode(s) in series
with the triac cathode so that load currents raise its potential to
approximately the same as circuit common. Another approach is to use
optocoupler(s) to drive the triac(s), or, for light loads, use triac
output optocouplers. Have a look at Motorola MOC3021 or similar.
Of course, the 'common' or 'signal ground' potential of your circuit
will ride on the line waveform, and makes for some interesting
oscilloscope probing problems. Please be careful to use isolation
transformers, etc. when you're working with a live circuit. In fact,
avoid using the line power input as long as possible and whenever
possible during development. You may find that much of your development
work can be done with a dc supply, particularly if you use optocoupler
drive. Alternatively, consider using 24VAC during development: scale
the capacitance up to 5uF or so (film cap rated ~100VDC).
Film capacitors come in lots of shapes and sizes. Good small ones are
made by Illinois Capacitor and Paktron, among others.
--
Paul Mathews, consulting engineer
AEngineering Co. optoengEraseME.....whidbey.com
non-contact sensing and optoelectronics specialists
Bernhard Schweighofer wrote:
>
....<snip>
> Just some thougths:
>
> type:
> The capacitor should at least be built for the AC-voltage you are using.
> Important: The value for the maximum voltage for the capacitor
> ('Spannungsfestigkeit') has to be for 'AC' ! I think such
> capacitors are called 'Mains Voltage Capacitors'
For the low currents contemplated for miniature products, most film caps
with adequate voltage ratings will be OK, and most are 'self-healing'
for voltage overloads. Just remember that DC voltage ratings must be at
least root 2 x higher than AC ratings. Also, voltage transients do
happen, constantly, so design in a margin.
> (Netzspannungskondensatoren).
>
> value:
> Let's say the maximum average current of your circuit is Iav .
> The capacitor has to supply your circuit in one half-wave -->
> IC_average = 2*Iav.
> now the average Voltage of the capacitor during loading your circuit :
> UC_average = ( sqrt(2) * 120 / pi ) - U_Zener (Hope that's right, haven't
> any reference handy now)
>
> and with Q=U*C=I*t -->
>
> C = I*t/U = IC_average * 1/(2*f) / UC_average
>
> Another thing:
> IMHO you should use a X-capacitor ('Schaltfester
> Netspannungs-Kondensator') Oh where's my english dictionary right now
> ???? :-(
> A X-capacitor is a capacitor which works with MAINS-voltage and you can
> short-circuit (also if fully loaded) without damaging it.
> If you use a 'normal' main-voltage capacitor then you should use a
> small series resistor (say 220 Ohm --> Imax = sqrt(2)*120 / 220 = 0.8 A)
> for protecting the capacitor.
Yes. The resistor(s) should be a type that doesn't emit flames or smoke
when failing. Beware that thickfilm chip resistors have poor overload
characteristics.
>
> One addition:
> Because of the capacitor you get a phase shift between the AC-voltage and
> your load-current pulses , so your zero-detect circuit has to be
> connected directly with a resistor to the AC-voltage.
>
Good point. You can still use the high-value-resistor method here, or
correct for the phase shift in software.
> bernhard.
>
> PS.: Hope all is correct and you can understand it ! For those
> words I wasn't sure about I wrote the german translation :-)
>
> Bernhard Schweighofer alias EraseMEschweigisbox.tu-graz.ac.at
> (Student at Graz University of Technology, Austria)
Byron A Jeff wrote:
>
> >
> > 1) That's not a dumb question - you can have lots of fun with mains failure
> > when you bring the neutral close to the "ground".
>
> I thought so.
>
> >
> > 2) Provided your circuit operates from the live and neutral ONLY, you may
> > attach the neutral to the 0V (ground) - unless of course some dumb idiot
> > wire the power to you with the live and neutral swapped - do first check
that.
>
> Yup that is definitely a possibility. I was planning to drive this circuit
> with a wall wart. But it's easy enough to build a quick 5V supply. But the
> same issue are still there. Presuming I'm using an integrated bridge rectifier
> does it matter which leg of the secondary is connected to ground and which
> leg is connected to the input pin?
>
> BAJ
no not if you want only power and you use a transformer "for safety"
reversing the secondary leads only counts if the sine wave needs to be
in phase.Like coupling two transformers.I did not read the data sheet
you alluded to. However if I understand what you are trying to do :power
the pic and derive a sync signal for controlling a triac optocoupler
to enable zero crossing switching: then you may derive the sync signal
from the input to the bridge rectifier and the return path will be the
bridge rectifier giving a half wave current limit that and you're on
your way as to the pic itself thats what I'm here to learn.
ps batteries might last to christmas optically coupled this sounds like
fun.
...I just thought of something use a zero crossing triac output
optocoupler with a battery powered pic and to heck with the sync
signal,propagation delays,troubleshooting hazards etc.
Byron A Jeff wrote:
>
> Well it's the holiday season and like Tim Allen it's time for me to start
> working on my Christmas Lights. I decided this year to soften the chasing
> lights scene and to use fading in and out of different strings. While my
> Motorola MOC3010 type circuits works fine, for dimming I need to detect
> zero crossings. I plan to turn the lights one an off for whole cycles instead
> of trying to triggerfor a portion of the cycle which generates that buzzing
> sound.
>
> Enter AppNote 521 "Interfacing to AC Power Lines". Conceptually it's simple
> but I have to ask the dumb question: What's the return on the AC line? I can't
> see how connecting just the hot line of the AC power is going to get you
> anywhere and I'm damn scared to connect the neutral up anywhere near the
> microcontroller.
>
> Can anyone clarify?
>
> BAJ
BYRON if your running your lights from 220/110 volts and your control
box is plastic
with no exposed metal parts, and if you feel comfortable developing the
system
then there is no reason not to use a direct connection to the mains
you can use a resistor, cap or both to drop your voltage from the mains
voltage
to power the pic with no transformer
I would only condone this method if the circuit is totaly isolated (no
exposed metal parts)
preferably no user controls or switches and designed so that
Live/Neutral reversal
would not present a problem
A .1mF cap at 50 hz has an approx resistance of 31k at 220V gives 7mA
.47mF = 6k7 32mA
1mF = 3k1 69mA
At 60Hz the resistance would be lower and curent less
After Bill Gates announced to the world that he was Microsoft,
his wife was asked to comment. She said that as his wife, she
had been the first to notice this problem
Good summary. I realize that HV Caps are completely different beasts from
the low voltage ones.
What I was trying to say was (and I probably should have been a lot more
explicit), there are a lot of issues with capacitors and before specifying
them, you have to make sure they are appropriate for the application.
myke
Paul wrote...
>Myke, first please note the following excerpt from one of my msgs, and...
Today, the commercial sector is advancing computer and communication
technology at a breakneck pace. In 1992, optical fiber was being installed
within the continental U.S. at rates approaching the speed of sound (if
computed as total miles of fiber divided by the number of seconds in the year).
Aviation Week and Space Technology, October 28, 1996
To save the troubles of zero crossing detection just use a opto-coupler
with zero-crossing detection built in. Toshiba make some that are
surprisingly cheap.
The one I have used is a TLP3063 (this is more or less an industry standard
number).
It will directly fire a TRIAC.
If you don't need to turn on for less than one half cycle then this is the
easy way.
You could then easily run your project off a battery as the opto-coupler
only needs about 5mA.
This has turned out to be a long interesting thread...
Cheers
Dennis
____________________________________________________
FROST - Electronic Design, Manufacture & Consulting.
Dennis Frost
Tel: +27 331 965125
Cel: +83 2275216
Email: dennis.frostSTOPspamspam_OUTpixie.co.za
Pietermaritzburg, South Africa
____________________________________________________
>
> To save the troubles of zero crossing detection just use a opto-coupler
> with zero-crossing detection built in. Toshiba make some that are
> surprisingly cheap.
I know. I just happen to have all the MOC3010's I need for this project.
And as the app note points out all that's really needed is a single
high valued resistor. Now Tech Brief 008 on the web site points out
that the best way to be sure that you don't slag anything is to fuse the
ground and neutral lines together. That way if you get an incorrectly
wired socket such that hot is on the wrong line, then the fuse will
immediately blow saving both the house circuitry and the project.
> The one I have used is a TLP3063 (this is more or less an industry standard
> number).
> It will directly fire a TRIAC.
> If you don't need to turn on for less than one half cycle then this is the
> easy way.
> You could then easily run your project off a battery as the opto-coupler
> only needs about 5mA.
Power was never ever the issue. It was gravy to learn how to design and
use transformerless power supplies.
BAJ
>
> This has turned out to be a long interesting thread...
The original application for the thread was to control
AC mains lights
There is another way to control AC mains that does
involve zero crossing
It does require a few more components but the results
are superb
It's suitable for lights, motor control and many other AC
mains apps
The components that follow are for 220V
You run the AC through your load, in series with a bridge rectifier.
The +/- you connect to a cap (1 or 2 microFarad 400V, parallel up some
.47's )
in parallel with a transistor (eg. TIPL 760 )with a 220 Ohms 50W
(depends
on the power you want to draw) in series (in the collector)
to limit the current to a safe level.
A MPSA 42 to drive it, a BC 549 to drive the MPSA, which is driven buy
an opto
Power for the "hot side" is taken from the mains via a 22k 1 watt
resistor
The opto is driven non from syncronised PWM direct from the Pic.
The TIPL 760 works in switch mode and shorts out the bridge via the 220
Ohms
resistor the entire circuit is very efficent
and should handle at least 100 Watts probabaly more
After Bill Gates announced to the world that he was Microsoft,
his wife was asked to comment. She said that as his wife, she
had been the first to notice this problem