PDA

View Full Version : a little help with capacitive power supply values



Dennis
- 29th December 2009, 02:30
Hi all

I would like to incorporate a transformer-less capacitive power supply in the project I am busy with.
I found this app note on the microchip site

http://ww1.microchip.com/downloads/en/AppNotes/00954A.pdf

What's confusing me is deriving the values for a 220V 50Hz supply.

I can't seem to fugure out where the values for R1 and C1 are initially derived...are the just assumed and we calculate the rest from there?

Also hat is not clear is the WATTAGE for R2 1M in figure 10 nor for VR1 or the MOV.

I hope someone can offer some help here

Kind regards
Dennis

Pic_User
- 29th December 2009, 03:08
Hi all

I would like to incorporate a transformer-less capacitive power supply in the project I am busy with.
I found this app note on the microchip site

http://ww1.microchip.com/downloads/en/AppNotes/00954A.pdf

What's confusing me is deriving the values for a 220V 50Hz supply.

I can't seem to fugure out where the values for R1 and C1 are initially derived...are the just assumed and we calculate the rest from there?

Also hat is not clear is the WATTAGE for R2 1M in figure 10 nor for VR1 or the MOV.

I hope someone can offer some help here

Kind regards
DennisHi Dennis,

Transformerless Power Supplies are extremely dangerous and discussed in many threads.
http://www.picbasic.co.uk/forum/showthread.php?t=3265
http://www.picbasic.co.uk/forum/showthread.php?t=3898

Most here would advise against them.
-Adam-

Dennis
- 29th December 2009, 03:21
Hi Adam

Thanks for the advice and heads-up !.. I promise to wear rubber gloves and have lots of back-up components for the smoked ones and will keep a fire-extinguisher handy.

It's gotta be more fun that flying a kite in the rain with a key attached to the string and waiting for the odd lightening bolt though :-)

Kind regards
Dennis

PS .. Adam ...what interesting posts !
thanks for pointing them out to me ...and I too was confused by the App Note author's use of ground and circuit ground ..especially regarding the 3-wire system.

What I would like to accomplish is a PIR/LDR controlled security light switch using a PIC , the PIC ciruit is powered from the mains and on 'sensing ' movement or light supplies mains to the light.
Something like this

MAINS ------------|PIC circuit| ----|LOAD
| PIC port
|
Live |__________-----_________|LOAD
Neutral |_______________________|LOAD

Pic_User
- 29th December 2009, 03:40
Something like this? LOL
http://www.picbasic.co.uk/forum/showpost.php?p=35490&postcount=33

Dennis
- 29th December 2009, 04:08
That's pricless :-)
Fell really sorry for the goldfish though ! Although I'm not sure if it's the first shock ... smelly feet or the second shock .. the high voltage :-) Well I guess they could always recover from the first :-)

Wish me luck :-)

Kind regards
Dennis

Byte_Butcher
- 29th December 2009, 05:15
You laugh....

Back in the day when electricians were REAL men (and human life was cheaper than a voltmeter...) THIS is how it was done...:eek:

http://www.weirdstuffwemake.com/sweetwatergems/geek/images/aeh66.jpg




steve

mackrackit
- 29th December 2009, 06:51
DO NOT TRY IT !!!

Life is to short the way it is...

Buy a transformer.

Dennis
- 29th December 2009, 10:30
Steve...

Ah yes the tongue tip taste !! There is something tantalizing (addictive perhaps) about the tongue tip taste for a battery (up to 9volts DC) not so ?

And then there's something thats very off-putting like the shock delivered working older monitors and some TV's and getting a nice belt from the LOPT or finding out from the other side of the room as an apprentice with your mentor laughing at you afterwards about the fact that the chasis of one such monitor was live.
Something so different between a shock from DC and one from AC.

Many years back I heard about an incident at a nearby college where a student had used the tongue tip test on a PC PSU (when they still had live coming to the front power switch)...they lived but couldn't do anything but mutter and waffle for quite a while afterwards !

We were always taught to use things like the right hand rule and have a friend nearby (some lecturer's actually joked about it and said the friend was there to laugh at your stupidity or have them test the circuit first :-))

Dave ...
How does one learn without experimenting ?

Keep well

Kind regards

Dennis

dhouston
- 29th December 2009, 15:28
...and I too was confused by the App Note author's use of ground and circuit ground ..especially regarding the 3-wire system.What's the potential of the neutral line when it's tied to earth ground?

X-10 has used capacitive power supplies in nearly all of its billions of 120V and 230V modules for 40+ years without frying too many of its customers. You can check Ido Bartana's website for 120V to 230V conversions to get values for R & C.http://www.idobartana.com/hakb/
If you read the Microchip app note carefully, you will find that it explains how to size R1 and C1.

Or you can Google using transformerless power supply or capacitive power supply and find suggested circuits for both 120V/60Hz and 230V/50Hz.

If the very limited current capacity is insufficient, there was a recent thread showing a design capable of 1A.

Melanie
- 29th December 2009, 15:59
> What's the potential of the neutral line when it's tied to earth ground?

Actually it can be several volts.

Consider a few kW load at the end of the wire (very easy if you consider the kind of loads encountered in a building). The wire has a Resistance depending on it's material and cross-section and length.

If you connect your DVM between the Neutral Line and Earth at your wall socket with no load on that circuit (remembering it could be connected to several outlets), then you probably will get no voltage, but as soon as you start to switch on appliances you will begin to register a voltage. Now load up with a few kW (say an electric room heater) and report back with what you find...

Dennis
- 29th December 2009, 21:01
Hi guys

Dave .. thanks a million for the extra info :-) , it is the appnote which is confusing me .. The values for R1 and C1 seem to arrive out of nowhere, unless I'm reading it wrong ?

Melanie .. thanks for the extra info too !
There ain't now way I'm gonna be measuring much after I've done the right calculations especially not when under a real load :-) ....or should I .. have you ? Have you taken pics? Video ?
And as for switch on , I will do it using a push-button and a broomstick ;-)

Kind regards

Dennis

Pic_User
- 29th December 2009, 21:32
This is an interesting idea.
Transformerless Power Supply of 1A at 5Volts!
Thanks to Ioannis!
http://www.picbasic.co.uk/forum/showthread.php?t=12249
-Adam-

Dennis
- 29th December 2009, 22:53
Adam Thanks for that :-)
Saw it when it was first posted ... I don't want to use a bride rectifier or transformer and 1 amp is way more that I need :-)

All I want the pic to be able to do is act as and intelligent switch

AC IN --->> PIC >>> LOAD

Make sense ?

Kind regards

Dennis

amgen
- 30th December 2009, 00:48
the capacitor reactance (resistance for ac voltage) is
1/(2 X pi X freq X Cap(micro-farad)) ohms,

for 50MA from power supply, 220V/.050 = 4400 ohms....
the required resistance provided by cap for 50HZ at 220V.

then,
Cap= 1/(314 X 4400) equal aprox .7 micro-farad cap (>250 VAC rated)
works out to about .15 micro-farad per 10MA.
See attached diag.

Dennis
- 30th December 2009, 02:48
Amgen

Thank you that's exactly what I'm asking for !

I have been through the appnote and what's confusing me is how you got he value for the resistor R1 ??
You said ....

the capacitor reactance (resistance for ac voltage) is
1/(2 X pi X freq X Cap(micro-farad)) ohms,

For 50MA from power supply, 220V/.050 = 4400 ohms....
the required resistance provided by cap for 50HZ at 220V.

How did you get the value for this ...
Cap(micro-farad)) ohms

Kind regards
Dennis

Melanie
- 30th December 2009, 09:32
Just Transpose the formula that you've got... if...

Xc=1/(2 pi F C)

then...

C=1/(2 pi F Xc)

Xc is the AC Resistance (Reactance) that you want in Ohms, C=Capacitance in Farads and F is the Frequency in Hertz.

Say you wanted 50mA at 110v 60Hz (way too high for driving a PIC and a TRIAC say for Lamp Control - more like 15mA required), then V/I=R (where in our case R is actually Xc)...

110/0.05=2200

So we know that Xc must equal 2200... therefore applying the transposed formula...

1/(2 x 3.14 x 60 x 2200) = 1.2uF

Theoretically, that's great... but practically you'll discover that Capacitors don't come in all the myriad of values that Resistors come in, so you probably only have easilly available 0.1uF, 0.22uF, 0.47uF and 1uF. Work out which one best suits your current requirements and design your circuit to match it. I would strongly discourage you from desgining Transformerless Power Supplies with Supply Capacitor values greater than 1uF.

Byte_Butcher
- 30th December 2009, 16:12
Melanie pretty much said it all, but there's schematics and math formulas for transformerless supplies in this Microchip appnote:

http://ww1.microchip.com/downloads/en/AppNotes/00954A.pdf



steve

Dennis
- 31st December 2009, 03:39
Hi all

Thanks to everyone for their help so far ..

Steve for the tongue-tip-test tip and for the latest one
but I am already referring to that document in post number 1 in this thread .. and that's the source of the confusuion.

Amgen thanks for the bridge-rectifier based sketch and formulae !

Dave Houston I will remain eternally grateful for the X-10 info pages and other links.

Adam those links you pointed me to where a great read and it seems I may have opened a can of worms with this thread ??

