Lennie James has been travelling a long, hard road, and is glad to have reached the end. As an actor, he has made his name with TV series such as Undercover Heart and Cold Feet and the movie Among Giants. As a writer he is still little known, but now the BBC is about to air his first self-penned film, Storm Damage. What's more, this searing children's home drama is the most personal piece of work he is ever likely to produce. "If I'd written 20 scripts," says James, "this would be the important one, because almost everything the film's about actually happened."

Storm Damage came out of James's experiences of foster care: good times mostly with his foster mother Pam, who adopted him at 16 after six years in a council-run home, where he was sent following the death of his mother, and then some difficult times, when he helped out at the children's home Pam set up while he was at drama school. The spur to write Storm Damage was the funeral of a teenager from the home, one of two dead children to whom the film is dedicated.

"My foster mother wanted to create a family home. For me, she had made a place that I felt I could always go back to, and that was what she was trying to do for these kids. I was about 21 and went back to help - you think that you are going to go in there and change a life. But it was just relentless and you felt like you were riding this wild bull and had to hang on for dear life."

James took classes at the Guildhall School of Music and Drama in the day and spent nights at the home. Like the main character, Danny, in the film (played by Primary Colors star Adrian Lester), he thought he could make a difference, but found himself simply trying to cope. One girl died after sniffing aerosols, and a boy ended up bleeding to death on the street.

"When that boy got stabbed a whole group of kids went round to stone the house of the guy who did it and he had to run to the police station and say, 'I did it.' But everybody knew this kid who died, and that if you fought him, you had to hope the police would come soon, or that you killed him before he killed you. Yet outside that he really was a sweetheart, a charming boy.

"When I wrote Storm Damage it was with the sense that these kids had gone, 'I'm going to do what I've got to do to make sure I'm all right.' If no one takes responsibility for them, of course they are going to screw up. These aren't lovable kids, but we tend to forget they are children and we relinquish our responsibility to teach them anything."

At 33 James is now a father of three. But it was as a son that he felt most nervous about the film, given that he'd never expressed to Pam a lot of the feelings that come out in Storm Damage. The film is "a testament" to her.

James also stars in the film, as the villain Bonaface. He was slated to play Adrian Lester's foster brother, but director Cellan Jones thought that playing against type would add more weight to James's character. Certainly, it's different from his most memorable turn to date, playing the sensitive cop Matt Lomas in the BBC drama Undercover Heart. For James that was a turning point, the first time he felt he had been judged for a part against his contemporaries purely on talent, not because of the colour of his skin.

"The part of Matt Lomas was just a man, but also the most rounded character I have ever been given, a gift of a part. But when people stop you in the street they're saying it's really good to see a black person up there doing that kind of stuff, so it's still like you are some kind of pioneer."

Last year James took some time off from acting to concentrate on writing: two film scripts, a commission for a new four-part Channel 4 drama called Angeltown, set in Brixton, and a co-writing job on another forthcoming Channel 4 series, Our Friends in Notting Hill. All a world away from his first experiences of writing for television when a stint on The Bill collapsed in acrimony. As the first black writer to script an episode for the show, he was persuaded to do some publicity. Interviews were done and a picture taken with one of the stars. The picture was mistakenly sent out to a handful of nationals with the caption, "Burnside makes another arrest."

"I rang up the publicity girl and she said someone had come in and assumed it was a still from the programme. I said what does that say about the programme? She said, 'All I can say is sorry' and I said, 'All I can say is fuck off'. I didn't write for them again."