I would contact Scottish Badgers charity. They have volunteers who will come out and advise. They will track to see where the badgers coming into your yard. there may be a reason it has just started coming in, It may possibly due to changes in the structure of its clan - lots of cubs around at the moment or some interference with their normal foraging area and/or food supplies. If this is the case, it may be a temporary glitch in their behaviour.. If you persist in keeping them out, they will probably move on.
Some folk have had success with diversionary feeding - i.e. feed them peanuts well away from your yard. We do this after having a badger in at our chooks. No problems since. There is a risk they get used to it though and will go back to your barn if there's no peanuts.
They are rarely aggressive and will run away if you make a noise and shooo them off. Make lots of noise when you go looking form them in the barn and they'll soon run off - try not to corner them or block them in though.
contact details for Scottish Badgers:
http://www.scottishbadgers.org.uk or Species Protection officer on 07866 844 232
Good luck.