Dave, Mackrackit aka "CODE EYES" thanks for the forewarning and all the help thus far.

Melanie not only did you clear up my confusion regarding the calculation but have also given some fantastic tips to take into consideration which also triggered some more thoughts/questions.

So far I have the following calculated.

For 220V @ 50Hz to drive a MAX load of 30mA, I would need the following values (or have I messed up somewhere and is it just under 15mA?)

MOV(VDR1) = 275V
C1 = .47uF (suggested is X2 rated 275VAC based on other forums posts and internet sources)
R1 = 100 OHM (1/2 Watt)
D1 = IN4007

C2 = 470uF 25V (electrolytic)
D2 = 5V1 Zener

If all is correct, this output a half-wave rectified, smoothed 5V supply, right? If full wave were required I would need to a
If there are any further suggestions/changes I would appreciate them.

Is it true to say that the circuit ground 'hovers'(for lack of a better word) below HOT/LIVE and is not reference to EARTH GROUND and this is why all the warnings and danger signs ?

My questions are ...
(And while I ask I am busy reading/checking up on the following)

1.Whats happens when the circuit wants to draw more than max Ohms ?
2.How do I check the current draw of my PIC (assuming the PIC is standalone and not connected to anything other than power ?)
3. Once I start connectinng things like a push-button or triac or relay and perhaps an LED and maybe a POT for dimming, what would the ball-park usage start looking like and why ?
4.Which component is taking the most strain as the circuit draws current, is it C1 ?
5.Is C1 the current limiting factor of this circuit ?
6. I was thinking of using a BT139 Triac (since I have quite a few lying around), is it a good choice? I read that
7.What should the value for R3 be if I am to drive a triac ?
8. Is it feasible/possible to add a wireless TX module to the PIC circuit and if so what safegaurds (if any) like noise reduction should I put in place and where ?
9.In post #14 here amgen points out that we are looking at 0.15UF per 10MA and this seems to run true for both bride rectifier (full-wave) based as well as for the non-bridge based (half-wave) supplies. So the question is why choose to use a rectifier or not ? Is it cost ? Less of a smoke factor ? Space ?
10.To test the voltage on the output side could I just pop my good old Fluke meter on 5V and circuit GND with it set to read DC volts.
(and yes I will make sure I am insulated - rubber sole shoes, no jewellery, rubber gloves - hell I will wear a rubber suit if needs be!)
11. Are there any tips for connecting things up on the PIC side ?
12.And for taking measurements on the PIC side ? Apart from the app note SAFETY PORTION which refers to using an isolation tranformer.
Anyone have a schematic/block-diagram for measurements please?
13. Unless I am planning to use zero-crossing point to control the triac (can't think of a use right now, can you ? ) ,should I be concerned about zero-crossing issues as I have read somewhere that this circuit may cause slight delays in switching the load on or off based on Wattage and type either resistive or inductive) because the zero-crossing signal is phase shifted from the actual zero-crossing?

Oh and last but not least I can think of at least two applications that might be a no-no
1.Touch-sensitive pad(s)
2.ICSP
But what about things like USB or Connection to the PC serial port?
What sort of buffering or isolation would be required if is possible.

Apologies for the lengthy post and any questions which may seem obvious or silly to anyone reading this post (and the other posts too!)


Thanks once again

Kind regards

Dennis

amgen
- 31st December 2009, 12:56
Dennis,
Very through work !, and good questions.
Your diag had diodes in wrong places.
1) too much current draw will drop voltage to PIC to a point of no-operation,
thats why my ckt had 12V ZD and 5V reg, it provides smoother supply.
2)you have to insert DC ammeret (can be digital meter) in wire supplying PIC and other circuit.
3)Probably getting toward your 30MA, keep draws as small as possible, example---2MA led
4) C1 drops most voltage but most all parts are critical for operation
5)C1 is the current limiter, could use 600VAC rated part which is larger than say 250V part
-R1 developes heat by the amount of -- Current squared times Resistance
- also Z diode makes a little heat -----Z voltage times current through it (can measure or estimate
6) use an OPTO triac driver then any triac of the amps you need is OK
7) use 200 to 500 ohm to drive the triac driver depending on the opto chosen
8) consider added power used (more current) by added parts, within range of designed supply components
9) full-wave bridge makes use of pos and neg cycle of ACV, where 2 diodes only uses 1/2 cycle and the other 1/2 cycle is just wasted. bridge rectifiers come in dip package up to 1000 volts.
10,11,12,13,1,2))) If not using Z crossing, you could hook 10 or 20 volts from an ac or dc supply to test,adjust, ICSP then after all working hook to 110/220 power.
I think touch-sense sw's would be possible shock hazzard due to lack of higher voltage isolation, at some point Transformer isolation makes more sence.

I made some push-button 110V fan timers with this circuit, fits in wall switch box, never skipped a beat or burned one up, so I was addressing the same issues as you.

good luck,
don
amgen

mackrackit
- 31st December 2009, 15:45
Dennis,

Glad to see you are not jumping into this without asking the questions.
But by asking the questions I see you are not familiar with high voltage.
So it is a "catch 22" to learn how to handle it. This is one of the places where "self experimentation" could get you in trouble.

Make sure you have a low value fuse in the system.

I do not want you to end up looking like my avatar :D

Yes, I am getting to be an "old fuddy duddy"

Dennis
- 1st January 2010, 12:22
Hi guys :-)

Don thanks for the reply and update :-)

Your diag had diodes in wrong places.

Which diode is in the wrong place ??

Dave ....
Thanks for the tip .. just curious though ..fast blow low current fuses ?

Kind regards
Dennis

Melanie
- 1st January 2010, 12:26
Happy New Year Boys...

That's a very dangerous circuit you've posted Dennis.

What you've got is Vdd at LIVE potential, and Vss is just -5v below it. You've put all your voltage drop in the NETURAL rail. That means your ENTIRE low-voltage PIC circuitry is actually referenced against your HIGH VOLTAGE LIVE. Yes it will work, but there is no margin for error anywhere, because GROUND is (more than) 250 volts away...

If you look at other half-wave rectified circuits (posted on this forum), you'll notice that Vss (0v) is sitting at NEUTRAL, with Vdd +5v above it (with all the voltage drop being done in the LIVE rail). So, in that instance most of your PIC circuit is close to GROUND (since NETURAL and GROUND 'should' be connected together somewhere along the Power Grid to your Wall Socket). This makes it a damn sight 'safer' if you really want to play with mains. I use the word 'safer' cautiously - because playing with supply mains for folks that don't know what they're doing is not safe at all.

All the above is negated by the fact that some countries Power Systems allow users to plug appliances in either way around.

Now I'm going to get serious here. Your questions highlight the fact that you don't know what you're doing and you're asking the forum for advice on values of components and such. Read the Datasheets for the components you're using and determine if what you are doing is correct for the purpose intended. For example, the TRIAC Datasheet should tell you what Gate current it requires (your R3 question) to switch on. Because if ANYONE gives advice on a particular component or value, and you end up killing yourself, the liability falls onto the person that gave you the advice.

amgen
- 1st January 2010, 15:33
I would like to take a step back.........and agree with Melanie about this power supply danger.
Any possible touching or contacting of any parts of this circuit can cause serious injury!!! Leaving this circuit available for any person to contact in any way would be very negligent. Only persons with strong electronic knowledge should be working with this type of circuit.
Never want to see someone hurt.
df
amgen

Dennis
- 1st January 2010, 18:01
Hi All (Happy new year by the way :-) I hope it's a good and prosperous one for everyone!)

Melanie thanks for the clarity and tips again ,

So if we are using a 3 prong plug, (Three wire system)
then Brown wire is LIVE
and Blue is NEUTRAL
and YELLOW/GREEN is EARTH

The measured voltages are as follows
At the time I measured

Between LIVE and EARTH = 227.5 V (Readings may vary 235 to 225V (Varies based on time of day load etc) )

Between NEUTRAL and EARTH = < 1 V (May vary too!)

Between LIVE and NEUTRAL = 227.1 V

In most AC driven appliances where a mechanical SWITCH is used to switch
Either one of two switches are used (not so ?)
1.
ON-OFF
Single Pole, Single Throw = SPST

A simple on-off switch. This type can be used to switch the power supply to a circuit.

When used with mains electricity this type of switch must be in the live wire, but it is better to use a DPST switch to isolate both live and neutral.

2.
Dual ON-OFF
Double Pole, Single Throw = DPST

A pair of on-off switches which operate together (shown by the dotted line in the circuit symbol).

A DPST switch is often used to switch mains electricity because it can isolate both the live and neutral connections.

In at two wire system (2 prong plug) we are using LIVE and NEUTRAL


So....

In for the example of a PIR security light controller, the circuit draws its power from the mains , when the PIR detects a movement (PIC pin goes high) it opens the power to the load , in this instance it switches the light on (the light draws from the same mains power that the circuit draws from)
See the attached diagram..

So without creating a dangerous circuit how does one draw from the very same power that you are switching on and off (or dimming for that matter) ???

Melanie, what exactly are you suggesting to make it safe ?
You said ...

