Living amid wild animals is not easy, especially when the animal in your backyard is a large elephant.

Many elephants now live in densely-populated areas, because farms and plantations have expanded into their traditional homes. To the elephants, crops are easy and nutritious meals. But that's not how farmers see it. Elephants raid crops, damage property, and sometimes kill people.

To avoid confrontations and protect their crops, farmers in Africa and Asia have traditionally used several tricks to scare off elephants, like beating drums, firing gunshots into the air or bursting firecrackers. But elephants are intelligent and persistent, and not easily put off. So people resort to poisoning or shooting the elephants. This is bad for all concerned.

So now researchers are experimenting with new strategies that can detect elephants early, and deter them from raiding people's properties. No guns are involved.

Beehive fences

African elephants are afraid of bees, especially the aggressive African honey bees. These bees' stings can be extremely painful even for the thick-skinned elephants, especially inside their trunk or around their eyes.

In 2002, researchers found that African elephants stay away from acacia trees with beehives. Later studies showed that not only do the elephants run away from the sound of buzzing bees, they also emit low-frequency alarm calls to alert family members about the possible threat.

In 2007, researchers began testing beehive fences as possible elephant deterrents in Kenya. The fence consists of beehives hung every 10 m, linked by wires. When an elephant touches the fence, the beehives swing, unleashing a swarm of angry bees.

The initial study was so successful that farmers extended the fences on their own initiative. They are particularly good at stopping raids by overwhelmingly large groups of elephants. Farmers in Tanzania, Mozambique, Botswana and Sri Lanka are now trying the fences.

Honey and other bee products earn the farmers additional income. "I'm pretty sure our beehive fence method is the only elephant deterrent fence that actually helps to make the farmer money," says Lucy King of the charity Save the Elephants.

Tigers on tape

If you don't fancy living with bees, you could scare elephants away using the sound of angry tigers.

On hearing the tiger growls, the elephants silently retreated

In southern India, tigers and elephants often live side by side. While tigers don't usually hunt elephants due to their size, they have been known to kill elephant calves. So elephants are wary of tigers.

In 2010, Vivek Thuppil, then at the University of California-Davis and now at the University of Nottingham, recorded the aggressive growls of a captive tiger and leopard, and played them to elephants frequenting villages around two protected areas in southern India. Whenever the elephants ventured close to crop fields, they tripped an infrared beam, triggering playbacks of the growls.

On hearing the agitated tiger growls, the elephants silently retreated. Thuppil is now developing a low-cost playback system that the farmers can use as elephant deterrents. "We hope to… make commercially available devices a reality by this time next year," he says.

Chilli

Elephants don't like chillis. Capsaicin, the chemical in chillis that makes them hot, is an irritant, causing elephants to cough, sneeze and eventually turn away.

So some farmers in Africa protect their crops from elephants by planting buffers of chilli plants around them. The chillis also earn them extra money. The Elephant Pepper Development Trust in Cape Town, South Africa, teaches farmers to make rope fences smeared with waste engine oil and red chilli, and mounted with cowbells, to deter elephants.

Asian farmers are also experimenting with chilli. Farmers in southern India use a combination of dry hay, tobacco, and dry red chili pods and seeds wrapped up in newspapers to create pungent smoke.

In north-east India, conservationists have gone a step further and tried using ghost chillis, or bhut jolokias, one of the hottest chillis in the world.

However, chilli-based methods do not work alone and perform best when combined with other deterrents. "Whatever the technique, it always works better when the farmer is present in his crop field," says Prachi Mehta of the Wildlife Research and Conservation Society in Pune, India. "Unguarded fields are like an open invitation to the elephants."

Mobile phones

If you share your home with elephants, it helps to know their whereabouts and keep a safe distance. So researchers have hit upon a simple and ingenious early warning system.

In the Valparai plateau of southern India, about 100 elephants live amid tea and coffee plantations and fragments of rainforest. They have killed 41 people in the region, nearly 76% of them after surprise encounters. To avoid such accidents, the Nature Conservation Foundation (NCF) in Mysore, India, has begun tracking the elephants.

In 2011, they developed a simple SMS-based system to warn people about approaching elephants. If someone spots an elephant, they call up NCF, which then texts the elephant's location to people living within 2 km of it.

For people without a mobile phone, the team has also set up red LED flashing lights in 24 strategic points, where people are more likely to encounter elephants. Each light has a SIM card that can be operated by certain people's mobile numbers. If they spot an elephant, these people can turn on the nearest light by dialling its number. These flashing lights warn people returning home in the dark, when elephants are not easily visible.

Thanks to the early warning system, there were no injuries or deaths in 2013, says project leader Ananda Kumar of NCF.

Microphones

Finally, you can simply eavesdrop on the elephants. They often communicate with each other in low-frequency rumbles. These infrasonic sounds can travel several km, so if you can listen in you can spot the elephants from miles away.

It doesn't work if the elephants fall silent

Researchers are now developing an early warning system that can detect elephants based on their infrasonic vocalizations. Angela Stöger-Horwath from the University of Vienna and her colleagues have shown that the low-frequency calls can not only help detect elephants, they reveal whether the elephants are infants, calves, juveniles or adults.

"The system is not in use yet," Stöger-Horwath says. "The next step is the production of a prototype."

If it works, the elephants could be driven off long before they enter the village to eat the crops, says Stöger-Horwath. The one drawback is that it doesn't work if the elephants fall silent.