So is there some small, safe solution to convert 220AC to 5DC?
I think, that there might have been slight language gap, but point of the question was probably in terms of "how can I power my Adruino from mains cables dangling from the ceiling going to my ceiling lamp".
Good grief! - well it might - I haven't flogged through the sums.. and it would be terribly inefficient even if it did. If ( a quick glance ) it needed to supply 300mA, your resistors would be dissipating 80 + watts to deliver only 1.5 watts into the 5v load!BUT it means there's live mains all over the place, with serious safety issues.Please buy for a couple of quid/euros etc a standard plug-mounted device from ebay or any hobby shop.Be sure to get a regulated one.regardsAllan
Absolutely, they look something like this.
Buy a replacement extension cord socket end, attach it to the dangling wires (which are generally a *bad* thing to have about anyway!), and plug a cell phone charger into that socket
Yes, go to a certified electrician and ask him what can be done, and do not do that yourself, besides that the quality of the DC may be lacking, you may cause a fire in your house or kill yourself. And even if it costs a couple of hundred €, your life is still worth more.
I have intermediate understanding of electricity
I don't think so. Those things are an elementary understanding at best.
(The cables are not actually dangling around, they are currently connected to said lamp. ;-) )