Instructables
Picture of The Twittering Office Chair
The Twittering office chair "tweets" (posts a Twitter update) upon the detection of natural gas such as that produced by human flatulence. This is part of my commitment to accurately document and share my life as it happens.

For more in depth theory, please see the next step entitled Theory.

See the results of the toots of your on labor on Twitter.
 
Remove these adsRemove these ads by Signing Up

Step 1: Theory

Picture of Theory
According to my coworker, Twitter is supposed to happen in that space between Flickr posts and Facebook updates, in the space when life actually happens. Well, in the space of time "when life actually happens," life actually happens. It is neither pretty nor ugly. It is just life. If Twitter is supposed to be a document of life as it happens, then it should really document life, indiscriminately, as it happens without interference. If it fails to do this, then life then becomes the space between "tweets" (Twitter posts).

Therefore, it is of the utmost importance, to be able to update Twitter with life events without actually interfering with the event themselves. The documentation of life, henceforth, needs to be automated.

That said, I decided the first part of life that needed to be documented was my daily flatulence at work. I am not going to lie, I am a gassy individual. Since my flatulence is a part of life, it would be fraudulent of me to document life as it happens without documenting these occurrences.

In keeping with the process of non-interference in daily activity, I have created an office chair to both detect and Twitter my flatulence without having to bother me to update it myself.

Step 2: Go get stuff

Picture of Go get stuff
IMG_0044.JPG
You will need:

- Office chair
- Squidbee TX/RX pair
- 1/8" piece of acrylic
- 50K trimpot
- Natural gas sensor
- Solid hookup wire
- Soldering setup
- Laser cutter (or saw and drill)
- Razor blade
- Screwdriver set
- Drill
- Nuts and bolts (or screws)
- Pliers
- A staple gun
- Python
- A Twitter account

Step 3: Make a sensor mount

Picture of Make a sensor mount
Make a sensor mount by downloading the attached Corel file and laser cutting your 1/8 piece of acrylic using your awesome Epilog laser cutter.

Did I mention how awesome Epilog laser cutters are?

Anyhow... If, unlike us at Instructables, you do not have a laser cutter, you can download the file and print it to paper. Cut out the circular outline from the sheet of paper and tape this to your acrylic as a guide. Where necessary, drill holes through the acrylic using a power drill and cut around the outline with a jigsaw (or similar).

Step 4: Attach the sensor

Attach the sensor to the mounting bracket by follow the wiring in the schematic pictured. If you don't have a trimpot, you can insert a resistor value between 22K and 47K (a trimpot is recommended).

When the components are inserted, solder them in place. You may want to first cut off any extra leads that may confuse you.

See the datasheet here.

Step 5: Plug it in

