Switching mains voltages is pretty simple. All you have to
do is make sure the switch you use is rated at 240VAC (or more) and that it will
handle the current you expect to switch – with a little bit of margin for
safety.
Oh, then you have to ensure that all the "bitey" bits are fully
insulated. And that the switch can’t work its way loose. And that if one of the
wires breaks or works its way off, it can’t touch anything else and make it
live. And that . . .
And what if you wanted to switch 240VAC mains some distance
away – say switching some garden lights at the back of your yard from inside the
house?
Sure you can run mains cables from the lights all the way to
the switch and back again but apart from the expense, you now have
mains-carrying cable which has to be properly conduited, buried and marked with
locating tape so someone doesn’t put a shovel through it somewhere down the
track!
Of course that means getting an electrician in because you
can’t legally install fixed mains wiring yourself . . .
It’s not quite as simple as you first thought, is it?
All this assumes a mechanical switch: one that is actuated by
the pressure of your fingers (or something similar). But what if that switch
needed to be actuated by something else – a sensor of some sort, a computer
output or another relay in another project?
It’s now a whole new ball game. Instead of a switch, you now
need a relay, rated to handle that same mains voltage and current we talked
about earlier.