What you've got is Vdd at LIVE potential, and Vss is just -5v below it. You've put all your voltage drop in the NETURAL rail. That means your ENTIRE low-voltage PIC circuitry is actually referenced against your HIGH VOLTAGE LIVE. Yes it will work, but there is no margin for error anywhere, because GROUND is (more than) 250 volts away...

I agree it would be better to be 5V away from ground than 5v away from 250V :-)
You also said ...

If you look at other half-wave rectified circuits (posted on this forum), you'll notice that Vss (0v) is sitting at NEUTRAL, with Vdd +5v above it (with all the voltage drop being done in the LIVE rail).
[/QUOTE]
What keywords did you search on ? I tried transformerless and transformer-less as well as half-wave, and didn't find very much :-(
I did find some that you had suggested to others ...
Like this onehttp://www.picbasic.co.uk/forum/attachment.php?attachmentid=2669&d=1213285761
and this one
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=781&d=1139474240

In the cuits I have seen, not many actually depict how the PIC is to be wired for various operations.

You aslo said ...


So, in that instance most of your PIC circuit is close to GROUND (since NETURAL and GROUND 'should' be connected together somewhere along the Power Grid to your Wall Socket). This makes it a damn sight 'safer' if you really want to play with mains. I use the word 'safer' cautiously - because playing with supply mains for folks that don't know what they're doing is not safe at all.

I totally agree here
But how do you suggest I change the circuit to do that ?

Please check the attached (but no yet complete) updated diagram , what's missing here is the value for R2, R3 and the TRIAC stage (I plan to use a BT139F (see attached diagram) ..Is 01A correct ?
I did raise a question about it being correct.

I do understand the risks of the circuit and have been shocked before and why I am raising all these questions is because I would like to cover all the bases and not just dive into the deep-end.

And regarding the calculations and so forth , I last used most of them 20 years ago when I was studying electronics (and sadly it is not my full-time career!) so please forgive me for being a little rusty.
Electronics and PIC programming are a really fond hobby of mine which I recently re-kindled after a nearly 4 or 5 year break !

As regards the safety aspects ... thanks to everyone who has issues warnings here and all have been noted and considered.
I have a question though .. did you all encounter the dangers first-hand by a shock or was it from a warning from others ?
Was it that feeling of total shock and frustration (at yourself) when you opened the equipment to work on or look inside while ignoring the DANGER and HIGH-VOLTAGE warning stickers ?


I look forward to your responses be they critical, analytical or other :-)

Kind regards

Dennis

Dennis
- 1st January 2010, 18:18
Just to throw a 'spanner in the works' , if I do eventually use a transformer based supply like the dimmer attachment, what would be the smallest footprint 220V to 9V/5V transformer I could use ?

Kind regards
Dennis

Dennis
- 1st January 2010, 21:53
My questions ....

Are they perhaps profane , not correctly formulated, without direction , off-the beaten track, stupid ?

I realise there is google, encyclopedias, textbooks, etc. , but nothing can replace the power of human thoughts and minds !!

Is not our very nature to question how a system works and why ? When new technology is built or invented don't we find ourselves asking how it works ? How did someone think of that ?

Don't questions and discussions prompt new thoughts and ideas ?

In this instance I am asking for advice, information and thoughts regarding how others power PIC's and their circuitry.
I have not even attempted to build any such circuit yet and I have been researching this particular topic for two weeks already, gathering info.

Did the inventors of X10 and the likes of know all the odds before they started dabbling ?

What was life like before transformers?

Are there alternatives to transformers ?

I thank you all once again for answering some or most of my questions as well as for your concern for my safety !

I apologize for my lack of knowledge BUT I have a desire to learn more and I have found this forum to be the most interesting in this field thus far! Hats off to all of you !! THANK YOU!

So I have two options .. I recede back into cyberspace and lurk around in the shadows silently OR I summon the courage to ask the questions that other may/may not have thought of or asked before !

Thank you

Kind regards
Dennis

Pic_User
- 1st January 2010, 22:14
Hi Dennis,

Please continue to ask questions on this forum.

-Adam-

dhouston
- 1st January 2010, 23:06
Just to throw a 'spanner in the works' , if I do eventually use a transformer based supply like the dimmer attachment, what would be the smallest footprint 220V to 9V/5V transformer I could use ?One alternative would be to use a switchmode wall transformer that supplies regulated +5V. That way, it's external to your device and has minimal effect on the footprint.

dhouston
- 1st January 2010, 23:15
Did the inventors of X10 ... know all the odds before they started dabbling ?I'm sure they did as they had designed many other products before X10. They chose a capacitive supply because it cost less and had a smaller footprint. Their devices are enclosed in plastic cases so there's no shock potential. They also chose to make neutral their hot lead because they thought there was less noise near ZC (where they do their signalling) that way.


What was life like before transformers?DC all the way. That's how Edison started out. Tesla was the one who pushed AC.

Byte_Butcher
- 1st January 2010, 23:52
Just to throw a 'spanner in the works' , if I do eventually use a transformer based supply like the dimmer attachment, what would be the smallest footprint 220V to 9V/5V transformer I could use ?

Kind regards
Dennis

Dunno what the smallest available size would be, but I like these quite a lot for only $2.67USD each in 10 quantity:
http://ww2.pulseeng.com/products/datasheets/LT2007_04.pdf

I use 6 volt output... rectified and filtered it's perfect for powering a LDO to get 5 volts at up to 80mA.

Size is 22mm x 23mm x 19mm.

Small, cheap, safer than transformerless supplies, and able to produce plenty of current for powering a PIC + accessories.

For circuits where an "external" power supply (wall wart) is acceptable, I use these or something similar:
http://search.digikey.com/scripts/DkSearch/dksus.dll?vendor=0&keywords=T977-P6P-ND&stock=1



steve

Dennis
- 2nd January 2010, 00:21
Adam ..will do , thank you!

Dave thanks again definitely checking out the switch mode stuff too.
And agrred on the Edison and Tesla facts :-)

Steve.. thank you will check asap!
>> I think these look awesome .. so tiny ! Thank YOU

Melanie/Amgen(Don) , please check the updated Capacitive Transformerless AC-DC PSU diagram attached. Common neutral this time (correct me if I am wrong!)

So now the circuit should be floating 5 Volts ABOVE NEUTRAL and not 5 Volts below LIVE right ?

Kind regards

Dennis

anonymouse
- 3rd January 2010, 16:27
Adam ..will do , thank you!

Dave thanks again definitely checking out the switch mode stuff too.
And agrred on the Edison and Tesla facts :-)

Steve.. thank you will check asap!
>> I think these look awesome .. so tiny ! Thank YOU

Melanie/Amgen(Don) , please check the updated Capacitive Transformerless AC-DC PSU diagram attached. Common neutral this time (correct me if I am wrong!)

So now the circuit should be floating 5 Volts ABOVE NEUTRAL and not 5 Volts below LIVE right ?

Kind regards

Dennis

Dennis no its not safe, never never put a fuse in the neutral leg when it is at zero potential to earth. The fuse may blow the appliance looks like it is dead, somebody opens it up touches the phase/neutral, they could be dead. Try a transformer, that way you can sleep at night without worrying about the device killing somebody or smouldering away and catching fire.
all the best

Byte_Butcher
- 3rd January 2010, 17:18
Yep, like anonymouse said, fuse in the neutral is bad!

If you really *must* build a transformerless supply, goto the document I referenced in post #17, scroll down to page 10, figure 10 and build it just like that. They've already figured out the right way.

Correctly designed transformerless supplies are plenty safe, especially since the commercial devices that usually contain them are invariably well sealed in a well insulated (plastic) housing to keep curious fingers away. Lots of insulation between the device and the user is the key.

But most of my projects involve a lot of testing, fiddling, finger poking, and experimentation (with the guts open and exposed), so most of the time I much prefer a good isolated supply.
I buy little transformers 10 at a time for under $3 each and don't have to worry about what parts are "hot" when I connect my 'scope ground or poke at a part with my finger.

If the size and weight of your project is REALLY critical (but if you're sending it up in a rocket, it probably won't be mains powered), or if you're building a product by the 1000's where saving $1 worth of parts becomes a pretty big deal, then maybe xformerless is the way to go. But for most applications (especially hobbiest) I have to ask... Why? What's to be gained that offsets the risks?

So... why do you want a xformerless supply? What benefits does it have for your project?


steve

Melanie
- 3rd January 2010, 18:10
You're getting there...

Loose the Neutral Fuse as suggested.

Your Triac isn't completely wired... it's a three legged device. The LIVE goes through the TRIAC from the Supply Connector and goes out to the LIVE pin on the LOAD Connector. The NEUTRAL is common between the Supply and the Load, correct as you have it.

For those keeping an eye on this thread, if you use an isolated Supply for the PIC, it's low-voltage side will become LIVE the moment you connect it to the TRIACs gate. If you want your PIC to be isolated, then you will need an Opto-Isolator (or Pulse Transformer) of some sort between the Gate and the PIC.

