Maker Pro
Maker Pro

pic16f84 powered from mains power supply without transformer?

A

Abacus-Ri

Jan 1, 1970
0
Hi to all,

I'm searching for already test schematic for pic16f84 powered from mains
power supply without to use transformer and to control zero crossing with B0
I planning to use it for soft start of motor and lights (220VAC)
..

Thanks in advance,
Damir
..
 
J

john jardine

Jan 1, 1970
0
Abacus-Ri said:
Hi to all,

I'm searching for already test schematic for pic16f84 powered from mains
power supply without to use transformer and to control zero crossing with B0
I planning to use it for soft start of motor and lights (220VAC)
.

Thanks in advance,
Damir
.

You want the Microchip application note #AN958. Also useful is AN954.
 
E

Emanuele

Jan 1, 1970
0
Abacus-Ri ha scritto:
Hi to all,

I'm searching for already test schematic for pic16f84 powered from mains
power supply without to use transformer and to control zero crossing with B0
I planning to use it for soft start of motor and lights (220VAC)
.

Thanks in advance,
Damir
.

Search: transformerless power supply

In Microchip (TB008 and other..)

and in GOOGLE!

Emanuele

--
*** YOUR ELECTRONICS OPEN SOURCE ***

http://dev.emcelettronica.com

;---------------------------------------------------------
(Full Projects and resources)
 
A

Abacus-Ri

Jan 1, 1970
0
thanks for answer to both of you, but in theory everything is ok.In real
design is something else.
I could not receive zero crossing input from mains. It si 10 MOHM resistor
conect
to B0. In simulator everything is ok. Power from mains is taken over 0,47uF
capacitor and diode bridge to 78L05.

any idea?

i search with google without success.

thanks in advance,
Damir
 
P

Paul E. Schoen

Jan 1, 1970
0
Abacus-Ri said:
thanks for answer to both of you, but in theory everything is ok.In real
design is something else.
I could not receive zero crossing input from mains. It si 10 MOHM
resistor conect
to B0. In simulator everything is ok. Power from mains is taken over
0,47uF capacitor and diode bridge to 78L05.

any idea?

i search with google without success.

thanks in advance,
Damir

It would be helpful if you could show your schematic, especially if it is
in LTSpice ASC format. I assume your simulator is MPLAB SIM?

The FWB from the power line through a capacitor loses the ground reference
you need for an accurate zero crossing. A better way to get the power to
the PIC is with a zener to neutral, a diode to a capacitor, and then a
regulator for 5VDC. You should have a current-limiting resistor in series
with the capacitor, especially if there may be high frequency spikes in the
line. I have used a similar approach, and found that an 18 ohm 1/2 W series
resistor would overheat, indicating much higher current than expected.

I assume your 1M resistor goes to a comparator input or possibly a Schmitt
trigger digital input. For zero crossing detection, make sure the input to
the PIC never goes more negative than one diode drop. Even better, bias the
input so that the signal stays within the power rails, and use a comparator
to pick up the zero crossings. Make sure there is no appreciable phase
shift from the resistor and any capacitance at the PIC input.

Paul
 
A

Abacus-Ri

Jan 1, 1970
0
Thanks Paul,

that what you say have sence. In fact originaly drawing was with
transformer, and everything was ok. Meantime, I try to take out transformer
and change schematic. Instead of transformer I put 0.47uF capacitor on one
side connected to phase, on other side connected to diode bridge ACinput.
Zero from mains going to second input of diode bridge. Positive from diode
bridge going to diode and after it to 78L05. Point between diode bridge and
diode is connected to 2 serial resistor to zero from main. Middle point is
connected to zener diode 5,1 and to B0 input on PIC for zero crossing.
Latter I change some things but still without proper result. I try to find
similar drawings, just to copmare, because this is my first project without
transformer and PIC together.

Thansk for your time,

Damir
 
P

Paul E. Schoen

Jan 1, 1970
0
Abacus-Ri said:
Thanks Paul,

that what you say have sence. In fact originaly drawing was with
transformer, and everything was ok. Meantime, I try to take out
transformer and change schematic. Instead of transformer I put 0.47uF
capacitor on one side connected to phase, on other side connected to
diode bridge ACinput. Zero from mains going to second input of diode
bridge. Positive from diode bridge going to diode and after it to 78L05.
Point between diode bridge and diode is connected to 2 serial resistor to
zero from main. Middle point is connected to zener diode 5,1 and to B0
input on PIC for zero crossing. Latter I change some things but still
without proper result. I try to find similar drawings, just to copmare,
because this is my first project without transformer and PIC together.

