A feeder comprising: a feed container having a volume for holding feed, a feedinput partfor providing a feed input into the feed container, a feed valve which isconnected to thefeed input part and the feed container, wherein the feed valve is configuredto regulate andcontrol the flow of feed into the feed container, a dosing valve which isconnected to thefeed container and controls and regulates the flow of feed out of thecontainer, a first feedsensor which is configured to provide a first parameter representing an amountof feedinside the feed container,where the feed valve and/or the dosing valve are configured to be controlledby a controlsignal that is at least partly based on the first parameter.