Again, going back to an earlier question, yes, zero-cross is important - for many reasons (even if it's just to keep the peace with your neighbours). Go read up about it.

dhouston
- 3rd January 2010, 18:48
If you really *must* build a transformerless supply, goto the document I referenced in post #17, scroll down to page 10, figure 10 and build it just like that.Steve, isn't that the same document Dennis referenced in post #1 of this thread?

dhouston
- 3rd January 2010, 18:53
Dennis,

You might also find Microchip AN236 helpful. It has a capacitive supply, a ZC detector and a triac.http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en012050And there are more schematics of X10 modules on NASA engineer Dr. Ed Cheung's site.http://www.edcheung.com/automa/circuit.htm

Dennis
- 4th January 2010, 00:36
Hi All
I'm still busy trying to get my head around all the valuable info you have offered and definitely am taking the time to read through as much as my already overloaded mind can take !

Melanie and anonymouse thanks for the tip regarding the fuse on the NEUTRAL line :-) , I have updated the schematic to reflect only a single fuse on the LIVE line !
And thanks again Melanie for the info regarding the OPTO and the TRIAC,
the reason the TRIAC is open ended is because I have not decided what value to use for the TRIAC, since I think this may be dependent on the choice of PIC (and PORT) ? The designs I have seen so far seem to indicate somewhere between 470R and 1000R for the TRIAC resistor (R3 in my diagram).
Two things should me taken into consideration here :
1. the TRIAC gate currents (MIN and MAX)
2. the PIC pin allowable current
PLEASE CORRECT me if I am wrong!
In the meantime I am reading through this as a start!
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011202

What's of concern is that Microchip have made no mention (that I can see) of the differences between a COMMON NEUTRAL or COMMON LIVE design in the appnotes !!

Steve,thanks again for the tip especially for the transformer info ... READ the posts to date very carefully please... we have already established that the Microchip design is a COMMON LIVE design which 'floats' 5V below either 120VAC or 220/230/240VAC and that it would be a whole lot 'safer' to rather 'float' 5V above NEUTRAL, hence the changed design thus far.
Also as Dave pointed out, I did mention in post 1 that I would like to use a transformer-less PSU.

Dave .. thanks so much for the continuous valuable x10 references as well as the tips thus far.
That appnote sure has a lot of info and someone went through a huge amount of work to setup the application to get it to that stage I'm sure (especially looking at the section for the tuned circuit replacement of the usual x10 120KHz tuned transformers), is that mains injection being done purely with a resistor and a cap ?
I saw a project a few days ago where the designer is injecting a 135KHz pulse into the carrier and was wondering if that could be done with the pulsin pulsout command instead? Will see if I can find it for you since I think it may interest you as well.

Dave and Melanie (and anyone else)... regarding a zero-crossing sensor (which may be needed for dimming), where would you best situate it in this circuit ?
I have seen various designs indicating it in different places, and most have one of the PIC pins connected with a resistor in series directly to

For all those following this thread, please note that nothing has been built as yet and the attached schematics are merely used for the discussion.
Please also take note of ALL the safety warnings!

Thanks to everyone for all the info so far!

Kind regards

Dennis

Dennis
- 4th January 2010, 02:09
I have been reading through this appnote http://ww1.microchip.com/downloads/en/AppNotes/40171a.pdf and noticed the presence of two extra capsacitors namely C1 and C2 in the appnote schematic ..what is the function of these in this instance?

I have updated my design (see attached file) to include a zero-crossing sensor and have connected the TRIAC.
My concern is the value of the TRIAC resistor and that's the reason for the ???.
If there are any suggestions/concerns or changes to be made please let me know.

Kind regards

Dennis

Dennis
- 4th January 2010, 02:38
Forgot to attach the update.

While checking out various design for PSU's I noticed one person remarked that he might move the Varistor put the varistor after the 47R, so it doesnt have to short out the power station on spikes, same with the 20M resistor.
He also suggested he would not use a 20M but a rather an attenuator, say/guess 220K and 5k to ground.
Any thoughts around this statement ?

PLEASE NOTE - I have also added a WARNING for anyone who might stumble across this !!

Kind regards

Dennis

Dennis
- 4th January 2010, 02:44
Trying to attach the schematic again (renamed this time)


Dennis

dhouston
- 4th January 2010, 02:45
I saw a project a few days ago where the designer is injecting a 135KHz pulse into the carrier and was wondering if that could be done with the pulsin pulsout command instead?Search the forum for Anand Dhuru's posts on building his own X10 modules for 230V. I believe he is using the hardware PWM to generate 120kHz. Also, Darrel Taylor made some modifications to the PBP XOut command that might be of use.

Dennis
- 4th January 2010, 03:18
Hi all

Dave .. thanks once again for the extra info and tips :-) they always provide good reads and info :-)

Melanie,Steve and anoymouse...

While re-reading the Microchip appnotes, this one in particular

I noticed some interesting points...
Firstly this one regarding the current draw,

The PIC12/16/17 microcontrollers draw a maximum of 10 mA, even at the highest frequency and voltage of operation, therefore low current availability is not an issue. AC line voltage isolation can be addressed by using MOVs or transient suppressors on the PIC12/16/17.

and then something strange about the FUSE on the NEUTRAL LINE ???

In most applications, the output voltage should be reg-
ulated. Figure3 shows a diagram for a practical circuit
where a +/- 5V regulated output is generated. Note that
the neutral is connected to ground through a fuse. This
+5V
would guard against improper AC wiring.

Any comments on these statements?

Kind regards
Dennis

mackrackit
- 4th January 2010, 04:44
Where did you get the second quote? The one about the neutral.

Have you checked your local electrical codes about the proper way to wire something for the system you have? Might clear up the neutral thing for you. Here the ground and neutral are "bonded in the box" not at the device. I can not see yours being any different, I am sure you have a transformer with a center tap providing power to you.

BTW, you never said why you want to do this or what you think the benefit will be.

Dennis
- 5th January 2010, 01:13
Hi Dave

Thanks for tip, I was going to get eyes in on the local sub-station but will do so tomorrow ;-) and update as soon as possible :-)

The quotation is actually from a Microchip appnote TB008 , the paragraph is just above figure 3. in the appnote.
http://ww1.microchip.com/downloads/en/AppNotes/91008C.pdf

Ok the project is for the PIR-sensor based security lights, I need to tap into the PIR and replace the existing LDR and sensor circuit which are also transformer-less and triac controlled. Each sensor light PIC transmit back to a central PIC.

Given the space I have I cannot fit a transformer based supply into the housing or wall point (someone did a good job installing them) and there is no way I can mount the circuit externally.
So transformer-less it is !
I have seen circuits aplenty on the web yet it seems most are common live and also mainly for 120VAC it seems.
Some even with dual fuses (one on LIVE and one on NEUTRAL!)

So it seems there is quite a lot of confusion in this arena and for good reason I suppose, fear of death being the ultimate reason people shy away and of course once bitten twice shy(being shocked into submission certainly shys people away).

So my quest was to research the topic of transformer-less supplies before I dive into anything like building one only to encounter serious injury and the possibility of my circuit frying !