Thansk for your time,

Damir
I just tried two simulations, one with a FWB, and the other with a two
diode doubler type circuit. Both have essentially the same zero crossing
waveform, with positive level of about 4 volts, and negative excursions of
650 mV. You can add a little positive bias to make sure the input to B0
does not go negative. For both circuits the simulation shows a logic state
change within 30 uSec of actual ZC, so phase error at 60 Hz is less than 1
degree. The 5 VDC supply will provide at least 5 mA, and the circuit
current draw from a 240 VAC 60 Hz line is about 43 mA RMS. The LTSpice
circuits follow:

Paul

========================== OffLineSupplyFWB.ASC ===========================

Version 4
SHEET 1 880 680
WIRE -208 80 -304 80
WIRE -32 80 -208 80
WIRE 0 80 -32 80
WIRE 384 80 80 80
WIRE -304 96 -304 80
WIRE 64 224 -32 224
WIRE 160 224 128 224
WIRE 176 224 160 224
WIRE 304 224 256 224
WIRE 432 224 304 224
WIRE -304 240 -304 176
WIRE -208 240 -208 80
WIRE 384 256 384 80
WIRE -304 272 -304 240
WIRE 160 272 160 224
WIRE 304 272 304 224
WIRE 432 272 432 224
WIRE 64 288 16 288
WIRE 128 288 128 224
WIRE 256 288 256 224
WIRE -32 352 -32 224
WIRE 64 352 -32 352
WIRE -304 416 -304 352
WIRE -256 416 -304 416
WIRE -208 416 -208 320
WIRE -208 416 -256 416
WIRE 16 416 16 288
WIRE 16 416 -208 416
WIRE 64 416 16 416
WIRE 128 416 128 352
WIRE 160 416 160 336
WIRE 160 416 128 416
WIRE 256 416 256 352
WIRE 256 416 160 416
WIRE 304 416 304 336
WIRE 304 416 256 416
WIRE 384 416 384 320
WIRE 384 416 304 416
WIRE 432 416 432 352
WIRE 432 416 384 416
FLAG 304 224 Vout
FLAG 384 80 Vzc
FLAG 384 416 0
FLAG -304 240 Vi
FLAG -256 416 Vn
SYMBOL cap -48 160 R0
SYMATTR InstName C1
SYMATTR Value 0.47µ
SYMATTR SpiceLine V=600
SYMBOL diode 64 240 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D1
SYMATTR Value MUR460
SYMBOL diode 64 304 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D2
SYMATTR Value MUR460
SYMBOL diode 128 336 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D3
SYMATTR Value MUR460
SYMBOL diode 128 400 R90
WINDOW 0 0 32 VBottom 0
WINDOW 3 32 32 VTop 0
SYMATTR InstName D4
SYMATTR Value MUR460
SYMBOL voltage -208 224 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(0 350 60 0 0 0 100)
SYMBOL zener 272 352 R180
WINDOW 0 24 72 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName D5
SYMATTR Value 1N750
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 272 208 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R1
SYMATTR Value 270
SYMBOL polcap 144 272 R0
WINDOW 3 24 64 Left 0
SYMATTR Value 100µ
SYMATTR InstName C2
SYMATTR Description Capacitor
SYMATTR Type cap
SYMATTR SpiceLine V=16 Irms=135m Rser=0.8 MTBF=1000 Lser=0 mfg="Nichicon"
pn="UPR1C101MPH" type="Al electrolytic" ppPkg=1
SYMBOL cap 288 272 R0
SYMATTR InstName C3
SYMATTR Value 1µ
SYMATTR SpiceLine V=10 Irms=0 Rser=0.009 MTBF=0 Lser=0 mfg="TDK"
pn="C1608X5RIA105K" type="X5R" ppPkg=1
SYMBOL res 96 64 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R2
SYMATTR Value 1000k
SYMBOL res 416 256 R0
SYMATTR InstName R4
SYMATTR Value 1k
SYMBOL res -320 80 R0
SYMATTR InstName R5
SYMATTR Value 100k
SYMBOL res -320 256 R0
SYMATTR InstName R6
SYMATTR Value 5k
SYMBOL zener 400 320 R180
WINDOW 0 24 72 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName D6
SYMATTR Value 1N750
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res -48 64 R0
SYMATTR InstName R3
SYMATTR Value 20
TEXT -240 504 Left 0 !.tran 200m startup

