Transformerless power supply problem

#1
Hi, i am trying to make a remote controlled light switch. I made a transformerless power supply circuit for my 08m2 mcu. And i have destroyed 5 of them already. When ever I power the circuit the mcu doesn't work anymore. I program that using other board. It seems like a high voltage spike destroys it. And i don't know where that comes from because i am using lm7805 regulater for mcu. I will try to attach the circuit bellow. Can anyone give me a suggestion please
 

hippy

Technical Support
Staff member
#2
We would definitely not recommend using transformerless mains power for a PICAXE or anything else.

People can easily kill themselves, cause fires and destroy equipment if they do not know what they are doing, do not understand the risks with transformerless supplies, do not know or follow the precautions required when working with or using such a supply or when connecting circuitry and external items to them.

If the zener is intended to limit the supply voltage into the voltage regulator it appears to be the wrong way round and there may well be more wrong with the circuit.

It is an area where if one does not know what one is doing, or needs to ask questions, it is not an area they should be working in.
 
#3
As above.

This is positively LETHAL for a home-made project. There are so many things that could go wrong and kill someone that it is an incredibly bad idea to even think of building such a project for use in a household environment, especially with the added risk of the high UK mains supply voltage.

There are extremely good reasons why most mains powered equipment is now double-insulated and uses total isolation between the line connection on the mains side and the low voltage supply, and those reasons are very much to do with the prevention of a multitude of failure modes that could cause injury, death or the risk of fire.

I have built many mains powered Picaxe projects, but all use double insulation and I refuse to document many of them here because I would not wish for someone to fail to understand the importance of some of the safety provisions that were designed-in and therefore build something that could kill them.
 

premelec

Senior Member
#4
@shah_siddiquee - With all the inexpensive and available _isolated_ 5 volt plug power supplies why would you even consider this circuit - you've already cost yourself more in PICAXEs than the power units would cost.... Please don't kill any more PICAXEs or possibly people using the equipment you make... thank you...
 
#5
I'll add my concern to the list. "Plug Packs" or "Wall Warts" are available very cheaply in stores in your own country. Don't try to save a few dollars/pounds by buying directly from China, either (eg fleabay) - there have been far too many sub-standard ones discovered. Buy locally and you will be covered by your local laws.

Think of the consequences of something going wrong with a sub-standard or unapproved power supply. If you survive but injure or kill someone else, you will have to live with that for the rest of your life.
 

erco

Senior Member
#6
@shah: Per others here, you answered your own question. :)

Don't bother killing any more innocent Picaxes, wall warts are cheap, plentiful & safe.
 
#7
As someone who works with high voltage with vacuum tubes, and various things I've build requiring high voltage past 2kv I'll reiterate not to mess with non-isolated mains voltage. You can easily get small transformers to go from mains to 5v and rectify that. As others have pointed out there's plenty of readily available means to get 5v safely.
 

rq3

Senior Member
#8
Hi, i am trying to make a remote controlled light switch. I made a transformerless power supply circuit for my 08m2 mcu. And i have destroyed 5 of them already. When ever I power the circuit the mcu doesn't work anymore. I program that using other board. It seems like a high voltage spike destroys it. And i don't know where that comes from because i am using lm7805 regulater for mcu. I will try to attach the circuit bellow. Can anyone give me a suggestion please
At a quick glance, I can see seven (7) errors in this circuit, even without doing a min/max analysis at the component level. It won't work, and if you do get it to work, it will be wickedly unsafe. And when just one of the multiple failure modes occurs, it will kill you.
 

PhilHornby

Senior Member
#9
Shocking!

Out of idle curiosity, am I the only person to have a had a shock from the 240VAC mains in the pursuit of my hobby? :confused:

Or just the only person to admit it? :eek:

