You do not say what it is supposed to do.
A quick glance finds that there is no protection diode across the relay coil. This could pop off the BC547.
You should not have the circuit ground connected to the mains ground. In the UK, the mains comes in as line and neutral and there is a separate earth.