========================== OffLineSupply.ASC ===========================

Version 4
SHEET 1 880 680
WIRE -208 80 -304 80
WIRE 0 80 -208 80
WIRE 384 80 80 80
WIRE -208 128 -208 80
WIRE -160 128 -208 128
WIRE -32 128 -80 128
WIRE -304 192 -304 80
WIRE -32 224 -32 192
WIRE 64 224 -32 224
WIRE 160 224 128 224
WIRE 176 224 160 224
WIRE 304 224 256 224
WIRE 448 224 304 224
WIRE -208 240 -208 128
WIRE 384 240 384 80
WIRE 160 272 160 224
WIRE 304 272 304 224
WIRE 448 272 448 224
WIRE -304 288 -304 272
WIRE -32 288 -32 224
WIRE 256 288 256 224
WIRE -304 304 -304 288
WIRE -304 416 -304 384
WIRE -208 416 -208 320
WIRE -208 416 -304 416
WIRE -32 416 -32 352
WIRE -32 416 -208 416
WIRE 160 416 160 336
WIRE 160 416 -32 416
WIRE 256 416 256 352
WIRE 256 416 160 416
WIRE 304 416 304 336
WIRE 304 416 256 416
WIRE 384 416 384 304
WIRE 384 416 304 416
WIRE 448 416 448 352
WIRE 448 416 384 416
FLAG 304 224 Vout
FLAG 384 80 Vzc
FLAG 448 416 0
FLAG -304 288 Vi
SYMBOL cap -48 128 R0
SYMATTR InstName C1
SYMATTR Value 0.47µ
SYMATTR SpiceLine V=600
SYMBOL diode 64 240 R270
WINDOW 0 32 32 VTop 0
WINDOW 3 0 32 VBottom 0
SYMATTR InstName D1
SYMATTR Value MUR460
SYMBOL diode -16 352 R180
WINDOW 0 24 72 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName D2
SYMATTR Value MUR460
SYMBOL voltage -208 224 R0
WINDOW 123 0 0 Left 0
WINDOW 39 0 0 Left 0
WINDOW 3 -97 213 Left 0
SYMATTR InstName V1
SYMATTR Value SINE(0 350 60 0 0 0 100)
SYMBOL zener 272 352 R180
WINDOW 0 24 72 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName D5
SYMATTR Value 1N750
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 272 208 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R1
SYMATTR Value 470
SYMBOL polcap 144 272 R0
WINDOW 3 24 64 Left 0
SYMATTR Value 100µ
SYMATTR InstName C2
SYMATTR Description Capacitor
SYMATTR Type cap
SYMATTR SpiceLine V=16 Irms=135m Rser=0.8 MTBF=1000 Lser=0 mfg="Nichicon"
pn="UPR1C101MPH" type="Al electrolytic" ppPkg=1
SYMBOL cap 288 272 R0
SYMATTR InstName C3
SYMATTR Value 1µ
SYMATTR SpiceLine V=10 Irms=0 Rser=0.009 MTBF=0 Lser=0 mfg="TDK"
pn="C1608X5RIA105K" type="X5R" ppPkg=1
SYMBOL res 96 64 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R2
SYMATTR Value 1000k
SYMBOL zener 400 304 R180
WINDOW 0 24 72 Left 0
WINDOW 3 24 0 Left 0
SYMATTR InstName D3
SYMATTR Value 1N750
SYMATTR Description Diode
SYMATTR Type diode
SYMBOL res 432 256 R0
SYMATTR InstName R3
SYMATTR Value 1k
SYMBOL res -320 176 R0
SYMATTR InstName R4
SYMATTR Value 100k
SYMBOL res -320 288 R0
SYMATTR InstName R5
SYMATTR Value 5k
SYMBOL res -64 112 R90
WINDOW 0 0 56 VBottom 0
WINDOW 3 32 56 VTop 0
SYMATTR InstName R6
SYMATTR Value 20
TEXT -306 458 Left 0 !.tran 100m startup
 
