Clive Goodman, a former royal editor at the tabloid, said Coulson did not know at first that voicemails were being accessed to obtain stories but was later made aware of it.
Coulson, 47, Prime Minister David Cameron's former director of communications, is on trial at the High Court in Edinburgh accused of lying under oath in the 2010 perjury trial of former Socialist MSP Tommy Sheridan.
He denies the charge.
Goodman, giving evidence on day three of the trial, told the court that he first became aware of private investigator Glenn Mulcaire as a contact of his news editor Greg Miskiw.
He said he could "crack seemingly uncrackable stories very quickly".
He was later told "they had been hacking phones" and was himself given a list of numbers to use to get stories, Goodman, from Surrey, said.
"I would hear messages, voicemail messages," he told the jury.
This was going on in around 2004 and 2005 when Coulson was editor of the newspaper, based in Wapping, east London, he said.
Advocate Depute Richard Goddard, prosecuting, asked him: "Did he know that you were accessing voicemails at that time?"
Goodman said: "Not from me, no."
Asked "did that change in the months ahead?", he replied: "Yes, it did."
Goodman said he went to Coulson at the end of October 2005 with a proposal from Mulcaire, who had suggested that for £500 per week Goodman could provide names of people around the Royal Family and he would access their voicemails.
Goddard asked him to tell the court what he remembered about the exchange.
He said he "outlined" the proposal from Mulcaire and "what we might get from it".
When asked what Coulson's reaction was, Goodman said: "He was worried about the cost. We agreed to it on a trial basis and would review after a month."
Goodman, 57, said he handled the "mechanics" of the arrangement himself and sent the money through under the fake name "Alexander".
Goddard asked: "Was he ever worried about the breach of privacy?"
Goodman replied: "That didn't come up."
He said they did not have a conversation about whether it was legal or not, and added: "I didn't know it was illegal."
The court heard the arrangement was extended before it was agreed that payment would be only for "results", Goodman said.
Later, Goddard repeated: "You told us… these (payments) were for a phone-hacking operation that Mr Coulson knew about?"
Goddard: "You told us the exchange took place in the office of Mr Coulson in 2005?"
He said Mr Mulcaire would sometimes appear as "matey" in emails, but said lots of people used that name throughout the newspaper.
In an email shown to the jury, dated 25 October, 2005, Goodman told a member of the newsdesk he had not attended a meeting as he was "updating Andy on a project".
Goodman told the court that he was referring to the "Alexander project".
In an email to Coulson three days later, he wrote: "That new project has started getting results."
In another email, dated 25 November, he asked: "Andy, got a sec on extending the Matey trial pse?"
A reply from Coulson said: "Another month."
Goodman told the court that working at the tabloid became "hyper-competitive" and news editor Ian Edmondson was dismissive of stories he put to him, telling Goodman "if it's not the big story, it's the Big Issue".
Asked what would happen if he did not come up with lots of stories during the paper's editorial meeting, he replied: "You'd be torn apart, pretty much, in front of everyone."
Prosecutors allege that Coulson falsely stated he did not know about phone-hacking at the News of the World after being sworn in as a defence witness in Sheridan's trial.
He is accused of falsely stating he did not know that Goodman was involved in intercepting voicemail messages before Goodman's arrest on 8 August 2006.
Goodman told the jury: "I had a news editor that didn't like me and didn't put my stories through.
"I was under pressure to find new ways of doing things."
Once under way, the "project" started generating stories for the paper, including a report about Prince Harry asking one of his aides to help him with his written work when he was at Sandhurst, he said.
He said it was a good story as "it showed that Harry was not quite sticking to the rules on exams".
In an email to Coulson dated 9 December 2005, Goodman said some of the information he had for the story may be "too precise to go unnoticed".
In later correspondence between the two, Goodman wrote about the paper's decision to stop "Matey's" weekly payments.
He said in an email to Coulson on 3 February, 2006: "This contact has become increasingly productive in recent weeks. Especially since William started at Sandhurst.
"We are the only paper getting any information out of there at all about his movements and Kate's movements.
"A few weeks ago you asked me to find new ways of getting into the family, especially William and Kate, and I came up with this.
"It's safe, productive and cost-effective and I'm confident it will become a big story goldmine for us if we let it run just a little longer."
An email response from Coulson the same day said: "I'm sorry but it has to go."
The court heard that "Matey" or "Alexander" – which Goodman said referred to Mulcaire – was later paid on the basis of what was published in the paper.
Goodman said the biggest story was "Prince William being drunk at Harry's passing out party and being sent to his room to recover".
The court heard Goodman's home was searched by police on 8 August 2006 and he was arrested.
Goodman replied: "Very much so."
He confirmed he and Mulcaire had pleaded guilty to phone-hacking offences in 2006 and that he was sentenced to four months imprisonment.
Talking about the day he was arrested, he said police came to his home at 6am and took him to the News International office in Wapping before taking him to a police station in central London.
He said police showed him "file after file" of documents, mostly phone records.
"For the first time, I fully realised how Glenn operated. It started to dawn on me just how enormous this all was… I knew I was in real trouble," he said.
The trial, before judge Lord Burns, was adjourned until tomorrow when Goodman will continue giving evidence.
Yesterday, the jury heard a recording of the testimony Coulson gave in the court case in which he is accused of lying under oath – the 2010 trial of former socialist MSP Tommy Sheridan.
During questioning, Coulson,was asked about his time as editor of the newspaper from 2003 until 2007.
The jury heard him tell Sheridan how he had stepped down from the role after one of his reporters, Clive Goodman, was convicted of phone-hacking.
On the 2010 tape he is heard saying he "had no knowledge" of phone hacking but chose to resign as he felt he "had to take responsibility for it".
"Things went badly wrong at the News Of The World under my editorship and that's why I quit," Coulson said on the tape.
The jury of nine men and six women have already heard that following a series of articles about him in the News Of The World, Sheridan raised a defamation action in Scotland's Court of Session against the newspaper's publishers, News Group International.
Jurors in the subsequent 2006 defamation action decided that the politician had been defamed by the newspaper and it was ordered to pay him £200,000 in damages.
The court also heard that Sheridan's perjury trial at the High Court in Glasgow was in respect of evidence he gave in the earlier defamation action. During the 2010 trial, Sheridan called Coulson as a defence witness.
The Coulson trial, which started on Friday last week, is expected to last four weeks.