Introduction: The Twittering Office Chair

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.

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

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

Picture of 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

Picture of 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

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=&apos;yourusername&apos;, password=&apos;yourpassword&apos;)## Change this to match your serial port#ser = serial.Serial(&apos;/dev/tty.usbserial-A70063pF&apos;, 19200)serialArray = []global gassygassy = 0def checkokay():	ser.flushInput()	time.sleep(3)	line=ser.readline()	time.sleep(3)	if line == &apos; &apos;:		line=ser.readline()	print &apos;here&apos;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 &apos;half minute&apos;		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&apos;t hear that coming", "allow me to repeat... ppppfffffffffftttttttttttt", "It wasn&apos;t always like this."]		pickSaying = random.randint(0,9)		print pickSaying		status = api.PostUpdate(sayings[pickSaying])	loopy = 0	print &apos;done&apos;	if __name__ == "__main__":		main(serialArray, loopy)main(serialArray, gassy)

Step 11: Disassemble the Chair

Picture of 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

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

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

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

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

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 17: Turn It On

Picture of Turn It On

Plug the battery into the transmitter attached to the chair and close the case.

Plug the receiver into the computer.

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

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.


mephedaw (author)2009-05-19

....over 3000 people are following your farts. wow.

ap1922 (author)mephedaw2010-07-21

Now its 3460 :)

Yonatan24 (author)ap19222015-12-14

Now 8705...

Yonatan24 (author)2015-12-14

Awesomely disgusting...

davidbarcomb (author)2014-11-20

Haha love this!

squishyjoss (author)2013-10-27

Thats superior...

KatherineSchreiber (author)2013-09-06


didibemi (author)2013-06-20

hahaha I wonder what takes someone to build this >.< but it's creative :D

Chloe8 (author)2013-06-09

silly haha

ProbioticSoundsystem (author)2013-03-08


Shiply_Spain (author)2012-04-19

Man...people around you are gonna get blond! XD

grim.sleeper (author)2012-01-17

17 farts in one day?!?!?!?! i really hope you don't have co-workers in the same room.

techboy411 (author)2011-12-17

Super silly!!!!!!!

robwok (author)2011-06-09

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 C (author)2010-10-29

I have to agree with mith91 ... absolutely hilarious!

sammy jr - never heard of that company but can recommend

Of course if I was to sit on that chair you'd never hear a tweet out of me all day

ylpihs (author)2010-10-07

Really nice post. Just gave you 5 stars :)

mman1506 (author)2010-09-01

nice easter egg

godofal (author)2010-01-20

my god, this is GREAT :D

where can we follow that chair??

mith91 (author)2009-12-16

Omg that is hilarious!....I wonder if it could be expanded to coworkers chairs as well. lol

sammy jr (author)mith912010-01-19

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?

MegaMaker (author)2009-05-05

Congratz, you can now send "twoots".

J-Manoo7 (author)MegaMaker2010-01-10


Nicolas M (author)2010-01-03

 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 M2010-01-06

Sitting and standing is easy! Weight is going to be very difficult. I recommend starting with Plusea's projects.

Nicolas M (author)randofo2010-01-06

 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

watermelonhead (author)2009-12-16


cornboy3 (author)2009-12-15

Great idea but you could do this without any dependencies and python pain in php.

randofo (author)cornboy32009-12-15

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-9kie08 (author)2009-12-14

My favorite part about this fart related post is the advertisement for "high fiber" soup. Now that's targeted advertising!

Kaiven (author)2009-12-14

Hahaha, Nice one!

darkclaw42 (author)2009-12-13

 Got a kick out of this one. Cool idea! :)
Would be BA if it could tell what you ate.. 

awang8 (author)2009-12-13

You haven't farted since May 31st,,, Hmm...

Yerboogieman (author)2009-12-05

I don't get tweets anymore.

eggyeggyeggy (author)2009-10-30

I just had a look on Twitter and you fart a LOT

eggyeggyeggy (author)2009-10-29

Could you put sensors on so it tweets when you spin, sit down, slide or any other thing like that?

randofo (author)eggyeggyeggy2009-10-30

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.

eggyeggyeggy (author)randofo2009-10-30

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_Name (author)2009-04-13

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.

DIY-Guy (author)Fake_Name2009-04-16

Do you mean that a SPARK might occur!? Whooof! BLAM!

1spartan95 (author)DIY-Guy2009-06-23

Yeah, its not smart to keep electronics near your farting butt.

JamieEllis (author)1spartan952009-09-16

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: could make linking the whole thing up to a human easier?

dark sponge (author)DIY-Guy2009-04-17

Someone should make a version of this that uses a capacitor to cause a spark when it detects gas....

thepelton (author)dark sponge2009-05-30

How do you know it would still be around to work the second time?

Fake_Name (author)DIY-Guy2009-04-16

Nothing quite so spectacular. More likely, just bad data, offset drift or something similar.

Derin (author)2009-07-21

You didn't fart since Mar 31.

lambologo (author)2009-05-17

ok i might of read it wrong but are you realy poasting every time on twitter when some one farts?

Tomfish79 (author)2009-05-08

Sir, you are a genius, and I salute you!!

jra_esq (author)2009-05-04

This is absolutely BRILLIANT!!!!!

fwjs28 (author)2009-04-29

sadly, i am follwing this ;P

biphenyl (author)2009-04-21

That's weird! What kind of strange people go around labeling property with cryptic stickers?

About This Instructable




Bio: My name is Randy and I founded the Instructables Design Studio. I'm also the author of the books 'Simple Bots,' and '62 Projects to ... More »
More by randofo:Large Motor ProjectsRemove a Wheelchair Motor BrakeBuild a Robot
Add instructable to: