Getting caught short without a toilet in sight might be a thing of the past thanks to a device that has been developed in Japan.

Key points: Users receive a text when it is time to go to the toilet

Users receive a text when it is time to go to the toilet In Japan's ageing population more adult nappies are sold than baby nappies

In Japan's ageing population more adult nappies are sold than baby nappies The development is being subsidised by the Japanese Government

The wearable device, named D Free, is smaller than a box of matches and it uses ultrasound to monitor bowel movements, by sending the user a text message when it is time to go.

The device's creator, Atsushi Nakanishi, said as well as personal use, he hopes it will benefit the ageing population to cut down on adult nappy costs and preserve their dignity.

Mr Nakanishi said the idea first came to him two years ago when he was walking down the street carrying heavy luggage and there was no toilet in sight.

"I pooped my pants... it was very embarrassing," Mr Nakanishi said.

He was a university student at the time and the accident made him wonder whether he could develop an early warning system to prevent it from ever happening again.

The device uses ultrasonic waves to track the movements in the bowel.

The D Free app's accuracy will improve over time, its creator says ( YouTube )

"I came up with the idea of using ultrasound," Mr Nakanishi said.

"If it can see a tiny baby inside a mother, it must be able to keep track of poo."

The device looks like a small cake of soap, is made from plastic and can either be stuck to the skin under the belly button or it can be worn in a pocket on custom-designed underpants.

When it is time to go, the user receives an almost Orwellian text message that states: "We have detected activity in your intestines: you have approximately 10 minutes."

Device could help Japan's ageing population

While it might be handy for personal use, Mr Nakanishi said he sees a much wider role for the device in care facilities for the aged and the disabled.

Space to play or pause, M to mute, left and right arrows to seek, up and down arrows for volume. Listen Duration: 2 minutes 14 seconds 2 m 14 s Listen to Rachel Mealey's report Download 4.1 MB

"Because of Japan's ageing population, more adult nappies are sold here than baby nappies," he said.

Mr Nakanishi said he thinks the device could save costs as well as dignity.

"At the moment it's on trial in nursing homes in Japan," he said.

"The margin of error is down to 10 minutes when you wear it for two or three days, but its precision will improve over time."

Mr Nakanishi set up his start-up, Triple W, and used crowdfunding for the initial phase of the device's development, but now he is receiving a subsidy from the Japanese Government and has interest from private companies.

He said he hopes to sell it to individuals by the end of this year.

One day soon, everyone could be relying on a device to let them know when nature is calling.