An automated irrigation sensor was designed and implemented to use in agricultural crops. The sensor uses a smartphone to capture and process digital images of the soil nearby the root zone of the crop, and estimates optically the water contents. The sensor is confined in a chamber under controlled illumination and buried at the root level of the plants. An Android App was developed in the smartphone to operate directly the computing and connectivity components, such as the digital camera and the Wi-Fi network. The mobile App wakes up the smartphone, activating the device with user-defined parameters. Then, the built-in camera takes a picture of the soil through an antireflective glass window and an RGB to gray process is achieved to estimate the ratio between wet and dry area of the image. After the Wi-Fi connection is enabled, the ratio is transmitted via a router node to a gateway for control an irrigation water pump. Finally, the App sets the smartphone into the sleep mode to preserve its energy. The sensor is powered by rechargeable batteries, charged by a photovoltaic panel. The smartphone irrigation sensor was evaluated in a pumpkin crop field along 45 days. The experimental results show that the use of smartphones as an irrigation sensor could become a practical tool for agriculture.