Open your Squidbee (assuming you didn't make one yourself) and detach all of the useless sensors. Plug in your natural gas detecting sensor such that the power goes to the power socket and the data line goes to pin 2 (as shown).

Step 6: Program the Squidbee

Picture of Program the Squidbee
IMG_0343.JPG
IMG_0346.JPG
IMG_0348.JPG
IMG_0349.JPG
IMG_0350.JPG
Now is the time to program your Squidbee with the code to read the analog sensor.

First things first, unplug the Xbee shield from the Arduino (the part of the Squidbee the sensor is plugged into). Also, change the power jumper from battery to USB power.

Next, plug the Arduino into your USB port.

Open the Arduino programmer.

Set the Serial port (usually looks like /dev/tty.usbserial-A70048pF). Write down the serial port address for future reference.

Download, open and hit the "play" button to compile the code (download below). Upload the code to your Arduino.

Unplug the Arduino from your computer. Switch the jumper back to battery power and put the Xbee shield back on.

Step 7: Connect to the computer

Picture of Connect to the computer
When you are ready to start taking sensor readings, plug your 9V battery into the Squidbee transmitter and connect the receiver to the computer.

You can see the incoming stream of data by watching the serial monitor in the Arduino interface on your computer.

Step 8: Python

Picture of Python
Before you can go any farther, you need Python.

If you are using a Mac with a recent version of OS X, you should have Python already.

Open the Terminal, type into the command prompt "python" and hit "enter."

This should open up Python.

To see Python do its thing type:
print 'hello world' (and hit Enter)

This will return "Hello World" in the prompt.

To quit Python hit "control-D".

If you don't have Python, you can go download it here and install it by following the instructions listed.

Step 9: Dependencies

Picture of Dependencies
There are a number of hoops you have to jump through before you can run the Python code in the next step.

The first thing you need is the setuptools shell script. Open terminal and change your working directory to the directory setuptools is in. You can change directories by typing "cd nameofdirectory" and hitting "enter". and you can look at what directories are in your current location by typing in "ls" and hitting "enter".

Once you are in the correct directory, install the shell script by typing chmod setuptools.egg (or whatever the exact name of the file is. Do not rename the file). This may require entering your administrator password. Do so when prompted and hit "enter".

You should now be able to use Easy Install, which, happens to be one of the greatest pieces of code ever written. Once you have Easy Install you just need to type into the command prompt "easy_install" followed by the name of the package you are trying to download and hit "enter." For example, "easy_install greatcode" (not a real example). Next thing you know, you have downloaded and installed the whole "greatcode" package for use in your own code.

Open your prompt and type each line below and hit enter. This will install the Simple Json, Twitter, Time and advanced Math (numpy) packages.

easy_install simplejson
easy_install pyserial
easy_instally numpy
easy_instally time

Download and install Python Twitter by following the directions on the page (you might even just try "easy_install twitter").

Step 10: Code

Picture of Code
This project was a great excuse for me to start to learn Python. As a novice, this code is not perfect, but it gets the job done. If you any have suggestions as to how this may be improved, please let me know.

That said, some helpful things I learned about Python include:
One of Python's greatest features (or possibly the worst?) is its lack of syntax. You rarely need to remember a closing or opening tag. You can just keep typing out lines of code and Python will try its best to process it.

Python processes blocks of code based on their indentation. Improper indentation can result in catastrophe. For instance, the only way the code knows that something is part of a for loop is because it is indented the same as everything else that is also part of that loop. This can start to get tricky with nested loops (loops inside of loops) and lead to confusion and bad code.

Python's function system is confusing on a number of levels (for instance some variables are mutable and some not). I don't fully understand the complexities of functions, but if you are interested, you should definitely look it up.

The code we are going to use includes a number of packages, a collection of functions that can be invoked at will (see last step for more information about installing packages).

We are importing the following packages:
- Python Twitter
- PySerial
- Numpy
- Time
- Random

The code is as follows:

#!/usr/bin/python #Filename: TwitterChair.pyimport twitterimport serialimport numpyimport timeimport random## Your username and password here#api = twitter.Api(username='yourusername', password='yourpassword')## Change this to match your serial port#ser = serial.Serial('/dev/tty.usbserial-A70063pF', 19200)serialArray = []global gassygassy = 0def checkokay():	ser.flushInput()	time.sleep(3)	line=ser.readline()	time.sleep(3)	if line == ' ':		line=ser.readline()	print 'here'def startvalues(i):	while i <= 50:		#time.sleep(.25)		line=ser.readline()		serialArray.append(int(line))		ser.flushInput()		i=i+1	print serialArraycheckokay()startvalues(0)def main(i, i1):	ArrayTransfer = numpy.array(i)	ComparatorValue = int(numpy.mean(ArrayTransfer))		print ComparatorValue	lastReading = ComparatorValue	print lastReading		loopy = i1	print loopy	y = 0	x = 0	while y < 10:		while x < 5:			line=ser.readline()			currentReading = int(line)           			if currentReading > lastReading:				lastReading = currentReading				print lastReading			print currentReading			time.sleep(6)			ser.flushInput()			x=x+1		print 'half minute'		x=0		y=y+1	if lastReading > (ComparatorValue + 50):		i1 = 1        	if i1 == 1:		sayings = ["He farted again with success and vigor. Woest me.", "Pfffffffffft", "Ugh. That was a gross one", "Someone please disassemble me", "If I could puke my foam stuffing, I would", "I wish I were some other chair",  "He farted right on me again", "Didn't hear that coming", "allow me to repeat... ppppfffffffffftttttttttttt", "It wasn't always like this."]		pickSaying = random.randint(0,9)		print pickSaying		status = api.PostUpdate(sayings[pickSaying])	loopy = 0	print 'done'	if __name__ == "__main__":		main(serialArray, loopy)main(serialArray, gassy)

Step 11: Disassemble the chair

Mark on the seat of the chair the space between your bottom and the bottom of the backer. This is the space in which you want to install the sensor.

Remove the seat from the chair assembly and undo the upholstery until you can access the foam in the area in which you marked.

Step 12: Undo the upholstery

Picture of Undo the upholstery
IMG_0125.JPG
IMG_0042.JPG
IMG_0040.JPG
The fabric on your chair is probably held on with staple.

Remove the staples from the back side of the seat such that you can pull up a little of the fabric.

Step 13: Modify the cushion

Picture of Modify the cushion
IMG_0127.JPG
IMG_0129.JPG
Rip up the foam so that there is a pocket in which the sensor can be inserted into the chair. I found using a razor blade to get the hole started, made it slightly easier.

Step 14: Insert the sensor

Picture of Insert the sensor
IMG_0132.JPG
Insert the sensor into the hole you just made in the cushion of the chair's seat. If possible, angle the sensor slightly towards where your rear will be.

Step 15: Reassemble

Picture of Reassemble
IMG_0307.JPG
IMG_0308.JPG
IMG_0309.JPG
IMG_0318.JPG
IMG_0320.JPG
Put the chair back together. This means reupholstering it with a staple gun and refastening any nuts and bolts.

Step 16: Bottoms up

Picture of Bottoms up
IMG_0353.JPG
IMG_0355.JPG
Somehow, fasten the transmitter box to the bottom of the chair's seat in a manner that you can still open and close the case.

I chose to attach mine using hot glue. You can also use things like nuts and bolts.

This may require first emptying the case.

Step 18: Run the code

Picture of Run the code
Run the code by opening the terminal, navigating to the directory the file is located in and typing in python TwitterChair.py

If you didn't download the python file yet from the "code" step, download it from this step!

Step 19: Tweet

Picture of Tweet
Tweet when you toot. Happily let people know that you are engaging in life as it happens.
1-40 of 114Next »
squishyjoss11 months ago
Thats superior...
wonderful
didibemi1 year ago
hahaha I wonder what takes someone to build this >.< but it's creative :D
Chloe81 year ago
silly haha
nice!
Man...people around you are gonna get blond! XD
17 farts in one day?!?!?!?! i really hope you don't have co-workers in the same room.
techboy4112 years ago
Super silly!!!!!!!
robwok3 years ago
I'm very concerned about this. What if all chairs were equipped wtih such sensors, then once a threshold was reached, a carbon tax would be executed. What if some companies were more taxed than others - would they cancel rice and beans day in the company cafeteria? No more chilli cookoffs as a part of team events? Think of the repercussions man! ;)
Miss C3 years ago
I have to agree with mith91 ... absolutely hilarious!

sammy jr - never heard of that company but can recommend http://www.margolisfurniture.co.uk/office_storage

Of course if I was to sit on that chair you'd never hear a tweet out of me all day
;-)
ylpihs4 years ago
Really nice post. Just gave you 5 stars :)
mman15064 years ago
nice easter egg
mephedaw5 years ago
....over 3000 people are following your farts. wow.
ap1922 mephedaw4 years ago
Now its 3460 :)
godofal4 years ago
my god, this is GREAT :D