K

Klaus Kragelund

Jan 1, 1970
0
diode doubler type circuit. Both have essentially the same zero crossing
waveform, with positive level of about 4 volts, and negative excursions of
650 mV. You can add a little positive bias to make sure the input to B0
does not go negative. For both circuits the simulation shows a logic state
change within 30 uSec of actual ZC, so phase error at 60 Hz is less than 1
degree. The 5 VDC supply will provide at least 5 mA, and the circuit
current draw from a 240 VAC 60 Hz line is about 43 mA RMS. The LTSpice
circuits follow:

What happens in case of a power-line surge?

(for conveniance the schematics are copied to: www.microdesign.dk/tmp/
OffLineSupply.pdf)

The mains may contain surges up to 4kV with a rise time of 1us
(simulating the turn-off of a inductive load).

In this supply the impedance to the shunt capacitor C2 is 20 ohms.
(Actually the coupling capacitor C1 limits the current due to limited
dV/dt). The maximum current is 4A - this will certainly blow the
resistor.

So, I think you need a varistor to protect the circuit. If however you
find a good wirewound for R6, you may get thorught using a couple of
those (typically 1-2kV for very short voltage transients is ok for a
wirewound)

Regards

Klaus
 
P

Paul E. Schoen

Jan 1, 1970
0
Klaus Kragelund said:
What happens in case of a power-line surge?

(for conveniance the schematics are copied to: www.microdesign.dk/tmp/
OffLineSupply.pdf)

The mains may contain surges up to 4kV with a rise time of 1us
(simulating the turn-off of a inductive load).

In this supply the impedance to the shunt capacitor C2 is 20 ohms.
(Actually the coupling capacitor C1 limits the current due to limited
dV/dt). The maximum current is 4A - this will certainly blow the
resistor.

So, I think you need a varistor to protect the circuit. If however you
find a good wirewound for R6, you may get thorught using a couple of
those (typically 1-2kV for very short voltage transients is ok for a
wirewound)

Regards

Klaus

This may be what has caused overheating and failure of a resistor in a
similar circuit I have been using as a voltage monitoring relay. The normal
power should be well under 1/4 watt, but even a 1/2 watt resistor showed
signs of overheating. I think we discovered that this happened on generator
power, which may have more high frequency and high voltage spikes. I would
not expect utility power to have very much of this sort of noise, and not
at high enough duty cycles to cause overheating, but I don't know for
certain.

Usually there is an "I squared t" parameter for non-repetitive (or low duty
cycle) overloads. For large components like transformers, you can typically
allow a 10x current overload (100x resistive wattage) for about 0.1 sec at
1% duty cycle. The maximum current of 4A might be tolerable for a surge of
less than one cycle (as expected for inductive switching transients). There
is probably more danger in this case that the capacitor dielectric could
fail with momentary shorts, which may be self-healing (with the proper film
capacitor), but could cause much higher currents that might be sustained
for a while after the initial surge.

All of this points to the high risk of failure for capacitor fed line
voltage supplies. Perhaps it is better to FWB rectify the voltage directly
into an energy storage capacitor (as done in most switching supplies), and
then use a high frequency transformer isolated step-down. Of course, this
adds to complexity and cost. Switchers usually have some sort of line side
inductive filtering and transient-limiting varistors, which would limit the
effects of high voltage surges. Perhaps a small inductor in series with the
capacitor would work in the simple circuit being discussed.

Paul
 
E

Emanuele

Jan 1, 1970
0
Klaus Kragelund ha scritto:
What happens in case of a power-line surge?

(for conveniance the schematics are copied to: www.microdesign.dk/tmp/
OffLineSupply.pdf)

The mains may contain surges up to 4kV with a rise time of 1us
(simulating the turn-off of a inductive load).

In this supply the impedance to the shunt capacitor C2 is 20 ohms.
(Actually the coupling capacitor C1 limits the current due to limited
dV/dt). The maximum current is 4A - this will certainly blow the
resistor.

So, I think you need a varistor to protect the circuit. If however you
find a good wirewound for R6, you may get thorught using a couple of
those (typically 1-2kV for very short voltage transients is ok for a
wirewound)

Regards

Klaus

I suggest a transil too

(5V monodirectional) near the PIC

Emanuele

--
*** YOUR ELECTRONICS OPEN SOURCE ***

