using a 220v to 5v ac->dc converter

Hi, Is it safe to use this module to power an Arduino from main? If it is, what is the best way to set this up?

thanks!

Yes, it should be safe, but you need to know how to work safely with mains voltage because you need to make a circuit board for the module, connect mains, a fuse etc. and respect spacing from live parts to the chassis etc. If you have no experience with this i would recommend getting a ready made wall-wort (cellphone-"charger" which has all the mains part of the circuit done.

// Per.

Well, I have enough experience with mains and with electronics that I feel comfortable working with both when I know what I'm doing, but I don't have any experience combining the two (soldering circuits containing mains parts). If anyone knows a tutorial for something similar so I can make sure I actually know what I'm doing, and that I'm not missing anything, that would be great

I don't know about tutorials and if so, I wouldn't recommend it. Either you know exactly what you are doing or you should contact (physically, not via a virtual advice) somebody who knows how to deal with the combination.

In general: The setup has to be such that by no means the user can get in touch with mains power. By no means = one should always assume that a user will always do something which you would never do and you have to take precautions for such a foolish user behaviour.

I've feel I must echo some of the concerns here: even if you are comfortable with working with mains voltages you will be exposing yourself to potential lethal voltages whilst you develop whatever Arduino project you are working on.

It's all too easy to touch something that is still connected to the mains. Which sort of sounds a bit patronising but many here have learned the hard way that this is true (as have I) and a plug in wall-wart, whilst more expensive, is 99% safer - you can either get a 9v, 12v or 5v version depending on what else you might be driving in your project.

We don't need a reduction in our members here! :o

Thank you for the input. The reason I'm not using a plug-in wall-wart is size, and not price. I would, however, make sure that while developing, everything that's connected to mains is inside a close insulated box before connecting it (of course the end result will be completely insulated)

Here is an extensive thread on that device: https://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers I recommend reading it, not just taking the design.

here is the review :)

http://lygte-info.dk/review/Power%20Mains%20to%205V%200.6A%20Hi-Link%20HLK-PM01%20UK.html

Thanks a lot for all the info.
One question I’m still wondering about is the distances between the legs: why would the mains lags be closer together than the 5v ones? It seems a bit counter intuitive.

I don’t know the exact dimensions of the device and the distance of the legs.
But I assume the manufacturer has designed the mains side according to high voltage rules, so that the distance, although smaller than the low voltage side, is ok.

Then it’s a design rule to set the pins so that you cannot mount it in a wrong way on the carrier.
Why they chose the mains side with the smaller distance - I don’t know, but mightbe there is another reason.