where can we follow that chair??
mith914 years ago
Omg that is hilarious!....I wonder if it could be expanded to coworkers chairs as well. lol
sammy jr mith914 years ago
just found this site. The effort some people make to make an "interesting" tweet is hilarious :)

actually I am looking for a Chair (that's how I laned on this page), does anyone know this company?

www.chworkspace.co.uk/
MegaMaker5 years ago
Congratz, you can now send "twoots".
WIN
Nicolas M4 years ago
 cool i'm gonna do one of these.
Can you help me find some kind of way to make it detect when i sit, stand, and how much weight is put upon it?
randofo (author)  Nicolas M4 years ago
Sitting and standing is easy! Weight is going to be very difficult. I recommend starting with Plusea's projects.

http://www.instructables.com/member/plusea
 Thanx a Lot, I'm currently following OfficeChair on Twitter, for some further information, my idea of the weight measurement is to save some ranges of weight so that somehow the chair knows who of the people that usually sits on it sits. Also, I recently thought making this in my family's couch, it would be so cool 'cause its a big couch for like 4 or 5 people, it could tweet like, "the one on the further right farted on me".
Thanks again
LOL
cornboy34 years ago
Great idea but you could do this without any dependencies and python pain in php.
randofo (author)  cornboy34 years ago
Adding dependencies in Python takes only a few minutes. Learning PHP would take a few days. Besides, I found that Python is much friendlier than PHP
M8R-9kie084 years ago
My favorite part about this fart related post is the advertisement for "high fiber" soup. Now that's targeted advertising!
Kaiven4 years ago
Hahaha, Nice one!
darkclaw424 years ago
 Got a kick out of this one. Cool idea! :)
Would be BA if it could tell what you ate.. 
awang84 years ago
You haven't farted since May 31st,,, Hmm...
I don't get tweets anymore.
I just had a look on Twitter and you fart a LOT
Could you put sensors on so it tweets when you spin, sit down, slide or any other thing like that?
randofo (author)  eggyeggyeggy4 years ago
Yes, the next modification I want to make to it is to sense when someone is sitting in it and for how long and then comment upon that.
It would be so cool!!!
When you spin it could say "I'm getting reeeeaaaally dizzy" and when you sit on it it could say "God he's so fat" (no offense and I'm not saying you are fat)
Fake_Name5 years ago
If you're using a Potentiometer as a variable resistor, you should really connect the wiper to one end of the resistive element. The wiper in pots occationaly looses contact with the resistive element, and in certain situations it can cause bad things to happen.

While it's not so critical here, it is good electronics hygiene.
Do you mean that a SPARK might occur!? Whooof! BLAM!
Yeah, its not smart to keep electronics near your farting butt.
The chair should be fitted with something that produces a flame instead of a tweet. That would be funny as hell.

Maybe a mesh office chair like one here: http://www.intercounty.com could make linking the whole thing up to a human easier?
Someone should make a version of this that uses a capacitor to cause a spark when it detects gas....
How do you know it would still be around to work the second time?
1-40 of 114Next »