Vegetables production in greenhouse are typically intensely managed with high inputs of fertilizers and irrigation water, which increases the risk of ground-water nitrate contamination. In 2010 and 2011, a study was conducted to determine the appropriate depth of soil moisture sensor for automatic irrigation control to use water and nitrogen efficiently under subsurface drip irrigation (SDI) systems. The irrigation line for SDI placed 30 cm below soil surface and tensiometer was used as soil moisture sensor. Three tensiometer treatments placed at 10 (SDI-T10), 20 (SDI-T20) and 30 cm (SDI-T30) depths below soil surface under SDI. These are also compared to SUR-T20 treatment where tensiometer placed at 20 cm below soil surface under surface drip irrigation (SUR) systems. The growth of cucumber was not statistically different between SUR and SDI without SDI-T30 treatment. Fruit yields (Mg/ha) were 57.0 and 56.9 (SDI-T10), 56.0 and 60.5 (SDI-T20), 40.9 and 41.2 (SDI-T30) and 56.6 and 54.3 (SUR-T20) for 2010 and 2011, respectively. Slightly higher total yield was observed in tensiometer placed 20 cm below the soil surface, although no significant differences were found between SDI-T10 and SDI-T20 under SDI treatments. In addition, nitrogen application rates and daily irrigation rates were lowest in SDI-T20 compared with other SDIs and SUR treatments. Nitrogen and daily irrigation application under SDI-T20 was lower than that under SUR-T20 by 6.0%. These findings suggested tensiometer 20 cm depth under SDI systems was best for cucumber production in greenhouse.