Since leaving Coronation Street three years ago, Julie Hesmondhalgh has been careful about which projects she chooses, opting for challenging theatre roles and discerning TV appearances.

But when an offer came through for a role in the third and final series of hit crime drama Broadchurch, set three years on from series two, she didn't think twice.

"I would love to say it was because of the character, but when you get the call saying, 'Do you want to be in Broadchurch?', you don't really go, 'What's the part?'' admits the actress, who played Corrie favourite Hayley Cropper for 16 years, the first transgender character on a British soap.

There was also the lure of working with the show's lead actors, David Tennant, who plays Broadchurch CID's DI Alec Hardy, and Olivia Colman, who plays DS Ellie Miller.

"All my first scenes were with them," says Hesmondhalgh, who turns 47 this month, during a break on location in Dorset, where the show is filmed.

"I've had to work very hard at feeling like I'm not a competition winner. I'm a woman in my late-40s now and I've got to stop acting as though [I'm thinking], 'Thank you very much for having me!'"

In fact, producers of Broadchurch, which pulled in more than 10 million viewers in both its first and second series, were so keen to have her involved, she didn't even have to audition.

Hesmondhalgh, who won Best Serial Drama Performance at the 2014 National TV Awards for her portrayal of dying Hayley's cancer battle, employs all the compassion and skill viewers have come to expect from her in the role of Trish Winterman, a farm shop worker who suffers a sexual assault in the close-knit coastal community.

Hardy and Miller (who is rebuilding her life after the shocking discovery that her husband killed 11-year-old Danny Latimer last series), are tasked with investigating the case.

In emotional and carefully researched scenes in episode one, Trish must relive her ordeal as Hardy and Miller gently quiz her about the events of the night in question, and gather physical evidence with the help of the local Sexual Assault Referral Centre (SARC).

"I had a long conversation with Chris [Chibnall, executive producer, creator and writer] before I started, which was lovely," she says.

"Because of the nature of it, I did want to ask some questions about where it was going and how it was going to be handled."

Hesmondhalgh, who has also appeared in dramas Happy Valley and Moving On since leaving Corrie, worked with a dialect coach to perfect her Broadchurch accent - "I'm giving you my best Dorset".

She's also been staying right in the heart of things, in a caravan site over the cliffs.

"I thought my family would be coming to join me, and then as it happened, it was all term-time and they never got the chance. So I had a three-bed caravan and I loved it," she reveals with a smile.

"It was right by the sea and it was lovely," adds the actress, has two daughters with her husband, the writer Ian Kershaw. "I would walk over the cliffs to work [in the resort of West Bay]. I had a little swim in the sea."

During filming, the cast had various theories about who the culprit might be, but the identity of the attacker was a closely-guarded secret until late in the filming process. Scripts were digital and password protected, with personalised watermarks emblazoned across each page, and code names for the top actors.

"The conversations we've been having every day are exactly the conversations I think will be going on all over the country after every episode," she says. "Sarah Parish is pretty sleuth-like and David [Tennant] is good."

Whatever the plot outcome, a pivotal role in such a ratings hit means the actress should be able to hang up Hayley Cropper's beloved red anorak for good.

"Coronation Street changed my life beyond measure. I still get a lot of love for it and Hayley hugs," says Hesmondhalgh.

"I love that part and I love that whole time in my life, but I feel very separate from it now."

  • Broadchurch continues on ITV on Mondays