Nothing I have seen out on the web quite explains how one should wire things up on the pic if you're using a transformer-less PSU.
So appnotes are created and design note etc ... but the very simple steps seem to be missing, the questions (FAQ's) and their solutions.

So how do we find news ways of doing things if we are stuck designing only in the confines of a transformer-based supply.

In the early years I remember learning about the effects of capacitive, inductive and resistive circuits.
For example :

With a CAPACITIVE circuit, A current will flow through the circuit, first in one direction, then in the other.
No current actually flows through the capacitor. Electrons build up on the one plate and are drained off from the other plate in very rapid succession, giving the impression that the current flows through the insulator separating the plates.
However, a capacitor in an AC circuit does offer resistance to the overall current flow. We define a quantity called the CAPACITIVE REACTANCE, Xc,

In the designs I have seen, people place and swop around the components as the desire almost as though it's a little slap-dash design which may or may not work and your mileage may vary.

For example, I changed my original circuit design around to make it safer (which was a copy and make-up of the Microchip appnotes (or close to it ) , why would they suggest such an unsafe circuit I wonder ?
Then I keep getting told to use the Microchip designs ... yes I would love to but are they the safest ? And most if not all of them are for 120VAC without worked examples for 220V or 230V.
You may have already noted that there COMMON HOT(LIVE) and COMMON NEUTRAL transformer-less supplies.
So after having changed the initial part of the circuit to make it a common neutral supply , this raised more questions
what then? , what else needs to be changed ?
Are the diodes and other components correctly setup and placed the correct way around ?

And as regards the benefits... well
1. it is space saving,
2. is cost (the tiny transformers are extremely expensive here) and
3. is that I can go extremely small if I use SMD components not so ?

I have to put the same circuit in about 15 lights.
If you do manage to see a mistake please let me know.

Anyways that it from me.. I hope that exaplins it so far :-

Kind regards

Dennis

Dennis
- 5th January 2010, 01:47
Check out this power supply ..take particular note of the input side..

http://www.redcircuits.com/Page134.htm

Dave Houston this is the 135KHz injector I was referring to
http://www.redcircuits.com/Page56.htm

Enjoy

Dennis

Melanie
- 5th January 2010, 09:09
Back in Post #2 of this Thread you were directed to posts which had schematics. The discussion also continued as to what I thought of Microchips App Notes! The product had a production run of several thousand and many hundreds were installed in Hospitals (this I thought was a great idea, since if anything did go wrong, the punter was already in the right place to get assisstance). To my knowledge, in the intervening years, nobody's died and niether has the product, since we never did get any back for service. Looking at the schematic of that product, one end of the TRIAC was tied to NEUTRAL, the other went through the LOAD through a second FUSE (the first Fuse was on the Capacitive Supply to the PIC) to LIVE (you'll note the board had two Fuses). My Gate Resistor from the PIC to the TRIAC was 1K8 - but yours will depend on what your TRIAC's Datasheet tells you.


So how do we find news ways of doing things if we are stuck designing only in the confines of a transformer-based supply.

You go to school and learn the theory of what components can and can't do. You learn the math behind calculating component values. Then, and only then, you will have armed yourself with the knowledge that should stop you from doing something stupid. I've said this before - Darwin had a great theory of "Natural Selection", unfortunately every now and again, good people are also lost along the way.


3. is that I can go extremely small if I use SMD components not so ?

Prime example of lack of knowledge. SMD parts seldom come in high voltage ratings. By reducing the size you reduce the separation between adjacent connections... as a rough guide you need 1mm per 100v. Go pull the Datasheet on an 0805 series Resistor and tell me what the maximum voltage rating is!

Byte_Butcher
- 5th January 2010, 17:27
I was just curious if you could even GET a 0.47uF 500V cap in surface mount, so I did a Digikey search.
The answer is yes, but the only ones I found are ceramic and at $10.45USD each it makes those little transformers start looking pretty cheap.

In through-hole they're available in poly film for about $1 but they ain't particularly small.

I know the answer to Melanies question about 0805 resistor voltage rating. The Vishay parts I use are rated at 150 volts max...

Since you're working on a PIR project, have you seen these?
http://www.zilog.com/docs/devtools/PS0284.pdf
Serial interface to your MCU and can even tell whether something is moving left to right or right to left relative to the sensor. I bought a handful of 'em a couple months ago and am just starting to have fun with them.
I've got parts coming this week to do some serious play with them. Hopefully the UPS man should be bringing me my boards and parts on thursday. Woohoo!


steve

Dennis
- 5th January 2010, 23:53
Hi all

Melanie..

Regarding SMD, I have seen some designs showing SMD components placed after the rectification section section, is it a bad thing to consider SMD in a transformer-less design ?

The voltage ratings are 0805 = 150V and for 1206 = 200V it's quite a whack but not enough for the rectifying stage here.

Would you suggest I utilize that PSU degin you posted mentioned in #2 ?
Just curious as to why the MOV is placed where it is ?
EDIT **** OK I saw it in the forum post ..It's to accomodate for a weakspot at the the zener ****
Did you ever try replacing the 5V regulator with a 5V1 or 5V6 zener instead ?
Have you had any strange anomalies in the PSU's use ?
Have you had any blow?
Is there any ripple or noise encountered on the outputs ? The reason I ask is because I was wondering if it would be ok to add a wireless module to the circuit which the supply would power.

Steve.. the prices certainly are expensive and even for an X2 cap no surface mount !

Those transformers you found certainly are well priced !

Regarding the PIR sensors ...WOW and they do what they do at such a low voltage too ...awesome!
You could easily pack something like that into a matchbox or smaller and have it as a bed-side alarm !
Problem is that it would trigger every time either you or your partner moved in your sleep :-)

Will definitely be looking into those too !

Keep well

Kind regards
Dennis


-

Melanie
- 6th January 2010, 01:10
> Would you suggest I utilize that PSU degin you posted mentioned in #2 ?

I make no recommendations... use at your own risk after taking your own requirements and circumstances into account.

> Did you ever try replacing the 5V regulator with a 5V1 or 5V6 zener instead ?

No, because I was using the PICs ADC in my design, and wanted a closer repeatable tolerance and higher current than a Zener could provide.

> Have you had any strange anomalies in the PSU's use ?

None

> Have you had any blow?

No, the design is short-circuit proof and failsafe.

> Is there any ripple or noise encountered on the outputs ?

None beyond the design specification of the 78L05.

Byte_Butcher
- 6th January 2010, 02:23
Steve.. the prices certainly are expensive and even for an X2 cap no surface mount !

Those transformers you found certainly are well priced !


Yes, they're pretty reasonable... and now I notice that they come in an even smaller size!

http://ww2.pulseeng.com/products/datasheets/LT2007_02-04.pdf

13 mA @6V, with the same 22mm x 23 mm footprint as the others, but only 12mm high! With a SMD rectifier, regulator, and caps, it's probably not much bigger than a xformerless supply with it's big cap, MOV, and all the
rest.
I'm sure it's still a little more expensive. But maybe not much...



Regarding the PIR sensors ...WOW and they do what they do at such a low voltage too ...awesome!


Those are cute, aren't they? And tiny! I'm starting to use them around the house to turn LED "night lights" on and off. When I stumble into the bathroom at night there's enough lumens to find my target without having to fumble for a light switch. :)


steve

Melanie
- 6th January 2010, 09:14
The efficiency of a Transformer at 50/60Hz is dependent on the amount of iron in it's core... once you drop below about 1.5VA (which is just over an inch cube with an EI30 core) the amount of iron is so small that half the power consumption is used just to heat up the core and windings the efficiency plummets to only 50% or less.

boroko
- 6th January 2010, 09:32
Melanie, you never cease to amaze me with your practical grasp of such a wide range of issues.

You never know, keep it up and you might just have a future in this "electronics" thing.

Bo

Byte_Butcher
- 6th January 2010, 17:48
The efficiency of a Transformer at 50/60Hz is dependent on the amount of iron in it's core... once you drop below about 1.5VA (which is just over an inch cube with an EI30 core) the amount of iron is so small that half the power consumption is used just to heat up the core and windings the efficiency plummets to only 50% or less.

Well, I'm sure those little transformers aren't the greatest for efficiency, but I don't think the medium small ones (6v@83mA) I've been using are all that bad.
I've got one sitting here on the bench for days with a light (10-15mA?) load on it, and it's only barely warmer than it's surroundings. It can't be dissipating very much energy. Maybe one of these days when I'm feeling less lazy I'll attempt to measure the efficiency on one.
It certainly doesn't heat up like cheap chinese wall wart transformers do.

But how efficient is a xformerless supply if it's not "precisely loaded"? Input current is always the same regardless of load! And unless that fancy X2 cap is sized exactly to the needs of the circuit, it looks like that zener is gonna be dissipating a good dose of heat.

If your load draws a constant current and the cap is sized correctly I can see how it could be very efficient. If the load varies over a wide range as the PIC switches stuff on and off, but the power supply draws the maximum current all the time, then I don't see how that can be very efficient...



steve

dhouston
- 6th January 2010, 18:22
But how efficient is a xformerless supply if it's not "precisely loaded"? Input current is always the same regardless of load! And unless that fancy X2 cap is sized exactly to the needs of the circuit, it looks like that zener is gonna be dissipating a good dose of heat.I have measured several X10 modules, when idle, to see how much power they waste. It's not much. http://davehouston.org/x10-power.htm

Some of the highest use transformer supplies. SMPS tend to have the best efficiencies.

Byte_Butcher
- 6th January 2010, 19:43
Hmmm. 0.4 to 1.4 watts when idle sounds like quite a chunk to me.

Say, I've got a couple of Kill-A-Watt's lounging around here somewhere... I'll take one of these little transformers and put it to the 100 hour test like you did with the X-10 modules. :)

Edit: I just plugged one in and these little transformers, unloaded, show .02W and .09VA. I'll let it run for a few days and see how the watt-hours add up.

I kind of forget about the Kill-A-Watt's unless the grid power is down and I'm running on backup generator. Then I drag 'em out to keep track of voltage and frequency...

steve

Dennis
- 6th January 2010, 19:43
Hi All

This is turning out to be a very interesting discussion..(well at least for me anyway!)
If you look right the way back to the start of this thread I as asking for a little help regarding the calculations mentioned in the Microchip appnote 954.Plenty have been referenced and suggested since then, and thanks to all who have contributed!

To tie things up I wonder if we could start from scratch again and take a close look at (and discuss) the circuit as we build the circuit up in 3 stages.
Hopefully we could get to a circuit which is able to supply a PIC in the correct way and be as safe as an UNSAFE and DANGEROUS circuit could be.

And the stages are :
1. The mains supply stage up to where it becomes DC
2. The circuit-load stage (where we use the 'DC' portion to power the circuit
(a possible zero crossing detector here and LED and pushbutton)
3. The output-load stage (where a load is switched either by means of a relay or a triac.

To start the ball rolling I would like to draw your attention to the attached diagram which depicts the basic types of transformer-less AC to DC power supply.

Each has its own unique chartacteristics (see AC circuit theory study notes or Google them). Understand that there may be phase shifting to consider as well as the zero crossing (these two will not be discussed yet)

SOMETIMES you may need to power a low voltage circuit such as a

microcontroller with HV AC line current.

The basic steps would be to :

1. Use a reactance to limit the current,

2. Rectify the voltage with a diode (half-wave rectification or bridge
rectifier for full-wave rectification),

3. Regulate the voltage with a zener,

4. Add a large electrolytic capacitor to filter out the ripples.

Transformerless supplies don't offer isolation from the HIGH VOLTAGE

line and present a MAJOR SAFETY ISSUE. I will put all of the possible safety tips together in point form and outline the reasons why each one is used or practiced.

I would like to be using a transformer-less CAPACITIVE circuit with common NEUTRAL (although we still have not discussed the effect on the PIC pin and the triac when there is no load!!)

I have not drawn a fuse in the diagrams yet although it is generally agreed that it is a best practice to place the fuse on the LIVE line not NEUTRAL and also not have a second fuse for example one fuse on LIVE and one on NEUTRAL!

With this in mind please could you confirm the following calculations for 220VAC and 50Hz, max current would be +-30mA.
(check the appnote and posts #14 and #16 for the calculations(Thanks Amgen and Melanie))

Calculations as per Microchip Application Note 954 :
(Please note .. Microchip are using a COMMON LIVE example - I am still not 100% sure why)

NOTE - VOLTAGE is either 230V and 240V (RMS) see appnote for 120V


VRMS 230 240
VZ 5 5.1
C1 0.00000047
R1 100
Freq 49.5 50.1

Equation 4
IIN-Min 0.018482937 Amps 18.48 ma
IIN-Max 0.029218819 Amps 29.22 ma

Equation 6
PR1 0.199702245 Watts 0.399404491 Double Watt

Equation 7
PD1 0.217302793 Watts 0.434605585 Double Watt

Equation 8
PD2 0.020453173 Watts 0.040906347 Double Watt

Please feel free to check my values and comment back.

So at this stage all I would like is some consensus on the values calculated and the different types of circuit.

Can we all agree on this so far ?

Kind regards
Dennis

dhouston
- 6th January 2010, 22:00
Hmmm. 0.4 to 1.4 watts when idle sounds like quite a chunk to me.The 0.4 was the capacitive supply that really was idle; the 1.3 & 1.4 have superregenerative RF receivers which are never truly idle. The point was that capacitive supplies are not inherently wasteful.

Tle last 5 devices all use transformer PSUs as they have serial ports and require isolation.

Pic_User
- 7th January 2010, 03:09
More sites:
Step-down rectifier makes a simple dc power supply
[Electronic Design News]
http://www.edn.com/ednmag/archives/1998/040998/08df_06.htm
http://www.edn.com/ednmag/archives/1998/040998/08df_06.pdf

A Capacitor-Fed, Voltage-Step-Down, Single-Phase, Non-Isolated ...
http://www.grix.it/UserFiles/Powermos/File/Alimentatore-senza-trasformatore/SOKAL_acfvsdsp.pdf

+++++++++++++++++++ You may skip this part:

In my very best Rod Serling, Twilight Zone, imitation:

“Picture if you will; A man bent over his electronics’ workbench.
A man, with many decades of experience, working for a living, doing precisely what he is doing at this moment.
Analyzing an electronic circuit.

Not just any circuit, but a circuit made by X10.
A consumer circuit, brand new, just out of it’s pristine box, for the first time since it left the factory floor.
The device is powered through a two prong, AC, 120V (USA) power cord.

Only today, instead of analyzing the circuit to repair it, or analyzing it to modify the circuit, he is trying to learn something else.
He is attaching his multi thousand dollar oscilloscope to the X10 device, to find out how it works.
To learn the secrets of it’s communication wave form, if you will. (Rod Serling speak)
To SEE what is going on in this particular mysterious device.

He has done this countless times, to repair, to alter, to learn and to expand, on the knowledge gained by this analysis.

There is no schematic included.
The two wire cord lulls this “searcher of the truth”, into a false impression that the device MUST be isolated, MUST have a small power transformer, somewhere hidden from the casual observer.

Enter - The Twilight Zone:
He FAILS to notice, that there are NO outside connections needed, except the cord.
Just an all plastic case, with all plastic buttons. No jacks, no other cords, just a dead end for the power cord.
Cleverly designed by people who do this for a living.

Just a power cord attached to a plastic case with eight plastic switches.
The output for the device is really, signals going back down the power cord.
Signals riding on the 120V AC power line.
This is know but not thought about by the investigator at this time, overlooked.
He is not aware that this device is powered by a “transformerless” power supply.

With the standard, properly functioning oscilloscope, attached through a 100 times (100x) probe (for conservative safety), the examiner is ready to begin. He has carefully attached the probe, ground on the minus of the filter capacitor, probe on the plus of the low voltage supply.
He has done this, before he energizes the circuit, for obvious reasons.

He now, without the least hesitation, picks up the x10 power plug and plugs it directly into the 120Voutlet.

Also without the least hesitation, he watches half of the printed circuit traces disappear.
A loud bang, a bright flash, a lot of smoke are all that is left of that half of the circuit.

What does he do?
He doesn’t even examine the burnt x10. He knows what happened and why.
He unplugs the warm cord.
He wraps the cord around the unit.
He puts the burnt x10 switch back into its box.
He opens the second identical x10 unit box (an extra, back-up unit).
He opens the unit.
He places the oscilloscope probe on the identical place, only on the new x10 circuit board.
AND
He plugs the new x10 into 120V AC!

DE DE DE DE – DE DE DE DE (that’s Twilight Zone theme music, look it up)

NOT into the same normal AC receptacle, but INTO an isolation transformer. His bench-top isolation transformer.

He would have done this with the first x10 but he wasn’t paying attention.”

That inattentive investigator was... ME. This is a true story.
I had plugged the first (now ruined) x10 into the normal AC receptacle with the neutral side and the line side flipped.

This is why they make and we use line isolation transformers.
++++++++++++++++++++++

You should never service a transformerless supply without one.

-Adam-

mackrackit
- 7th January 2010, 03:33
Adam,

I am glad it was not a
Tales from the Crypt
rendition.

Pic_User
- 7th January 2010, 15:58
Adam,

I am glad it was not a
Tales from the Crypt
rendition.Hey Dave,
It might have been, “Tales from the Crypt”, is I was a little bit more careless.
Half of MY circuit traces could have been blown off, if I had touched the circuit board anywhere.
DE DE DE DE... (I gotta stop that theme music)
-Adam-

Dennis
- 7th January 2010, 18:05
Tales from the crypt indeed !

So who ended up shocked and who ended up de-lighted ?

And to create a shift in the TIME-SPACE CONTINUUM .......

You could try wiring LIVE and NEUTRAL across a single pole double throw switch making sure you have the correct current rating , place the project box on the floor making sure your friend is leaning over the box monitoring the power LED (Make sure the top lid of the box is removeable - all securing screws removed) THEN plug your procjet in with the wall switch in the OFF position and THEN ....using a broomstick and jokingly tell your friend it's for safety sake and THEN...from a distance flip the switch to the ON position.
RESULT :
1 X very surprised friend
1 X totally blackened pc board
1 X extremely well toasted and burned out SPDT switch (all ratings ignored) :-)

ISOLATION ISOLATION ISOLATION !

Now try to maintain proper stabilization of this channel without creating a situation of over-modulation

Steve, Adam .. are you guys kinda volunteering yourselves to be PSU testers for this one ??
Could we get captures for each stage of testing ? one cam on you and one on the circuit ?
....and the scene begins with a skull and cross-bones with a caption saying something like DON'T DO THIS AT HOME ?

Kind regards
Dennis

dhouston
- 7th January 2010, 18:33
To learn the secrets of it’s communication wave form, if you will.Simpler and safer is to use a stepdown transformer connected to the powerline and view the communication wave form through it. You don't even have to open the X-10 modules. A high pass filter passes 120kHz and blocks the 60Hz.

Dennis
- 7th January 2010, 19:01
Yes agreed or use a lower AC voltage at the same frequency running completely off the mains ?

Dennis

Byte_Butcher
- 7th January 2010, 20:49
Steve, Adam .. are you guys kinda volunteering yourselves to be PSU testers for this one ??

Me? Sure, I'll test it. I'm not afraid. I've got an isolation transformer and know how to use it. :)

I suppose one of my more memorable "120V bench accidents" was repairing an old radio that had the neutral connected to its metal chassis. And an old worn 2 wire cord that could plug in backwards in certain outlets.
I managed to plug it in so that the neutral chassis was actually a hot (120VAC) chassis. When I went to clip my scope probe ground onto the chassis, there was a brilliant flash and bang. I was dazed but unharmed, and the scope probe was destroyed.

Live(d) and learn(ed)...


steve

Dennis
- 7th January 2010, 22:31
Steve :-) ....
OK .. I actually un-voluntarily spat the sip of coffee out trying to suppress the laughter :-) and am still having a good chuckle ... laughing with you not at you!
I had a similar incident on an old Zenith CGA and EGA monitors whose chasis' was live/hot.
In order to get the colours and sync right one had to use a very long trim-pot tool , sometimes we had to improvise and use a long screw-driver because all of the trim-pot tools were out of the workshop in the field with other technicians to make matter worse we would place the monitor on a metal trolley with wheels.

With the right (wrong!) combination of screw-driver and hand grips and a kinda left-hand suzuki method I very quickly was sent hurtling with an ear-piercing yell across the workshop into the bench behind me knocking my mentor straight off his feet !

Well needless to say after the initial shock was over and it was established that I was OK, the entire workshop spent the rest of the day laughing to crack their sides. And I definitely feel quite wound up after that.

There's that statement in the Star Trek intro "to boldy go where no man (or woman) has gone before"
There are some options of course
"to boldly go where no man (or woman) has come back from before"
or
"to boldly go where men (and women) have come back from before"
or
"to boldly go"
finally ..."just don't go !"

Thanks for the offer .. would you like to try the circuits a few posts ago or would you like something more finished ?

Awaiting an episode of the unexplained now I think !


By the way this was an interesting find of yours..! Definitely puts and angle on things !
I was wondering all through the article where the bleed resistors where ... and then saw them and mention of them in the last few pages !


A Capacitor-Fed, Voltage-Step-Down, Single-Phase, Non-Isolated ...
http://www.grix.it/UserFiles/Powermo...L_acfvsdsp.pdf

Kind regards
Dennis

Dennis
- 11th January 2010, 23:03
Gee suddenly this thread has quietened down :-(

There were no explosions, no loud bangs , nothing that went bump in the night...
No loud bangs, nothing burned out ...!

I decided to go ahead and build the circuit for testing ... nothing worked initially :-( the LED which I had enabled to go high every 15 seconds didn't even come on :-(
I went over it again with a fine-toothed comb..and found my 100uF and 100nF cap were in the wrong places.

I had programmed my PIC outside the board of course (no ICSP implemented yet !!) the program simply blinks an LED(GPIO.5) this would tell me the PIC has voltage and there would be no need for voltage measurements and also sets the TRIAC gate (GPIO.0) to go high for 15 seconds and the low for 15 seconds.The TRIAC in turn turns on the light buld for the same amount of time.

After correcting the capacitor issue,I put my welding glasses on and a pair of earmuffs and I used a broom stick to flip the AC wall switch :-)
Well the LED came on ..YAY :-) but the connected light bulb sadly did not !
SIGH !
The I looked back at the the circuit schematic and the calculations and it dawned on me that the TRIAC gate current may not be enough.Initially I had just popped in a 1K 1/4 Watt resistor just as a placeholder in my schematic with the idea that it may or may not work.
I quickly flipped the wall switch off, unplugged the extension cord (yes that too !) and unplugged the circuit board (strip-board for now), I made sure not to touch the large caps while unsoldering the gate resistor (R3) and replaced it with a 390R one!

Again repeating the same steps, earmuffs etc,I once again powered on the circuit .....
And to my absolute surprise the light bulb came on then 15 seconds later it switched off and the LED came on ! So when the LED is ON the LIGHT is OFF and vice-versa !
WHY ?
How could both be set to come on at the same time ?
But YAY it works :-)
There is a slight flicker when the light buld is on and I'm thinking it may be the TRIAC resistor or ??? the mind wonders...!

