In this paper, we integrate nano technology into traditional microelectronic processing, and develop an on-chip UV sensor based on lateral growth ZnO nanowire arrays. Traditional procedures are used to fabricate the interdigital electrodes, and ZnO nanowires are self-organized and grown between electrodes laterally by hydrothermal method. Additional inclined nanowires are removed during the post-processing procedures, such as ultrasound cleansing and electrode reinforcement. Two kinds of electrode structures are applied, i.e., Cr and Au. For the Cr electrode device structure, because Cr will restrain nanowires from growing vertically on its top, the laterally grown nanowire is long enough to reach the other side of the electrode. The corresponding photoelectric response mechanism is photoconduction controlled by surface oxide ion adsorption. Although the photocurrent is large, the gain is low, and the response speed is slow. Under the UV radiations of 20 mW/cm2 and of 365 nm in wavelength, the dark current is 2.210-4 A with 1 V bias voltage, the gain is up to 64, the photocurrent cannot reach saturation after 25 s, and the recovery time is 51.9 s. A secondary electrode can be fabricated after growing the nanowire arrays to reinforce the connection between the electrode and the ends of the nanowires. However, the direct contact between metal and semiconductor will form a Schottky contact. The photoelectric response mechanism is then changed to photovoltaic effect, which can greatly improve the gain and response speed. Under UV radiations of 20 mW/cm2 and of 365 nm in wavelength, the dark current is 4.310-8 A with 1 V bias voltage, the gain is up to 1300, the respond time is 3.8 s, and the recovery time is 5.7 s. For the Au electrode device structure, because Au is catalysis for ZnO nanowire growth, nanowires grown in lateral direction will compete with those grown in vertical direction, and hence the laterally grown nanowires are not long enough to reach the other side of the electrode. Nanowires grown from two sides of the electrodes will meet each other and form a bridging junction, however, this will turn the photoconduction mechanism from surface ion controlled into a bridging junction controlled, which yields the best device performance. Before removing the inclined nanowires by ultrasound cleansing, under UV radiations of 20 mW/cm2 and of 365 nm in wavelength, the dark current is 8.310-3 A with 1 V bias voltage, the gain is up to 1350, the respond time is 3.3 s, and the recovery time is 3.4 s. After removing the inclined nanowires, under UV radiations of 20 mW/cm2 and of 365 nm in wavelength, the dark current is 10-9 A with 1 V bias voltage, the gain is up to 8105, the respond time is 1.1 s, and the recovery time is 1.3 s.