230v to 5v without transformer circuit
DO NOT USE the circuits suggested in the link given by IanP. THEY COULD KILL YOU. In my opinion it is irresponsible of Microchip Inc to publish those circuits (they do mention the danger unless you use an isolation transformer, but why then call it a "tranformerless" design? Ridiculous).
Why? The mains N line is in and around ground potential (as you would be, were you to stand in bare feet) but the L line oscillates between +325 and -325 volts with respect to ground. [325=230xSquareRoot(2), because the 230 is root-mean-square). The suggested power supplies would feed that voltage, and another that is just 5 volts different--but of course it also is oscillating up and down at a lethal level. Put your finger on that power supply while in bare feet, and it's the last thing you'll ever do. Even if you wear rubber shoes, but your other hand touches a metal bench or something, same result. The circuits would be somewhat less lethal to you if L and N were interchanged, but it's still quite liable to kill your microcontroller. (By the way, you probably mean 5V DC, not 5V AC).
Stay alive: buy or build a proper power supply with a transformer in it. If you don't understand why, or if you don't know what smps might stand for, you have no business monkeying about with mains supplies. I'm deadly serious about this.