Apparatus, having an insertion tube that is configured to be inserted into a body cavity. The apparatus also includes a distal tip connected to the insertion tube, the distal tip having an external surface and a cavity formed in the external surface, the cavity being surrounded by a region of the external surface having a curvature. The apparatus further includes a microelectrode configured to fit into the cavity so that a surface of the microelectrode is contoured, located and oriented to conform with the curvature of the region.