what is the safest way to measure the mains with oscilloscope without ending burning my oscilloscope ?
I know the purists will attack me for saying this - and I caution you that this is not recommended by any manufacturer - but the safest way to ensure you don't burn your oscilloscope is to disconnect the ground pin from the input. If you do this, you risk electrocuting yourself!
What most manufacturers do is connect the ground input pin to the ground/shield of the scope probes. The problem can be that, if a mains outlet is wired incorrectly swapping live and neutral, or if you connect the ground of the scope lead to a live mains signal you will fry the scope because the live will travel through the ground of the scope, through the PCB, and down the ground pin of the power input cord .
If you disconnect the ground from the input cord, then you've effectively made the ground+signal of your oscilloscope into a differential input because neither shield or signal on your scope probe is referenced to ground.
I keep a spare power cord with the ground disconnected for this very purpose.
WARNINGS
1. Mains voltages are lethal
2. Removing the ground means that the scope ground can be at mains voltage so be very careful in touching the oscilloscope when connecting the probes to mains - in fact, don't touch the scope when the probes are connected to mains is the best advice.
3. Check that your oscilloscope does isolate the power input from the scope ground - test with a meter from live and neutral in to the oscilloscope's ground / shield on front, it should be Meg Ohms
4. Check that your oscilloscope can handle the mains voltages (you may need to make sure the probes are on x10)
I'm not quite a purist, but I don't like this idea.
Without an Earth ( ground ) connection, the external metal parts of the Oscilloscope are free to take up whatever potential is present on the probe's "ground clip".
If you connect that clip to Mains "Active"( the "hot"wire), then touch the scope metalwork at the same time as you touch some other piece of equipment with an intact Earth lead you will "zap"yourself.
If your Mains circuit is fitted with an RCD device, it will just be a quick shock before the device removes the Mains connection.
If not, you may be badly injured or killed
Sometimes, all we want to do is to have a "quick look", to see if the Mains is there, & is about the right amplitude.
In such cases, just remove the probe ground altogether, & rely upon the return circuit already existing via the 'scope Earth lead & the power point Earth circuit, back to where the Earth & Neutral are bonded at the building power entry.
This of course, will introduce errors if you are trying to look at higher frequency artefacts upon the basic 50 or 60Hz Mains waveform.
Another way is to, again without using the ground clip, use two channels as a " pseudo differential input ".
(Put, say, Ch1 probe on one leg, & Ch2 probe on the other ,& set your 'scope to add the two.
This does have problems, in that it is not always easy to balance the Channel gains, giving rise to errors, but it can be useful.
Obviously, the best ways to do it, are a 'scope designed for such testing, with differential input circuits, or a differential probe with a conventional 'scope.