A system for spraying an agricultural product, such as a herbicide or a fertilizer, on a plant, crop or soil, the system comprising a solenoid valve arranged to control delivery of said agricultural product to said plant, crop or soil, wherein said solenoid valve comprises a coil and a plunger, wherein said plunger is moveably arranged in said coil between a first position wherein said solenoid valve is open and a second position wherein said solenoid valve is closed and a controller arranged to control opening and closing of said solenoid valve for delivery of an amount of agricultural product to said plant, crop or soil, wherein the controller is further arranged to determine movement of said plunger relative to said coil of said solenoid valve.