Using AC/DC converter to power Arduino from Vin

septillion:
May I ask where you live?

Two things:

  1. You can use the USB of the Arduino to just power it (for example from a charger or power bank). You do the same when you charge your phone :wink: And a good charger is a easy and safe long term solution.
  2. You don't need to use the USB on the Arduino when you use a charger. You can cut a USB cable and solder the power just to the 5V and the GND pin. That way the USB is still free. But connecting it to a PC while also supplied with 5V from another source you feed 5V back to the PC. Most PC's don't like that. So if you want to connect it to the PC while connected to the charger (for example during debugging or changing the code later) you can use a USB cable with the (red) 5V cable cut. Alternatively you can cut the trace on the Arduino for the 5V from USB (but that's kind of a permanent solution) or not connect the USB while it's power from another source. BUT, that's pretty easy to forget :wink:

I'm from Turkey. Cutting an usb cable and connecting it to the converter seems really good idea. I would use a usb charger but, it would make the system a lot bigger than I desire. What I am planning to do is, I will take mains from under the electric switch and connect it to the converter. This way there won't be any cable to be seen in the environment (I will make a 3d printed case for the system). Thank you very much for all of your helps :).