This paper presents an economic study of electricity supply to a dairy cattle farm of 50 livestock units. We compared a stand-alone battery-wind-diesel hybrid system with an only-grid connected system and we analyzed four locations in Spain with different average wind speeds. The farm׳s electricity demand is 63kWh/d and the hybrid system designed for its supply is made up of a 20kW wind turbine, a diesel generator and a battery. All simulations were made with the HOMER© (Hybrid Optimization Model for Electric Renewables) software. Through a sensitivity analysis we can determine the economic viability of different options and sizes of the components of the installation. In locations with an average wind speed higher than 7.39m/s, a stand-alone system is profitable as long as the distance to the grid is higher than 7km, the price of electricity is 0.192€/kWh and diesel price is 1.8€/L. If 800Ah-battery is used instead of 200Ah, the COE will be reduced by 18% in location with 7.39m/s average wind speed.