How to wire for AC mains voltage relay, when printer board is connected to AC-charging laptop computer?
In effect, the ground (from mains) does not need to be connected to the relay, the relay interrupts the "hot" or "neutral" (preferably the "hot", but that is not possible for all plugs, e.g. some European plugs can be inserted 180&deg; turned into the sockets). You connect one of the interrupted wires to the COM, the other interrupted wire (that goes to the lamps) to the NO (or the NC, depending on safety, the logic and/or preference). The ground wire from the mains power socket is not necessary at all (some lamp amratures require this to be connected though). See a schematic below, it uses an Arduino Uno, but you can think of it being the printer board. Note to never connect the ground from mains to the printer board directly!



Image based on source: osoyoo.com

The logic (low voltage side of the relay) needs to be wired as follows:


DC+ is the voltage power supply of the relay module, this is frequently +5&nbsp;V, but some modules use +3.3&nbsp;V (sometimes there is a jumper cap to select the voltage)
DC- is the ground from the printer board
IN is the trigger that needs to be connected to the port on the printer board that electronically switches the relay