Saturday, August 8, 2009

Make Your Gadgets Twitter

Summary: /* Types of Microcontrollers */




[[Image:Tweettoast.jpg|right|frame|Follow any [http://twitter.com/mytoaster toasters] recently?]]

Hollywood celebs and the blogging elite aren't the only ones going ga-ga for Twitter. Computer programmers and DIY hobbyists have been taking the simple text-based microblogging service to new creative heights by wiring up their gadgets and household appliances to tweet away on the web.



Just about any device can be enabled to send and receive tweets by using simple hardware platforms called '''microcontrollers'''. These tiny computers can be plugged into different modules -- a motor, a thermostat, a light-sensitive cell -- to detect a change in the environment or in the device's operating state. The microcontroller can then be programmed to send an alert whenever something specific changes.



The result? You can follow a [http://www.instructables.com/id/social_networking_for_my_toaster/ toaster that tweets] every time it browns a slice of bread, [http://twitter.com/pimpy3wash a washing machine] that tweets when a load of clothes is clean and [http://twitter.com/hacklabtoilet a toilet] that tweets every time... well, you get the idea.



Here's how to get started helping your own appliances broadcast their every move.



''This article is a wiki. Got extra advice or links about building microcontroller-based Twitter hardware? Log in and contribute.''





==What you'll need==



* A microcontroller

* Some software for sending tweets

* A network connection of some sort

* A sensor to detect a change in the appliance's operating state

* A Twitter account for your gadget





==Microcontrollers==



[[Image:Arduino.jpg|300px|thumb|right|An Arduino microcontroller board, the bare bones of many a DIY project involving Twittering gadgets. Photo: [http://commons.wikimedia.org/wiki/File:Arduino_Duemilanove_0509.JPG Wikimedia Commons].]]

If you want to enable your toaster, toilet or turntable to tweet, you're going to need a small computer to handle the actual processing and sending of the message. This is where the microcontroller comes in.



A microcontroller is a tiny programmable computer -- usually a minimal CPU and a tiny bit of RAM on a small circuit board -- that perform simple, dedicated tasks. Microcontrollers are in your car, your fridge and the phone on your desk.



Since they are programmable, microcontrollers can be told to watch for and act upon any type of event. The microcontroller is just the brain, though. You'll still need an external sensor -- "eyes" or "ears" -- to tell the microcontroller when to fire off a tweet and, in most cases, what to say.



There are several popular microcontrollers being used by hobbyists for these types of projects. Most run between $40 and $60, and they are solderable and have attachments for battery packs, I/O ports and sensors.



===Types of Microcontrollers===



'''[http://www.arduino.cc/ Arduino].''' This is the most popular platform for hobbyists and DIY computer enthusiasts building web-enabled devices. There are several different Arduino boards with different capabilities, but the software that runs on them is open-source, so it's easy to find a program that does what you're looking for. There's even a [http://www.arduino.cc/playground/Code/TwitterLibrary Twitter library] available for Arduino.



'''[http://www.parallax.com/Store/Microcontrollers/tabid/81/Default.aspx Parallax]''' makes several popular microcontrollers. The [http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/ProductID/1/List/1/Default.aspx?SortField=ISBN,ISBN BASIC Stamp 2] (or BS2) is programmed using the PBASIC language, a simple programming language similar to BASIC. The Propeller and the SX systems are a little more advanced.



'''[http://www.iobridge.com/store/ ioBridge]''' has a multi-module kit called the IO-204 that's ready made for use with web services. It's what hobbyist Hans Scharler used to web-enable his [http://www.wired.com/gadgetlab/2008/12/twittering-toas/ twittering toaster]. It costs $88.



'''Tip:''' Most retailers sell microcontroller kits specially made for hobbyists, including manuals that teach you how to write simple programs. These kits cost between $60 and $150, and they are recommended if you're just getting started.



'''See Also:''' Wikipedia's [http://en.wikipedia.org/wiki/List_of_common_microcontrollers list of microcontrollers].



==Software==



You'll need a simple software program that will detect whenever something happens, then send a tweet to Twitter's web service to publish an alert. The software you use will depend on what's supported by the hardware microcontroller you choose. You write the program on your computer, then load it onto the microcontroller, where it runs independently.



As mentioned above, the Arduino microcontroller already has a simple, open-source [http://www.arduino.cc/playground/Code/TwitterLibrary Twitter library] written that makes it easy for you to construct and send messages. You'll need to know a little bit about computer programming, but Arduino is comparatively simple to other microcontroller platforms. It's recommended you start here if this is your first time programming hardware.





==Network Connection==



Obviously, you'll need a way to connect to the internet if you're going to be posting to Twitter. Since most microcontrollers are extremely simple, this will require a hardware component (an Ethernet cable jack or a Wi-fi card) as well as a software component.



If you're using an Arduino, there's an [http://www.arduino.cc/en/Reference/Ethernet Ethernet library] you can download, and an add-on board called an [http://www.arduino.cc/en/Guide/ArduinoEthernetShield Ethernet Shield] that supplies the cable ports and the necessary chips.





==Sensor==



[[Image:Accelerometer.jpg|thumb|200px|thumb|A 3-axis accelerometer, via [http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=163&sessid=a1baf59449835fdf27e4841066c6a11f Adafruit Industries].]]

The microcontroller can be programmed to Tweet whenever a light goes on, the temperature reaches a certain point, a motor stops or a switch is flicked. Again, the type of sensor you use will vary depending on which platform you choose and what task you'd like your gadget to Twitter about.



If you're using an [http://www.iobridge.com/store/ IO-204 module], there are several sensor modules available for under $20 that can detect light, temperature and movement.



If you're going the Arduino route, most of the sensors are hacked together using cheap parts or modded to work with the platform, but you can grab schematics, advice and instructions at sites like [http://letsmakerobots.com/ LetsMakeRobots], [http://www.freeduino.org/ Freeduino], [http://www.libelium.com/squidbee/index.php?title=Main_Page SquidBee] and [http://community.pachube.com/ Pachube]. You can also by bulk packs of common sensors from [http://www.adafruit.com/index.php?main_page=index&cPath=35&sessid=a1baf59449835fdf27e4841066c6a11f Adafruit].





==Build It!==



What you build will be determined by which gadget you're wiring up and whatever ideas you come up with. But if you need help along the way, there are dozens of dedicated DIY and microcontroller community sites on the web to turn to.



Start small to get your feet wet, but don't be afraid to think big. As you can imagine, anything with moving parts can be made to tweet, and the possibilities are nearly limitless. One hacker [http://matthewmorey.com/projects/introducing-mattsoffice/ wired up his home office] to respond to tweeted commands. Another put a flatulence detector in an office chair to [http://www.instructables.com/id/The-Twittering-Office-Chair/ tweet every time he toots].



Once you've settled on a project, grab a Twitter screen name and tell all your friends to follow it.



==Helpful Links==



* [http://letsmakerobots.com/ LetsMakeRobots]

* [http://diydrones.com/ DIY Drones]

* [http://hackaday.com/?s=twitter Hack-a-Day posts] on Twittering appliances

* [http://www.freeduino.org/ Freeduino], a community site for Arduino





[[Category:DIY]]

[[Category:Gadgets]]

[[Category:Computers]]





View Original Article

Blogged with the Flock Browser

No comments:

Post a Comment

A blog site filled with the best and most interesting stories found on the web, as well as embeded tv shows.

OpenStreeMap