Since I first started tinkering in the early 1970s, I must have inadvertently electrocuted myself a dozen times :(

Like falling off motorcycles, there's little to recommend it - but I've always thought it just "goes with the territory" ...
 
#10
I did it once back in the 70's.

Forgot to put the scope through the isolating transformer 1st before working on a live chassis TV.
Eth from scope lead in one hand, TV chassis in the other !!!.
I was out cold for about 10 seconds - phew that was close.

Learned my lesson though, never done it since.

In fact I still have that same 500w isolating transformer, rarely use it now though as I don't work on non transformered mains stuff now.

Neil
 
#11
Phil, The fact that you're posting shows how lucky you are. I'm not suggesting that I'm superior, either: I, too, have given myself a couple of 240VAC mains shocks. The fact that I'm still here also shows how lucky I am. As you say, there's little to recommend it.

Those who have died by electric shock are not alive to write about it. Three people that I have known have met an untimely end via mains voltage - they were the unlucky ones.

I think we have a duty to warn those who are unaware of the risk they are taking. Like eating fugu, we should not "normalise" mains shocks as a rite of passage or an acceptable risk.
 

Circuit

Senior Member
#12
Out of idle curiosity, am I the only person to have a had a shock from the 240VAC mains in the pursuit of my hobby? :confused:

Or just the only person to admit it? :eek:

Since I first started tinkering in the early 1970s, I must have inadvertently electrocuted myself a dozen times :(

Like falling off motorcycles, there's little to recommend it - but I've always thought it just "goes with the territory" ...
I think it is very important to emphasise that whether one is "electrocuted" or just the recipient of an "electric shock" is not a matter of luck but of the current pathway. A mains voltage across two fingers of one hand is unlikely to cause death; a mains voltage from hand through to the other hand goes through the heart and this is very likely to cause death. Similarly, a current pathway from hand through thorax and out of leg is likely lethal. Dry skin, dry clothing, plastic-soled footwear and a brief touch may just shock but it is the variability of the circumstances that determines the outcome. Please do not dismiss the danger so lightly as "it just goes with the territory"; you have simply been fortunate that the current pathway has not been lethal in each of your accidents. You cannot always be so fortunate. Remember also the effect of muscle action; if you gripping an uninsulated tool when you hit the current your muscles will spasm and you will not be able to release the current source; that is why, when attending a victim of an electrocution, one has to ensure that current is no longer flowing before attempting to assist. If I may say, sir, you treat the matter somewhat flippantly.
 

PhilHornby

Senior Member
#13
Remember also the effect of muscle action; if you gripping an uninsulated tool when you hit the current your muscles will spasm and you will not be able to release the current source.
Yet, the first shock I remember getting was from one of these. I'd forgotten to pass the mains flex through the top of the plug, so couldn't screw it on. However, I couldn't resist a quick test, before I sorted it out, so pushed it into the socket, while holding both pins in one hand. With hindsight, switching off the mains first would have been a very good idea!

him as well said:
If I may say, sir, you treat the matter somewhat flippantly.
You may say whatever you wish - I have a thick skin :p
 
Last edited:

rs2845

Senior Member
#14
What's the need for a transformerless circuit? I don't think I have ever come across a transformerless AC-DC supplied appliance.
 
#15
Out of idle curiosity, am I the only person to have a had a shock from the 240VAC mains in the pursuit of my hobby? :confused:

Or just the only person to admit it? :eek:

Since I first started tinkering in the early 1970s, I must have inadvertently electrocuted myself a dozen times :(

Like falling off motorcycles, there's little to recommend it - but I've always thought it just "goes with the territory" ...
I must have had dozens of mains shocks over the years, each has made me just a little more cautious. The last was when working on a live consumer unit, when my knuckle brushed the edge of a partly insulated buss bar. Painful, and another reminder to be more careful, but I pretty much always wear rubber soled shoes and work one-handed when working on live kit, something I picked up when young and working on old valve radar systems (I asked my boss why everyone only worked one-handed - he explained that it turned the risk of electrocution into one of just getting a shock).

There's also a lot of variability between people, when it comes to whether or not a nasty shock ends up as another electrocution (electrocution being death by electric shock). My brother, for example, has dry skin and an extraordinarily high skin resistance most of the time. His party trick was to poke his fingers in light fittings to see if they were live - he could just feel a tingle from 240 V AC. On the other hand, if I make good contact with a live terminal it chucks me across the room - my skin resistance is normally quite low, so a significant current flows, and it's the current that does the damage; the old saying was "it's volts that jolts but mills that kills" (meaning milliamps of current - about 40 to 60mA across the chest will kill, usually).

Getting back to this capacitive reactance dropper circuit, the problems start with the type of capacitor. It has to be rated for the ripple current, have a self-repairing dielectric insulation layer and have over-voltage protection on the load side in case the load goes open circuit. That's just to keep the circuit working, not make it safe. To make it electrically safe requires that all the circuitry be double insulated, which means all conductive parts must be insulated in addition to being wholly enclosed within an insulated case. To prevent it being a fire hazard means adding a suitable fuse, making sure all the materials are non-combustible (or at least non-combustion-sustaining), including the insulation and the case. Cooling needs to be provided for the dropper capacitor, as if that runs hot it is likely to fail, and cooling introduces the possibility of access through the outer insulation layer, so needs something like barrier slots in the case (to reduce the chance of anyone poking something conductive through the ventilation slots/holes).

By the time all the required safety provisions have been added, it would be a great deal cheaper, quicker and easier to use a properly certified low voltage power supply....................
 

PhilHornby

Senior Member
#17
How about PIR Security Lamps and Remote Controlled Lamp Dimmers
To which I would add: Ceramic Hobs, Central Heating Controllers, Energy Meters and Night Lights.

There's also a lot of variability between people, when it comes to whether or not a nasty shock ends up as another electrocution
I think there must be - I've always been genuinely perplexed by the difference between the dire warnings I read and my own experience.

him as well said:
To make it electrically safe requires that all the circuitry be double insulated, which means all conductive parts must be insulated in addition to being wholly enclosed within an insulated case. //snipped//
By the time all the required safety provisions have been added, it would be a great deal cheaper, quicker and easier to use a properly certified low voltage power supply....................
The thing is though, a lot of the commercially available kit that uses such supplies aren't built to anything like the (laudable) standards you describe. If you re-purpose a Wall-wart from a reputable manufacturer, you're probably quite safe - but a cheap, Chinese, ebay-special then maybe not. The ones I've looked inside have been devoid of fuses, thermal protection and double-insulation. They could imbue a misplaced sense of confidence...

(Starting fires with my creations, is one thing I do worry about! Over the years, I have seen more than one wall-wart start to emit acrid smoke. Curiously, these were in the days of lower-tech PSUs containing transformers. )
 
#18
The thing is though, a lot of the commercially available kit that uses such supplies aren't built to anything like the (laudable) standards you describe. If you re-purpose a Wall-wart from a reputable manufacturer, you're probably quite safe - but a cheap, Chinese, ebay-special then maybe not. The ones I've looked inside have been devoid of fuses, thermal protection and double-insulation. They could imbue a misplaced sense of confidence...

(Starting fires with my creations, is one thing I do worry about! Over the years, I have seen more than one wall-wart start to emit acrid smoke. Curiously, these were in the days of lower-tech PSUs containing transformers. )
Some Chinese stuff is very, very seriously scary. I've seen some real horrors, but some of the post-mortems on Big Clive's YouTube channel are worth a watch. He exposes some positively lethal non-isolated stuff, including LED lights in GU10 housings with a capacitive dropper. Great, as with the GU10 arrangement you have no way of knowing which pin is line and which neutral, and the neutral (which has a 50/50 chance of being line) is connected to the alloy case/heat sink, that can easily be touched as it forms the surround to the light.
 
#20
Even understanding it, I won't use that method. Isolation is your friend with mains. Small transformers from mains to 5v are all over the place. You can salvage one from an old charger. You can make one, but to be honest there are abundant 5v supplies on the market and they'll be cheaper than what you pay for the parts to make them.
 

Goeytex

Senior Member
#21
Microchip provides working circuits for several transformerless power supplies in Application Note AN954. These are intended for use with microcontrollers but are generally only good for about a 20 mA load.

I have seen similar circuits in older Microwave Ovens where the board is out of reach (safety), but I can think of no good reason to use any of these circuits in a hobby microcontroller circuit design. The inherent danger, current limitations, inefficiency, and poor regulation make them a very bad choice in most applications.
 
#22
Poor (young?) shah_siddiquee is probably still hiding under his bed :)

shah_siddiquee, you're not bad, just playing with a bad idea. As you can see, there is a lot more to transformerless supplies than the circuit. I'd prefer to have you as an active forum member than to disappear from the forum without trace.

Peter
 

fernando_g

Senior Member
#23
Ipete;
You beat me to it.
On the many electronic forums on which I participate, I see requests for transformerless supplies all the time. And by the description they provide, one can tell they (mostly) are complete newbies to electricity.
They also get their beating by seasoned posters. But nobody is judging them, only a bad circuit idea.

I believe that capacitive LED power supplies are the XXI-century equivalent of the all-american five tube radios. https://en.wikipedia.org/wiki/All_American_Five
I got shocked more than once by them, and I'm still around. Granted the voltage is only half.

As a matter of fact, the very first project which I made AND worked, was an AAF-equivalent audio amplifier. In those days, music came from turntables, and one could get a nasty shock handling the tonearm, which would ruin both your day and the LP you were playing.
My workaround to avoid that I added a neon light between the turntable's chassis (which was physically grounded to reduce hum) and the amplifier chassis. If the neon lit up, one had to reverse the plug.
 
#24
I agree, I do hope that shah_siddiquee isn't put off or offended by all the critical comment about these supplies.

I agree wholeheartedly with your post, fernando_g, and remember similar radio and TV sets we had over here that had a live chassis. We also had a pretty lethal mains power system here, with unfused plugs, plus it wasn't uncommon to have no earth connection to appliances. I can remember my mother standing on a chair to plug the electric iron in to the ceiling pendant light fitting, with a two core cotton insulated cable wired to an adapter!

Over the years we've massively improved electrical safety in the home here, and probably also in the USA and other Western countries, but it's clear that other countries are still back where we were in the 1950's when it comes to electrical safety in general, and with the advent of the internet and personal global trade it is easy to buy items that are intrinsically bloody dangerous.

As it happens, I ordered some small "12V" lithium battery packs from a reasonably reliable Chinese vendor, that has an EU-based warehouse (Banggood). I didn't want the mains chargers they came with, just the battery packs, as I know that these are well-made and have good cell protection built in. They arrived yesterday and the "UK specification charger" was a dodgy Chinese spec one, with a positively lethal, unfused and unshielded adapter. These adapters seem to be very common, so common that I probably have half a dozen that I really should throw out. Here's a photo I've just taken of the things:

Very dodgy adaptors.JPG

Here in the UK these are technical unlawful, for a host of reasons, but the main ones being that they bypass the safety shutters we have on our outlets, that are operated by the longer earth pin on a BS1363 plug and which prevent anything being poked into a live outlet, and there is no fuse, so the plugged in device and its cable is not overload protected (the only protection would be the ring main fuse or circuit breaker, commonly rated at 32 A on our 230 V nominal system). Additionally, internally the contacts in these adapters are extremely poorly made and are often barely touching the plug pins, so there is a significant risk that they would overheat or spark internally.

We do have proper travel adapters that are safe to use, they have an internal fuse and spring-loaded shutters over the two pin connection, plus they are marked BS1363/3, to show compliance with the regs.
 
#25
I felt compelled to reply to the gentleman regarding his use of a 500watt isolating transformer, inferring their safety. Fact is they can be just as dangerous, giving out up to 250v can still kill never mind the fact it is isolated.
The 2kwatt isolation transformer output threw me eighty odd feet across a tv workshop in the seventies and stopped me breathing. Fortunately our boss was sensibly cautious, and insisted no-one ever worked alone.
I agree about the use of a small transformer far outweighing its cost versus safety.
regards
 
#26
I never implied the isolating transformer was "safe".
If you had to connect a scope to a TV in the 70's, it was use an isolating transformer or disconnect the earth from the scope.
 
#28
Those Vigortronix supplies are really good. I've used dozens of the smaller 1W ones (these: https://www.rapidonline.com/vigortr...w-ac-dc-power-supply-single-output-5v-84-2686 ) and if you don't want to make your own PC working at mains voltage, there is a ready made PCB for them: https://www.rapidonline.com/electri...1-ac-dc-converter-mounting-kit-1w-10w-84-2157 complete with fuse, mains connection block and LEDs.

The 1W ones are really neat and tiny, and the only thing to watch is that any home made PCB for them has adequate isolation and anti-tracking measures. I leave several mm of clear space around the line and neutral connections, normally add an earth barrier around them on the PCB and give the finished board a coat of ACS silicone conformal coat on the underside, as an additional anti-tracking measure (probably a bit of an overkill, TBH).
 

Circuit

Senior Member
#29
Those Vigortronix supplies are really good. I've used dozens of the smaller 1W ones (these: https://www.rapidonline.com/vigortr...w-ac-dc-power-supply-single-output-5v-84-2686 ) and if you don't want to make your own PC working at mains voltage, there is a ready made PCB for them: https://www.rapidonline.com/electri...1-ac-dc-converter-mounting-kit-1w-10w-84-2157 complete with fuse, mains connection block and LEDs.

The 1W ones are really neat and tiny, and the only thing to watch is that any home made PCB for them has adequate isolation and anti-tracking measures. I leave several mm of clear space around the line and neutral connections, normally add an earth barrier around them on the PCB and give the finished board a coat of ACS silicone conformal coat on the underside, as an additional anti-tracking measure (probably a bit of an overkill, TBH).
Excellent suggestion; I use these devices also and I agree to their worth. Just watch out for ripple though in critical applications such as RF transceivers.
 

Pongo

Senior Member
#30
@Steve2381, Jeremy Harris, Circuit;

Why would y'all recommend this module that brings line voltage into the enclosure to a beginner (apparently one with a poor understanding of the basics of electrical safety), rather an external supply (wall wart in U.S. terminology) that only requires him to manage low voltage DC?
 
#31
@Steve2381, Jeremy Harris, Circuit;

Why would y'all recommend this module that brings line voltage into the enclosure to a beginner (apparently one with a poor understanding of the basics of electrical safety), rather an external supply (wall wart in U.S. terminology) that only requires him to manage low voltage DC?
To be clear, I wouldn't.

However, there's no reason why someone cannot bring mains into an enclosure, using safe design, provided they understand the risks and how to mitigate them. It's the reason I added this part to my post above:

and if you don't want to make your own PC working at mains voltage, there is a ready made PCB for them: https://www.rapidonline.com/electric...1w-10w-84-2157 complete with fuse, mains connection block and LEDs.
In my view, there is a steady progression in terms of competence and power supplies:

- Start off using small batteries, like the three AA pack that connects to many of the Picaxe starter kits.

- When you're a bit more knowledgeable, understand some of the issues surrounding safely working with a bit more current capability, and no longer wish to spend money on batteries, move on to using an approved and safe "wall wart" type plug-in, isolated, power supply unit.

- When you feel competent enough to connect directly to the mains supply, using an internal power supply within your project, look at using something like the ready-made power supply modules mentioned above.

Each of these stages requires an increasing level of understanding of electrical safety, but there's no reason why anyone cannot progress to the stage of using mains supplies inside their project IF, and it is a very big IF, they have the knowledge and understanding of the risks involved in doing so. I'd prefer that we didn't discuss mains-powered projects, given the likelihood that some here are relatively inexperienced and may lack the knowledge required to work safely with high voltages. However, there is a core of members here that have a lot of experience of working with mains powered equipment, are perhaps qualified to do so and can pass on their knowledge to others (I was a 15th Ed qualified electrician, as a hobby years ago, for example, and my first proper job involved working on ground and airborne radar equipment, so I quickly learned how to work safely around very high voltages).
 

Pongo

Senior Member
#32
You can put me in that HV qualified group too, in a former life I've shepherded products through approval at most of the safety organizations in the northern hemisphere. I feel that the world in general has moved away from internal PSU's in most situations, and there is little justification using one in a hobby project. Of course there are exceptions, the last time I brought line voltage into a unit was a 12V/30A power supply but otherwise I'll let someone else worry about isolation.
 
#33
To be honest, all of the indoor, mains powered, Picaxe projects I've built use plug-in external power supplies, exactly for those reasons.

However, I have a fair few projects that are outdoors, or semi-outdoors, in IP65/66/67 sealed enclosures, and all of those have mains cables going into the enclosure, and most use those small Vigortronix PSU modules. Using a plug-in power supply isn't an easy option for an outdoor bit of kit, most often because very few of those power supplies will fit inside a locked-down IP rated external socket housing.
 
#34
@Steve2381, Jeremy Harris, Circuit;

Why would y'all recommend this module that brings line voltage into the enclosure to a beginner ... , rather an external supply ... that only requires him to manage low voltage DC?
What about the case where the project in question is required to switch the line voltage, as well as being powered by it?
 
Top