So now I need to test more.
The questions now are :
1.Is it the TRIAC gate resistor causing the flicker ?
2. Are there any suggestions for the the value for R3 ? (Check earlier posts for BT-139 gate current values and specs.
3.Cap C1 value is 275V and I'm thinking rather to use a 400V rated X2 instead, any thoughts on this ?
4. What's a concern is in times of NO LOAD , what will life be like for the PIC control PIN and the TRIAC gate ?
5.Other options include using an opto-isolator (possibly a MOC3023 or 30XX) in conjunction with or stand-alone ..any thoughts ?

On a final note... Please note that the attached circuit design is merely for testing and discussion purposes and has NOT been completed nor cleared for safe use of any kind and is missing several safety elements like a FUSE, MOV and a parallel bleeder resistor across C1.
Also note that this is a HIGH VOLTAGE circuit and neither I nor anyone else posting on this thread assumes any liability which may arise from any aspect of the circuit and or its development and/or use.
Working with circuits like this one are HAZARDOUS and UNSAFE and could result in serious injury and/or death !
DO NOT build this circuit unless you have HIGH voltage experience, rather use a transformer based circuit which is isolated from the LIVE AC supply.
You have been warned!

Steve ... are you ready to measure ? ;-)

Any thoughts would be appreciated

Oh .. and last but not least a popquiz question... Am I using a COMMON LIVE design or a COMMON NEUTRAL design ...and why ?

