Arduino Relay Circuit - Power


I've made a relay circuit for the Arduino to switch on and off a heater wirelessly, but I am struggling to find ways to power the Arduino? It seems pointless having a battery to power something to toggle the mains. I wondered about powering the arduino using a 5v dc converter and powering it in the same circuit, but obviously when the circuit is broken the arduino loses power! I hope im not missing something obvious.

Thanks in advance :)

You tap into the mains BEFORE it goes through the switch contacts. I'd say that's pretty obvious :)

BTW I hope there's a transformer in there somewhere too. Although it's obvious, I wouldn't want you missing that out either.

Yes, connect a wallwart to the pre-switched mains and feed the arduino power from that. Example to feed into the barrel jack:

I've got a transformer and a voltage regulator, i just wasn't sure if there were any problems with running the transformer in parallel to the device! Thanks!