Voltage source using zener diodes

Hello there,

Your original power supply design is an offline power supply. These power supplies are usually used in small equipment that dont require much power. The design however requires some serious cautions about the enclosure and controls and other points. Because of the risk of serious shock, it is never recommended for anyone other than an experience designer/user that knows all the dangers and has taken all the precautions to make sure none of those can ever affect the end user.

For example, if you are standing on a concrete basement floor and touch any part of that circuit such as any component lead, you can get a very bad shock by current that goes through a large section of your body.

A place where you might see this kind of circuit is in a lamp dimmer, or an LED night light. Cost is important so the designers try to keep it down.

In the hobby place, cost isnt as important as safety. Wall warts can be had these days pretty cheap and they are much safer because they have to be double isolated to meet a certain safety standard. A good choice for hobby stuff.

If you really have to use an offline supply then you have to take the necessary precautions. For example, if you use a potentiometer in the circuit you should use one that has a plastic shaft not a metal shaft. That helps to keep the isolation between the user and the circuit in the event that the knob breaks off and the users still operates the equipment. It also helps if there is a small amount of damage to the enclosure where something inside shorts to the shaft but it's not visible from the outside.

Microchip has an app note about these kinds of supplies but you'll have to look it up as i dont remember the app number. I am sure there are other notes on the web too.

I got a 12v wall wart online for 3 dollars USD. It was either Electric Goldmine or Banggood. They both sell stuff for good prices.