Kind regards

Dennis

Byte_Butcher
- 12th January 2010, 02:04
Gee suddenly this thread has quietened down :-(

There were no explosions, no loud bangs , nothing that went bump in the night...


Gee, that's kind of anticlimactic after all the DANGER warnings, now isn't it?
No conflagrations = Congratulations. :)



The questions now are :
1.Is it the TRIAC gate resistor causing the flicker ?


Maybe. Honestly, I think I'd use an opto-isolator to drive the triac. But that's just the way I am...



2. Are there any suggestions for the the value for R3 ? (Check earlier posts for BT-139 gate current values and specs.


Refer to answer #1...



3.Cap C1 value is 275V and I'm thinking rather to use a 400V rated X2 instead, any thoughts on this ?


If your mains is 220V, then I 'd use a 400V rated cap. No way, on the 275V.



4. What's a concern is in times of NO LOAD , what will life be like for the PIC control PIN and the TRIAC gate ?


Not quite sure of the question here, but I think it goes back to answer #1



5.Other options include using an opto-isolator (possibly a MOC3023 or 30XX) in conjunction with or stand-alone ..any thoughts ?


Hmmm. Yeah, I think an opto-isolator would be good. :)




Steve ... are you ready to measure ? ;-)


Rat's, and I just sent my nomex suit to the cleaners and loaned my 10' insulated pole to my neighbor. :D


Say, don't you think it might be a good idea to put a small 5 volt zener from pin 5 to ground? I know that 1M is a pretty high value resistor and the PIC pins have some protection against over-voltage, but there's something kind of creepy about just connecting a PIC port pin to that high of a voltage, even through a big resistor. Probably no big deal, but it makes me nervous connecting that pin to 220v with just a resistor.


steve

Dennis
- 12th January 2010, 03:06
Hi all

OK 8 hours of flashing a 60W light bulb and no issues yet , Im feeling a little 'strobed-out' though :-), battling to decide to watch the light or the LED :-)

I'm also more keen on the OPTO , just wondering how it will survive the capacitive 5V floating circuit on the PIC side of things ... will explain more a little later.

Regarding the PIC for zero-crossing sensor , have you read the Microchip appnote 236a ? It should make you feel a little more confident , but I can try a diode if you like ?

Now about those screen caps and measurements :-) haul out that isolation transformer and scope and let's get some more info :-)
If you are curious and have the time of course ..

Kind regards

Dennis

Byte_Butcher
- 12th January 2010, 04:07
Regarding the PIC for zero-crossing sensor , have you read the Microchip appnote 236a ? It should make you feel a little more confident , but I can try a diode if you like ?


Nope, haven't read it. But I will in the morning.
But if it's OK with the folks at Microchip, then I guess it's OK with me. :)

I will read the appnote tomorrow... zero crossing detector is one of those things that will come in handy for me someday.

steve

Dennis
- 13th January 2010, 00:09
Hi all

Steve ...
Also check out the posts by Dave Houston regarding the x10 info ... they have indeed been using an MCU's for many years and I recall seeing a post or two by Dave referencing certain models in particular even a PIC 12XXXX if I'm not mistaken.

You could also always conduct AC testing on low-voltage 'downlights' (not sure what you call them in the US or Europe ... ?

Keep those posts coming , this is a very interesting thread so far :-)
Oh and see post 66 (clickety clicks :-) )

Oh .. and last but not least a popquiz question... Am I using a COMMON LIVE design or a COMMON NEUTRAL design ...and why ?

Kind regards
Dennis

keithdoxey
- 13th January 2010, 00:20
Oh .. and last but not least a popquiz question... Am I using a COMMON LIVE design or a COMMON NEUTRAL design ...and why ?


Common Live so that the triac is switching the live supply to the load.

If the circuitry was common neutral then the triac would also be switching neutral with the result that the entire load would be live when the circuit appeared to be OFF.

Pic_User
- 13th January 2010, 13:35
I had programmed my PIC outside the board of course (no ICSP implemented yet !!)Hi Dennis,

Great work so far. Let us know how things are going.
Especially how the ICSP works out, on the non-isolated circuit board.
This has turned into an interesting thread. A mix of past and future adventures in electricity land.
I really like the guys telling (on themselves) about the mishaps that have befallen the adventurous types. That is how we learn. Sometimes just being told carries little weight.

Oh .. and last but not least a popquiz question... Am I using a COMMON LIVE design or a COMMON NEUTRAL design ...and why ?Good question!
I would guess the answer is: It is either a “COMMON LIVE” design OR a “COMMON NEUTRAL” design depending upon whichever way you happen to insert the plug. Why? Because “Sometimes just being told carries little weight.” :)

Keep us up to speed on this “excellent adventure”. Your posts are a great mix of adventure, work, learning, teaching, doing, telling, asking and just plain fun. –Adam-

Dennis
- 13th January 2010, 21:19
Hi guys
With reference to post #66 and the rest that follow and everything else prior to it.

Interesting indeed !

Keith ..AWESOME reply!

I agree with you here

triac is switching the live supply to the load.

Ok now for the beginning of the mystery and to add to this threads confusion you added this in :-)

If the circuitry was common neutral then the triac would also be switching neutral with the result that the entire load would be live when the circuit appeared to be OFF.
So from that statement we should assume COMMON LIVE is the supply of choice (in terms of being a little safer) not COMMON NEUTRAL ? Assuming of course that this circuit is indeed a COMMON LIVE circuit ?

