This billboard ad coughs when you’re smoking near it

Lucy Handley, special to CNBC

An billboard ad that can detect when someone is smoking and coughs at them has been unveiled in a busy area of Stockholm.

The digital ad can not only sense cigarette smoke, but can tell when someone is actually smoking by detecting the glow when they light up. It uses similar technology to that found outside some hospitals and gas stations, according to a spokesperson from agency Åkestam Holst, which is behind the campaign.

In the ad for Swedish drugstore Apotek Hjärtat, a man starts coughing once the technology senses that someone is smoking nearby. Then the line "New year, new resolutions" appears, followed by a selection of smoking cessation products.

Apotek Hjärtat – which literally translated means "pharmacy heart"- wants to help consumers live a healthier life, according to its marketing director Fredrik Kullberg. He gave the agency the opportunity to think freely about how to promote stopping smoking, a popular new year's resolution.

"We have a strategy to make communications that touches people and are always thinking about how to make the communication worth talking about," Kullberg told by phone.

"It's one of the most cost-efficient campaigns I've ever made," he added, given the attention the billboard has generated. The media and production costs came to around 30,000 euros ($31,815) for the advert itself and it ran at a site on one busy Stockholm street.

While it's too early to see the campaign's impact on product sales, Kullberg said the campaign had gone viral. An online video shows passersby being surprised by the ad when they smoke near it, which has been viewed nearly 600,000 times across Apotek Hjärtat's Facebook and YouTube pages.

"Using technology but meeting with real life and using the digital displays in innovative ways, going forward it's really exciting," Kullberg added.

Apotek Hjärtat has previously run a similar digital ad on a train station for a new line of hair products. As trains arrived at the station, a woman's hair appeared to blow in the wind generated, reacting to motion sensors in the billboard.

Follow CNBC International on Twitter and Facebook.