Thanks people...
As ever I've skimped on the original request! Apologies...
My 'mains' device is one of those freebie mains switches that turns on/off from an IR signal.
Ultimately these things have a relay that switches the mains but they have a small circuit (fed from the zener etc) to power the whole thing. The relay is 24 v and is turned on/off using a surface mount transistor.
I want to replace the IR trickery with a simple low power circuit that fires the transistor, powers the relay and switches the mains.
The problem is, though, to fire the transistor I need to share the ground with my battery switching unit.
I know the correct solution is to use an opto-isolator - but I'm being cheap (again!) and I don't have one in my box of bits.
I'll probably have to wait until I have a bigger order add remember to add one to the order but it would be nice to progress my little project now - using more bread and butter components.
I'm not too sure a transformer would do this (I also have space constraints ( I want to wedge most of it back into the original case)).
I suspect a relay would do the deed - but I don't have one of those either
Anyway, I'm beginning to think that the opto-isolator is the only way forward.