Powering arduino nano with 220v ac to dc

No, I haven't bought one yet, so I could get either a 2-pin or 3-pin plug/socket. I'll probably only use a light bulb with 2 pins, but in case I ever want to switch to a device with a 3-pin plug, I'd better get the 3-pin version. If so, should I connect the ground wire as shown in the last schematic I posted?

See post #60, I updated it

Type G

Then connect the grounds together.

Google has this to say about that connector.
Manufacturers explicitly state that speakON connectors must never be used as AC mains or power supply connectors.

Forget about playing with mains power. You obviously don't know what you're doing there.
Just use a 433MHz smart plug. They are a couple of dollars on Aliexpress.
Then use a 433MHz transmitter with your Arduino.

I google it and got this answer:

I also build in the past speaker amplifier box and in order to power the PSU box that gives the power for the amp box I use powerCon connector with same type of cable that connect the AC mains to the PSU box

Edit. Now I saw you said speakON , but I'm using powerCon and if by mistake I say speakON in the past I'm sorry, I meant powerCon

Don't forget the 220uF capacitor.

This indeed nice solution although I will not have all the fun of building it myself!

I've been following this with interest but not commenting. There is one thing I want to comment on though:

There's been a lot of discussion about single or double pole switching, and whether to switch live or neutral, the implication being that one might be safer than the others.

First, switching is not isolating. Isolating means either complete disconnection, as in unplugging the thing, or turning off and locking, with a key that you keep, a device designed and certified to be safe for isolation. Anything less is not safe.

Second, it doesn't matter from a safety point of view whether you switch live, neutral or both. You cannot assume that the wire you think is neutral really is neutral. Mistakes happen, things get wired the wrong way. Faults happen, things become live that should not be live. Switching something off does not make it safe. Switching something off with a relay is even less safe because you can't be sure the relay won't be activated unexpectedly. For something to be safe it must be isolated, see above.