I want to use an optocoupler to detect mains (230V) voltage.
Which optocouplers do I have (salvaged from old PC PSU's probably):
Found circuits

Source: AC Optocoupler for 230V line detection

Source: [230v/110v AC Mains Detection Module Hookup Guide](230v/110v AC Mains Detection Module Hookup Guide)

Source: How to detect mains voltage with a microcontroller?

I feel like I don't have enough knowledge to decide what's good. I will experiment with the above very cautiously. For the diodes I suppose the 1N4007 are necessary for a high voltage.
First I try this with an AC-AC adapter.

In the above picture my scope's ground was unconnected. In the picture below here it was.

How about a capacitor to smooth out those valleys?
Anyway, I feel ready to test safely with mains voltage. This is what I did first, and made a stupid beginners mistake:

A small bang and a flipped fuse-switch. Obviously I cannot just connect my scope's ground to the circuit as it is directly connected to mains ground.
I can just not use the scope ground, like this (the circuit has to have a ground to simulate though):

The simulated output:

Which looks pretty close to the output on the scope:

Next step: A circuit that detects when the optocoupler gives a signal, then turns on a LED.