Any comments on the above statements ?

Steve ....

Nice...! You threw in another side-winder, in fact, you mentioned something very real !
A two prong(pin) plug in most countries (correct me if I'm wrong ?) is easily reversed , in other words pluged in the other way around .. both sides same sides kind of thing so if I decide to design my PSU with the left prong as LIVE and the right prong as NEUTRAL .. all fine and dandy but then I unplug the device, put the pulg into the wall socket the other way around and suddenly everything is changed around :-)
Does this mean I should re-design my whole circuit ?
UH OH !

Well I encountered this dilemma a few nights back ... just before I got the broomstick, earmuffs and rubber gloves out and got all kitted up, I thought "Gee on this two-prong plug what happens when everything turns around ?"
"Will the circuit blow? What will the effect be? Will I need to change everything?"

So it works , turned either way around ! ( AC @ 50 Hz hmmm? )

And ..on the safety side is this circuit any less dangerous than a lamp that takes a bayonet or screw in light bulb ? Let's face it there is 110/120VAC or 220/230/240VAC right at the contacts where you screw the light in , not so ?

What about the computer AT form not so long ago which had mains voltage right at the front panel pretty much like may household appliances,TV's and radios before soft-power switches became the flavour of the day.

OK my next mission would be to alter the circuit so that the 'circuit ground' is the LIVE line in the schematic but .. do I really need to ?

Awaiting more comments and thoughts :-)

Oh and the question still remains ... is the circuit in post # common live or common neutral ? and why ?

Kind regards

Dennis

keithdoxey
- 13th January 2010, 22:23
Keith ..AWESOME reply!

So from that statement we should assume COMMON LIVE is the supply of choice (in terms of being a little safer) not COMMON NEUTRAL ? Assuming of course that this circuit is indeed a COMMON LIVE circuit ?


Living in a country where every mains outlet is a 3 pin socket so polarity reversal is impossible unless the actual outlet is incorrectly wired I would say that common live *should* be the supply of choice particularly if the load it was controlling was external to this box of tricks so that it would be recieving a correctly switched supply.

Irrespective of supply polarity, becuase this circuit is tied directly to one leg of the mains supply it should be totally enclosed and should never be worked on except via an isolation transformer.

All "basic" light dimmers have a common live supply as they are only connected to the live and load.

Dennis
- 14th January 2010, 00:15
Hi again

Nice one keith ...safety and isolation for sure! Have you read the earlier posts ?

Living in a country where every mains outlet is a 3 pin socket so polarity reversal is impossible unless the actual outlet is incorrectly wired I would say that common live *should* be the supply of choice particularly if the load it was controlling was external to this box of tricks so that it would be recieving a correctly switched supply.
And those plugs quite often contain fuses (probably on the LIVE) not so ?
And the looking at the APPNOTE that I referred to in post #1 under the designing for safety heading you would see the fuse placed on one of the lines as well as a fuse and a bleeder/'safety' resistor sitting parallel with C1.

Now let's chat about the 2 prong device that need to be plugged in the countries you're referring to.
We need some sort of adapter to plug the 2 prong device into the 3 prong plug right ? Does th adapter contain a fuse as per country electrical regulations (if any ) ?
So again plugging a PSu like this one into the adapter, one can plug in either way ... and yet again NEUTRAL and LIVE are switched around (in the circuit of course)!

If this indeed is the case then we are right back at the million dollar question
"Is this circuit Common LIVE or COMMON NEUTRAL ? And why ?"

And then we must look at the designing for safety aspects where we discussed fuses.
One of the original draughts had two fuses , one on each line, and a point or two were raised about one of the fuses (the one on the neutral line) would be pointless. Yes indeed it probably would be useless as well as unsafe ...IF this circuit contained an earth(real ground) !
But alas, the circuit has no earth point or connection at all !

SO it seems this circuit will always 'FLOAT' either at 5volts(or whatever you designed it for) below live or 5Volts above neutral.
In earlier posts I showed circuit diagrams of common live and common neutral from various references.Circuits with components changed around, in different places forcing flow in different directions.
Are these circuits incorrect ?

Sadly I don't have an oscilloscope or an isolation transformer at my disposal anymore but I certainly will check/test/build blow-up each circuit depicted and feedback so we can continue this discussion.

Anyone feel like building a calculator to calcualate the APPNOTE referred to in post #1 and/or the circuit in #66 ?

Regarding the 'BOX OF TRICKS' you mention ...

If all of you that are following this post have some time , go and google for 'Ben Franklin flyng a kite in the rain with a key tied to the string' to attract lightening strikes.

And then along the lines of safety and climate change try google H.A.A.R.P.

Sure... why not try heat the ionosphere at it's thinnest points at the poles to blow a hole in it just to see what happens .. now that's safety for all mankind not so ?

All thanks to folks like Tesla, Franklin and ...aaargh let's not go there!

And is the H.A.A.R.P experiment over ... well apparently (will we ever really know?), but google earth and satellite pics show the facility plain as day !

Oh well at least we can get answers about the PSU circuit :-)

Kind regards
Dennis

Dennis
- 19th January 2010, 22:44
Hi guys ...
Why so quiet ?

Just a quick post to let you all know I'm still around ... no explosions, shocks or fire yet !
The test PSU is still working...
I got busy with real work suddenly and haven't had a chance to experiment more :-(

Will definitely update on the weekend !

Kind regards

Dennis

boroko
- 25th January 2010, 06:47
In case some of you didn't see this in another thread.....
www.picbasic.co.uk/forum/showthread.php?t=2736

any news on the code from Kamikaze47, seems to have disappeared.

You are right. Last seen, June 2006.

You expect to see people disappear from threads labeled:
Interfacing AC power lines....
...transformerless DC supply...
How to design without opto-couplers ...
How to measure high voltage while standing in a bucket of water...

But not from a thread labeled, “AT/PS2 Keyboard - PIC Interface?” ?

Then again we have to consider his user name!
Kamikaze47 where are you??

mackrackit
- 25th January 2010, 11:04
http://www.picbasic.co.uk/forum/showthread.php?t=12506
???

Pic_User
- 25th January 2010, 16:02
You are right. Last seen, June 2006.

You expect to see people disappear from threads labeled:
Interfacing AC power lines....
...transformerless DC supply...
How to design without opto-couplers ...
How to measure high voltage while standing in a bucket of water...

But not from a thread labeled, “AT/PS2 Keyboard - PIC Interface?” ?

Then again we have to consider his user name!
Kamikaze47 where are you??
Bo quoted from the past: 30th March 2007, 14:10, not currently.
Kamikaze47 has been back many times since the original posting.
See also Melanie’s hilarious post (standing in a bucket of water) #33 two below this quote!
http://www.picbasic.co.uk/forum/showpost.php?p=35490&postcount=33
-Adam-

Dennis
- 25th January 2010, 21:21
Deafening silence defined is :

'A silence or lack of response that reveals something significant, such as disapproval or a lack of enthusiasm'

Bo ....



You expect to see people disappear from threads labeled:
Interfacing AC power lines....
...transformerless DC supply...
How to design without opto-couplers ...
How to measure high voltage while standing in a bucket of water...

But not from a thread labeled, “AT/PS2 Keyboard - PIC Interface?” ?

Then again we have to consider his user name!
Kamikaze47 where are you??

Definitely some valid chirps :-) apparently apparitions do re-appear and it's not all smoke and mirrors :-).
Now I'm wondering if you have are planning to interface and AT/PS/2 keyboard to the AC mains line that delivers a different 'ZAP' at each keypress ?? Could it be solar-powered or we gonna just stick to the original hookup to directly the substation on 3-phase ?

The silence in this thread has me a little worried too since i haven't seen Steve around since I asked about some possible measurements (In the post before he said he wasn't to do a few measurements 'cos of his trusty isolation transformer ), I haven't seen any activity on this thread from him since then.
And all of a sudden this thread went extremely quiet...!

Shocking I tell you !

Kind regards

Dennis

Byte_Butcher
- 26th January 2010, 02:11
Hey Dennis!
I'm still lurking about, but it seemed like you have things under control and I don't have a whole lot more trouble to stir up.... :)

Besides, I've been seriously swamped with work obligations, family obligations, personal projects I'd like to complete soon, and now we've had a LOT of rain here in the last couple of weeks and I've been spending some time keeping our steep hillside property under control. Been spending a lot of my free time with a shovel, cleaning ditches and culverts and keeping 800 feet of gravel driveway (with 140 feet of elevation gain and 2 switchbacks) from blowing out....

I figured to just take care of chores, quietly watch the forum, and wait for your final schematic and report. :)

Do you really need some measurements from me? If you've got something specific in mind I'll see what I can do. But you seem capable enough and pretty well in tune with the safety issues...


steve

Dennis
- 27th January 2010, 23:00
Steve

No prob's at all ...
Two things :
1. Hadn't heard from you so I was a little concerned
2. Regarding the measurements .. was taking a deep dig 'cos I saw you got a new 'scope :-)

Well that's a mighty kind offer :-) and I would love some waveform captures from my PSU since I don't have a 'scope anymore .. but no stress at all , will pop down to a friends spot to get those :-) but only once I have built the others ...at the moment time is an issue
Will be posting some results and more info soon ..watch this space !
Keep well

Dennis