Flatulant Boss Detector




The older I get, the smaller my cubicle gets. In fact, I don't even have a cubicle now. But my boss used to walk in undetected and catch me doing research for some assignment (WWW - to the boss it looked like web surfing) and he would tell me to get to work. I wanted to put a cowbell around him, but I'm sure he wouldn't go for it, so I had to come up with something else. (note - the title should be "Flatulent.")

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Picked Up This Nifty Noise Maker for About 6 Bucks in the Toy Section of the Food Store.

You can read the package for yourself. It has about 6 different random "tunes." But, the key item is the little RF remote button that comes with it.

Step 2: And I Found This Little Gem in WalMart for About $5.00.

Obviously it turns on a little light (LED) when motion is detected, and the room is dark. (Hmmmmm, I wonder if I could...)

Step 3: Okay. Let's Crack Open the Motion Sensor and Have a Look See...

Well, I labeled everything. The photocell (not shown, but trust me, it's there) is to prevent the light (LED) from coming on during the daytime, and therefore prolongs the battery life.

The Fresnel lens is there to provide a wide field-of view for the motion sensor. Fresnel is pronounced frie-nel, look it up on Wikipedia for more info.

Step 4: Let's Do Some Hackin'

First, you see that PIR motion detector. PIR means "Passive infra-red." Some people call it a "Pyro infra-red." I don't know why. Regardless, we wont hack that. We might need for something later.

Next, we've (well, me...but the royal we) have covered up that photocell I told you about. You see, I want my boss-detector to be active day and night. So, by covering it up, it thinks it's in the dark even when the lights are on. But, we've just pulled the wool over his eyes (actually one eye,) and he/she is now kept in dark.

And you can see that we have installed our own photocell right next to the LED. That little trick lets us know when the LED comes on because motion had been detected. Of course we could have ran a wire from the LED to achieve the same purpose, but where's the fun in that. The fun thing about hacking is to hack it differently than other hackers, as in the other electrical engineers. And that makes your hack a true original.

Step 5: The Photocell Circuit.

The photocell, such as you can buy at Radio Shack, has a resistance of about 50k ohms with no light exposure, and about 5k ohms or less when exposed to a bright light. So, if we use a resistor in series with the photocell, which is just a resistor, and tie them to a voltage source and ground, then we have a voltage divider. From there, tapping in between the two resistors provides a voltage signal which goes high or low, and can be used to trigger a device. In this case the motion detector uses 3xAA batteries, which is 4.5 volts. And this is how the circuit is wired to provide the signal needed to drive some other electronics. With the LED off, the circuit signal is about 1.7 volts, with the LED on, the signal rises to about 3.5 volts, which is enough to trigger a micro-controller

Step 6: Hacking the Remote Control Whoopee Button.

There's a button, which means somewhere there two pins, that when close-circuited, causes the whoopee cushion to do it's thing. The pins are fairly obvious, so I didn't show that part. But, I drilled a little hole and ran a pair of wires to the button pins. And, using a 5v reed relay from Radio Shack, I can connect the two pins by energizing the reed relay.

Step 7: Now for the Tricky Part.

It's not really that tricky if you know a little about electronics, but the deal is that you need to use the trigger signal to activate the system. You can use a one-shot timer, or a comparator, or a 555 timer, but, for me, the easiest thing is to use an 8-pin micro-controller. I used a PIC Micro 12F675. With that, I could trigger on input change of a pin, and flash a red LED. Also, if 5 people walk in I don't want the thing going crazy for 15 seconds, so I put in a 30 second delay so I could hit a kill switch and shut it off. So, I'll just fast-fwd and show the end result of the contraption. Note, I covered the LED so that the ex-boss would not see a light turn on every time he barged into my humble 1/4 of a cubicle.

This pic is the end product. I'll leave the electronics as an exercise for the student.

Here's the code for the PIC Micro 12F675:

; File name: Flatulant_Boss
; Processor: 12F675
; Author: Alan Mollick (alanmollick.com)
; Mode: Interrupt on GP2 change
; GP0 = INPUT -- n/c
; GP1 = OUTPUT -- relay
; GP2 = INPUT -- High = motion detected
; GP3 = INPUT -- n/c
; GP4 = OUTPUT -- Red LED
list p=12F675 ; list directive to define processor
#include <p12f675.inc> ; processor specific variable definitions
errorlevel -302 ; suppress message 302 from list file

; ~ Variables ~
w_temp EQU 0x20 ; variable used for context saving
status_temp EQU 0x21 ; variable used for context saving
hiB EQU 0x21 ; MSByte
lowB EQU 0x22 ; LSByte
temp EQU 0x23
spare EQU 0x24
temp1 EQU 0x25 ; trigger interrupt flag
temp2 EQU 0x26
delay EQU 0x27 ; delay time
pins EQU 0x28 ; pin state
spare1 EQU 0x29
spare2 EQU 0x2a
count EQU 0x2b ; loop count
count1 EQU 0x2c ; outer loop count
count2 EQU 0x2d ; outer loop count
d1 EQU 0x2e ; delay counter
d2 EQU 0x2f ; delay counter
d3 EQU 0x30 ; delay counter
d4 EQU 0x31 ; delay counter

RESET_VECTOR ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
INT_VECTOR ORG 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register

; isr code
call motion_detect ; send alarm signals

banksel INTCON
bcf INTCON,INTF ; clear GP2/INT flag

movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ;restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt

main: ; main program

; these first 4 instructions are not required if the internal oscillator is not used
call 0x3FF ; retrieve factory calibration value
bsf STATUS,RP0 ; set file register bank to 1
movwf OSCCAL ; update register with factory cal value
bcf STATUS,RP0 ; set file register bank to 0

;* Initialization *
; GP0= not used, GP1=relay output, GP2=input (motion detect),
; GP3=input for cntrl/emergency cutoff, GP4=output to LED indicator,
; GP5= not used

; set up direction of I/O pins
banksel TRISIO
movlw b'00000101'
; xx------ not implemented
; --0----- 0=output, GP5=n/c
; ---0---- 0=output, GP4=LED
; ----x--- not used, GP3, Dedicated to MCLR
; -----1-- 1=input, GP2 motion detected
; ------0- 0=output, GP1 = solenoid valve
; -------1 1=input GP0=A/D
movwf TRISIO

; set up A/D converter
banksel ANSEL
movlw b'00010000'
; x------- not implemented
; -001---- 001=Focs/8 Conversion Clock
; ----0--- 0=digital I/O, GP4, Fosc/4 clockout for debug purposes.
; -----0-- 0=digital I/O, GP2
; ------0- 0=digital I/O, GP1, relay/etc
; -------0 0=digital I/O, 1=analog GP0
movwf ANSEL

banksel ADCON0
movlw b'00000000'
; 0------- 1=right justified result
; -0------ 0=Vdd is voltage reference
; --xx---- not implemented
; ----00-- 00=select channel 0 (GP0)
; ------0- 0=A/D conversion not started
; -------0 0=A/D converter module is off
movwf ADCON0

; initialize output pins
banksel GPIO
movlw b'00000000'
movwf GPIO

; initialize interrupts
banksel INTCON
movlw b'00000000'
; 0------- 0=global interrupts disabled
; -0------ 1=enable peripheral interrupts
; --0----- 0=disable TMR0 overflow interrupt
; ---1---- 1=enable GP2/INT external interrupt
; ----0--- 0=disable GPIO port change interrupt
; -----0-- 0=no on TMR0 overflow
; ------0- 1=
; -------0 0=no GPIO port change
movwf INTCON

; initialize interrupt on pin change GP2
banksel IOC
movlw b'00000100'
; x------- not implemented
; -x------ not implemented
; --0----- 0=disable GP5
; ---0---- 0=disable GP4
; ----0--- 0=disable GP3
; -----1-- 1=enable GP2/INTR *****
; ------0- 0=disable GP1
; -------0 0=disable GP0
movwf IOC

banksel PIE1
movlw b'00000000'
; 0------- 0=disable EE write complete interrupt
; -0------ 0=disable A/D converter interrupt
; --xx---- not implemented
; ----0--- 0=comparator interrupt disabled
; -----xx- not implemented
; -------0 1=enable TMR1 overflow interrupt
movwf PIE1

banksel PIR1
movlw b'00000000'
; 0------- 0=no EE write complete
; -0------ 0=no A/D conversion complete
; --xx---- not implemented
; ----0--- 0=no comparator interrupt
; -----xx- not implemented
; -------0 0=no TMR1 overflow
movwf PIR1

; GP1=output to relay
; GP4=output to LED

banksel INTCON
bsf INTCON,INTE ; enable GP2 interrupt

; if GP2=1 then output alarm signals on GP1, GP4 via interrupt

goto Main_Loop

; Motion Detection Interrupt Handler
; GP1=output to relay, GP4=output to LED
bsf GPIO,1 ; energize relay for 100 msec
call pause_100ms
bcf GPIO,1 ; de-activate relay

bsf GPIO,4 ; activate LED for 0.5 sec.
call pause_500ms
bcf GPIO,4

; online Delay Code Generator
; http://massmind.org/techref/piclist/codegen/delay.htm

; Delay = 0.1 seconds
; Clock frequency = 4 MHz

movlw 0x1F ;99998 cycles
movwf d1
movlw 0x4F
movwf d2
decfsz d1, f
goto $+2
decfsz d2, f
goto Delay_100
goto $+1 ;2 cycles

; Delay = 0.5 seconds
; Clock frequency = 4 MHz
movlw 0x03 ;499994 cycles
movwf d1
movlw 0x18
movwf d2
movlw 0x02
movwf d3
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_500

goto $+1 ;6 cycles
goto $+1
goto $+1

; Delay = 1 seconds
; Clock frequency = 4 MHz

movlw 0x08 ;999997 cycles
movwf d1
movlw 0x2F
movwf d2
movlw 0x03
movwf d3
decfsz d1, f
goto $+2
decfsz d2, f
goto $+2
decfsz d3, f
goto Delay_1sec
goto $+1 ;3 cycles


Step 8: Final Words.

This pic is one way to conceal everything.

Note - by using a micro-controller, the number of variations on this instructable are unlimited. You can place the speaker so it the sound emanates from behind your boss. Or, you can tie it into the company PA system. You can even have the system ping your computer and have a work related page pop up in 1/10 of a second so that any time that your ex-boss, or anybody else walks into your perimeter, there's always a spreadsheet, or technical document that you should be working on. And 24/7...anybody walking into your cubicle, or out of it, can say that you have your nose to the grindstone every second of the day. That makes you a high valued employee. You are a goddam workaholic.

Also, you don't really need the Fresnel lens. In fact, for boss-detection, it's better to remove it otherwise people inside your cubicle moving around will set it off. You can take the Fresnel lens off and put a 1 inch piece of PVC tubing (1/2 inch diameter from Home Depot) on the PIR detector and that will give you a very narrow field of view, such as directly at you doorway (assuming you have a door) but the sensor works just as well. It's range is about 5-10 feet without the Fresnel lens. You can also remove the PIR detector and using 3 wires, you can place the detector anywhere to make it concealed.

You can even buy a sound module for 6 bucks, and record your own sounds. You can use the international signal for "boss is approaching" which is clearing your throat. And you can change it every morning. Or record the sound of you typing feverishly, etc.

Here's a sound effect I made from that whoopee cushion, and ran it into my computer, edited it with Audacity, and used it for an Easy Button hack that I might put up one day.

Step 9: A Variation

Here's another boss detector based on the same concept. Also, somebody wanted a video, so I'll put up a video for this soon. The detector for this one is obviously a Robo Sapien mated to a motion detector from Home Depot. When motion is detected, the robot sends an IR signal to the bird cage where there is a hidden 38khz detector. The bird mechanism has several options. All options are individually selectable, but with everything turned on, the bird starts spinning, chirping, with a blinking LED. Also I added a superbright red LED mounted underneath that flashes 4 times so that you know somebody is coming without all the racket. This one also has a 30 second time delay, and you can disable the whole thing simply by lifting the pencil. The pencil has a magnet on the end which, when inserted into the bird feeder, enables the circuitry by way of a small magnetic reed relay. The only real difference in this system is that I didn't use the photocell trick. There's a quad op-amp in the motion detector, and I just tapped off the output pin of the final stage. I bought several of these bird things at a drug store because they were on sale for 5 bucks each. Then I added stones and vegetation in order to hide the IR detector, and made a little box out of cherry wood and varnished it to hide the extra AA battery I needed. The thing runs on 2 AA batteries, and is sound activated. I made it less sensitive to sound, and needed the extra battery because the 38khz detector I used needed at least 4.5 volts, which means 3 batteries. The motion detector was made to plug into a wall outlet, so I cut the big stuff off the circuit board and now it runs off of a 9v battery installed where the light bulb was located.

Here's a link to a video of this.




    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    41 Discussions


    10 years ago on Introduction

    I can't wait for the Whoo-pee cushion radio controlled improvised explosive device, for War!


    10 years ago on Introduction

    The title had me sitting here thinking, "Okay, so it's a fart detector!" Needless to say, I like this (motion activated farting device) better. I plan to make one that goes off when someone walks past the TV. Just for laughs...


    10 years ago on Introduction

    boss motion decetor.. I have wnated to build one these for ever in fact i cant tell you how many posts i have put up on here trying to get sem help with it .. I had the same idea.. of it toggling the screen when motion is deteceted.. are you able to make me one. I will pay for it ! i want to conceal it in a bart doll or a cube toy ... and then have it detect motion and toggle my screen ... email me so we can chat ... thanks Ryan ryan.wilson ( at) rogers.com

    1 reply

    Reply 10 years ago on Introduction

    How about going lo-tech and attaching one of these above your monitor, then rely on your peripheral vision and that excellent pattern-recognition device - your brain - to give the alarm?


    11 years ago on Step 2

    I gotta get me one of these. i bet i could use it to protect my favorite vinyl albums. That thing must have over a zillion uses (zillion isn't even a number)

    4 replies
    Mark1237James (pseudo-geek)

    Reply 10 years ago on Step 2

    It's not really a number, what the dictionary entry meant is that it is used to replace a specific large number.


    Reply 11 years ago on Introduction

    stop the foreign comments!would it be nice if i said "bu proje tam bir deli projesi seni herif"to you?


    11 years ago on Introduction

    YOU [censored]S! STOP THE "(removed by poster)" thing!

    I agree homeland security sucks. the US is all about the "proper procedure" regardless if there are lives on the line and every second counts. My word even paramedics are slow and incompetent. My dad almost died from his appendix rupturing and the paramedics just stood there calmly (all 4 of them who could barely fit in the room) and asked him questions my mom has already answered. The only advantage to being in the US is the freedom to kill and steal at your leisure. Yes, I live in the US, and no, I don't blame bush specifically, this started long before he was in office.

    um. wow. your either faking that and know ALOT about that stuff or your telling the truth. I'm guessing you telling the truth based off of how intelligent your idea was in this instructable.


    11 years ago on Introduction

    man good job on the flash im deeply impressed.. ironically i can play that song on drums.. me and my band used to play it at shows LOL!!! ppl where like wtf.. anyways good invention.. and sorry bout the chick thing..

    1 reply

    11 years ago on Introduction

    Well, firstly, I disagree with the war in Iraq. If the war didn't cost in human lives, then there wouldn't even be public opinion holding back Bush the Lesser. Get rid of him, get out of Iraq, and then 25 to 30 good American men won't have to die each month.

    Think about it - if the situation was reversed, would you *ever* give up? Nor will they!

    The problem with such asymmetric warfare (30 a month on the US side, vs. 30 a day on the Iraqi side) is that the places you are occupying have no option but to turn to terrorism and guerilla warfare. It's evolution, because anyone dumb enough to try to stand and fight is dead already. No-one stands and fights an M1 Abrams with a few stones if they can help it. The only ways to win are to kill everyone, or leave. The killing everyone option seems not to be working, so why not use the other option, and leave?

    With that out the way, on to the topic at hand.

    The new shaped charge hand grenades are stick grenades, with a small trailing 'chute, to try and get them hitting head down onto the armour. There are some great videos of them on YouTube. Genuinely shaped charges, and as such they have to interface the target armour at the right distance and angles to be effective.

    RPGs are totally different things, warhead aside.

    The sticky bombs you mention were invented by the British, and they were very sticky. They weren't shaped charges, though, they were simply a HE head that exploded. To be honest, they weren't very effective, but they were designed for the Home Guard guys as much as anything, to give them some hope of beating a tank. But since they weren't even issued with ammo, generally...

    The electrical defence is actually quite simple, but genius. Insulate a metal plate 1" off from the armour, and whack a big capacitor across them. Charge it up.

    When an RPG or other shaped charge hits the plate, the charge fires a (usually copper) slug of molten metal through the first plate at around 3000m/s. Think of this as your fusewire. As it reaches the actual armour and starts to penetrate, the capacitor discharges very rapidly through the conductive path opened up. This turns our fusewire into a blown fuse, and the light spatter of molten metal that hits the armour is, of course, easily stopped.

    Again, have a look on YouTube, there is a video on there of a UK light armoured car being hit 10+ times by RPG7's with almost no effect.

    1 reply

    11 years ago on Introduction

    Yeah, fine with me if you use it... But instead of the horrid buzzer sound you might want to use a pezio siren of a relay to get a nice sound all together!