Like a lot of crazy ideas, the world’s first tweeting e-cigarette was conceived of in a bar. This particular bar is called Tir Na Nog, and it’s the unofficial satellite office of creative agency R/GA’s New York branch where–according to Michael “Pickles” Piccuirro–“a lot of what happens at this agency takes place.”

Piccuirro is prototype studio product and technology director at R/GA, by all accounts a smart guy. So why is he spending his time linking e-cigarettes to Twitter? As this connected egg carton proves, you shouldn’t connect something to the Internet just because you can. But Piccuirro and his group of cohorts believe the world’s first connected e-cigarette might actually help people quit smoking.

“We work with a guy who’s a Q/A engineer,” explains Piccuirro. “His name is Will Creedle, he’s been a smoker for a long time and he’s tried lots of stuff trying to quit. He picked up e-cigarettes. Since it’s an e-cigarette that uses water vapor, you can smoke inside.”

Because the members of the prototype studio spend so much time at the bar, eventually R/GA CTO John Mayo-Smith saw Creedle taking drags from the device and asked him about it. A few weeks later, Mayo-Smith read about the growing popularity of these devices in the New York Times and instructed his prototype studio to connect one to the Internet.

A few years ago, this would have been a daunting task, requiring hardware engineers, a fabrication shop, and expensive proprietary sensors. Thanks to the rise of open-source, cheap, and easy-to-program reusable microcontrollers like the Arduino, however, you can now connect just about anything to the Internet with very little overhead. Agencies are increasingly taking advantage of this new capability by setting up labs of people who can do much more than just conceptualize ideas for their clients.

“Everybody here is a maker, so at the end of the day we’re producing something,” says group director Marc Maleh, who oversees the prototype studio. That mentality lead to a functional connected e-cigarette prototype–built by associate technical creative director Kumi Tominaga–and companion iPhone app in just four days of work.

“The way we integrated it is kind of low-tech,” says Piccuirro. “We have this thing called conductive tape. The conductive tape was put over the button of the e-cigarette, and we created this cigarette box that would house an Arduino with a Bluetooth shield powered by a nine-volt battery.” When you press the button, the conductive tape completes the circuit and sends a signal to the Arduino, which connects with an iPhone app over Bluetooth. The app displays statistics and sends tweets to the device’s Twitter account, TweetingCiggy.