A flasher caused “fear and upset” when he carried out a sex act at his living room window while children were walking past.
Lee Scott, who lives close to a school, was completely naked during the shocking display on February 4.
Newcastle Crown Court heard one young girls who saw what he was doing was left in tears.
One adult witness said she was left “sickened, scared and upset”.
Prosecutor Anne Richardson said Scott had been at his ground floor front room, with the net curtains behind him so he could look out and be seen.
Miss Richardson said some weeks before, a passer by thought Scott was acting in a similar manner but convinced herself it was too shocking to be true.
When Scott was arrested he claimed locals had it in for him because he has schizophrenia and denied the allegation.
The 44-year-old, of Swindon Road, Sunderland, later pleaded guilty to engaging in sexual activity in the presence of a child.
Judge James Goss QC sentenced Scott, who has been held in custody for the equivalent of a 12 month prison sentence, to a community order for two years with supervision and five years sex offenders registration requirements.
The judge told him: “Put shortly, what you did was deliberately and knowingly masturbate towards and in the presence of passing people, including young children.
“That caused both the children and the adults who witnessed your behaviour obvious disgust and upset.
“I hope you understand such behaviour is not only a crime but it is regarded as a serious crime when it is directed towards children.
“I sincerely hope you have learned your lesson and will never behave in this way again.”
The court heard Scott has been assessed as a “low risk” of committing any contact sex offences.#####