A packaging solution that accurately positions a microlens array over a UV-LED array for the purpose of either collimating or focusing the light emitted by the LEDs is presented. The assembled device can be used for mask-free lithography or for postfluorescence lifetime imaging of biological samples. The microdevice proposed permits the simultaneous dynamic monitoring of the microlens array in the vertical direction through electrostatic actuation and in the horizontal direction through magnetic actuation. Displacements of more than 70 µm can be achieved for the vertical actuation with less than 1% deviation over 17 h. The device, manufactured through a modified UV-LIGA process, can either be postprocessed on top of the UV-LED array or be temporarily connected to the optoelectronic component depending on whether continuous monitoring of the microlens array is required. © The Institution of Engineering and Technology 2007.