Carbon nanotube (CNT) Schottky barriers and p-n junctions based photovoltaic photodiodes have been demonstrated they were able to detect infrared (IR) signals. However, how to optimize the performances of these one dimensional (1D) detectors is not clear due to the variation of the properties of as-made CNTs. We investigated the photocurrent variation by modulating the depletion regions through electrostatic doping from a gate of the CNT field effect transistor (FET). It showed that the photocurrent from the Schottky diodes between Au and CNT can be maximized by applying a moderate negative gate voltage, indicating widest depletion width in that state. By introducing a small Aluminum gate underneath and partially couple to a CNT, two inversely connecting p-n junctions will be formed with an appropriate positive gate voltage. As a result, dark current was suppressed around 3 orders and photocurrent was enhanced, resulting in a high on/off ratio photocurrent and a ̃0.1V open circuit voltage. The experiment results show that electrostatic doping using CNTFETs can improve the performances of the 1D photodiodes. The CNTFET based IR detector may have substantial potential for further nano-optoelectronics.