http://dev.emcelettronica.com

;---------------------------------------------------------
Progetti Completi e Risorse (Full Projects and resources)
 
T

Terry Given

Jan 1, 1970
0
Paul said:
This may be what has caused overheating and failure of a resistor in a
similar circuit I have been using as a voltage monitoring relay. The normal
power should be well under 1/4 watt, but even a 1/2 watt resistor showed
signs of overheating. I think we discovered that this happened on generator
power, which may have more high frequency and high voltage spikes. I would
not expect utility power to have very much of this sort of noise, and not
at high enough duty cycles to cause overheating, but I don't know for
certain.

Usually there is an "I squared t" parameter for non-repetitive (or low duty
cycle) overloads. For large components like transformers, you can typically
allow a 10x current overload (100x resistive wattage) for about 0.1 sec at
1% duty cycle. The maximum current of 4A might be tolerable for a surge of
less than one cycle (as expected for inductive switching transients). There
is probably more danger in this case that the capacitor dielectric could
fail with momentary shorts, which may be self-healing (with the proper film
capacitor), but could cause much higher currents that might be sustained
for a while after the initial surge.

All of this points to the high risk of failure for capacitor fed line
voltage supplies. Perhaps it is better to FWB rectify the voltage directly
into an energy storage capacitor (as done in most switching supplies), and
then use a high frequency transformer isolated step-down. Of course, this
adds to complexity and cost. Switchers usually have some sort of line side
inductive filtering and transient-limiting varistors, which would limit the
effects of high voltage surges. Perhaps a small inductor in series with the
capacitor would work in the simple circuit being discussed.

Paul

To start with, I'd be concerned about the peak-pulse-power rating of the
resistor. Good resistors have this clearly spec'd, and at 230Vrms, its
not hard to find a peak voltage of 350 - 400V when turning the unit on,
which can frighten the hell out of an unsuspecting resistor of a kOhm or
so. 470R at 230V is 225W while the cap charges. As the resistor gets
smaller this of course gets worse.

I've seen 1/4W and 1/2W resistors in the hundreds of ohms die from this,
and killed numerous 10R PRO2s this way.

It can be a sneaky failure mode because it depends when in the cycle you
turn the thing on. For 3-phase stuff (eg damping resistors in filters)
you are guaranteed to always get at least one phase exactly wrong, so
the problem shows up more easily.


and yes as mentioned any spikes get dropped entirely across the
resistor. But if you pick a suitable resistor, no worries :)

Cheers
Terry
 
K

Klaus Kragelund

Jan 1, 1970
0
similar circuit I have been using as a voltage monitoring relay. The normal
power should be well under 1/4 watt, but even a 1/2 watt resistor showed
signs of overheating. I think we discovered that this happened on generator
power, which may have more high frequency and high voltage spikes. I would
not expect utility power to have very much of this sort of noise, and not
at high enough duty cycles to cause overheating, but I don't know for
certain.

Usually there is an "I squared t" parameter for non-repetitive (or low duty
cycle) overloads. For large components like transformers, you can typically
allow a 10x current overload (100x resistive wattage) for about 0.1 sec at
1% duty cycle. The maximum current of 4A might be tolerable for a surge of
less than one cycle (as expected for inductive switching transients). There
is probably more danger in this case that the capacitor dielectric could
fail with momentary shorts, which may be self-healing (with the proper film
capacitor), but could cause much higher currents that might be sustained
for a while after the initial surge.

All of this points to the high risk of failure for capacitor fed line
voltage supplies. Perhaps it is better to FWB rectify the voltage directly
into an energy storage capacitor (as done in most switching supplies), and
then use a high frequency transformer isolated step-down. Of course, this
adds to complexity and cost. Switchers usually have some sort of line side
inductive filtering and transient-limiting varistors, which would limit the
effects of high voltage surges. Perhaps a small inductor in series with the
capacitor would work in the simple circuit being discussed.

Yes, we have had success using an inductor in series. However it is
not straightforward - the inductor creates a LC circuit so you need to
look out for peaking phenomenons (spelled wrong)

The peak current rating for the capacitor is also critical as you say,
but that should be possible to find a suitable device. WRT the
presense of the surges: its quite normal, so you cannot rely on them
to be sporadic and seldom. If your box is next to a motor you may find
these transients all the time

Regards

Klaus
 
Top