The idea struck me when my wife always complained about the house stinking when she got off of work. Well, my geek side kicked in and I can freshen the house from any computer connected to the internet via IRC (internet chat relay).
NOTE: I know the circuitry is bad; and the op amp isn’t needed. I wanted to use what I had lying around. The only thing I’m concerned with is that it works.
The complete build took me about 5 hours, and the code took 20min.
I went to the local Walmart and bought a $7 Glade Sense and Spray. (Figure 1-1)
The next step was to rip it apart and find the pins for the push button that triggered it to spray. The pin needed is labeled R18 or R29 something like that. (Figure 1-2)

Next build a circuit to read an arduino pin and trigger it to spray. I used a relay to “close” the circuit/ act as the push button for the Glade’s circuit board. The relay is powered with a NPN transistor that was suposed to read the HIGH value from the arduino, but the value wasn’t a high enough voltage to trigger the NPN; I used an Op Amp to increase the voltage from the arduino to trigger the NPN to power the relay to turn the Glade…Spray on. Wow, that was a mouth full… It is a simple circuit.
EDIT::: The op amp isn’t needed. I found out I had the transistor and relay set up wrong thanks to BenF from the arduino forum:::(Figure 1-3)

Now for the code. First the Arduino Sketch. I’m using an ArduinoBT board.
int buffByte = 0; int cntrlPin = 13; void setup() { Serial.begin(115200); //BT requires baud 115200 pinMode(cntrlPin, OUTPUT); digitalWrite(cntrlPin, LOW); } void loop() { if (Serial.available() > 0) { buffByte = Serial.read(); //ASCII 65 is equal to "A" if (buffByte == 65) { digitalWrite(cntrlPin, HIGH); delay(100); digitalWrite(cntrlPin, LOW); } } }
Now for the IRC bot. Written in Python 2.6 I’m not going to explain what goes on here, its pretty self explainotory
import serial, socket, time, string, os os.system("color 0a") #My bluetooth COM port for the Arduino is COM9 #found in device manager s = serial.Serial('COM9', baudrate=115200) chan = 'BotTestz' ircsite = 'irc.freenode.net' port = 6667 irc = socket.socket() irc.connect((ircsite, port)) print irc.recv(1024) n = 'NetBotV1' irc.send('NICK %s\r\n' % n) irc.send("USER Ohlook itsnotmy blahh :Realname\r\n") time.sleep(4) irc.send("JOIN #%s\r\n" % chan) readbuffer = '' while True: readbuffer = irc.recv(1024) temp = string.split(readbuffer, "\n") Check = readbuffer.split(":") print readbuffer #if pinged, respond with PONG if "PING" in readbuffer: irc.send("PONG :%s" % Check[1]) #Write ASCII char 65 to the COM port #if smellGood command was sent if "^smellGood" in readbuffer: s.write("A")
We don’t understand a word you have written, but we are very proud and fascinated with your results. Keep up the good work. You have certainly found your future.
Stay in touch
Lol, well at least they can use the internet. I’m guessing your family is Greek?
Anyway, I’ve used air fresheners for all kinds of stuff and am learning Python, so nice hack! Really was trying to figure out if there is a way to bypass the 30 min lockout without using an Arduino etc…
Greek? Where did you get that idea lol?
Yeah, just patch into the “spray” button and you can use the Arduino to “press” it. Set up your own timing system or do like I did and connect it to an IRC channel lol.
awesome keep up the great work….you made hackaday!
love that you care about what i am complaining about. lol. didn’t expect you to do anything about it. you have such awesome ways of solving problems and having fun doing it. love you!!!
very nice build. Add a web cam and you have a instant ambush. Although they can be dangerous all on there own, http://joelchrisman.blogspot.com/2010/07/killer-air-freshener_07.html
Really cool! Its amazing what you can accomplish with an Arduino, Python and some magic!
haha, cool. I did something similar a couple months back, creating a scent-based eXtreme Feedback Device for Continuous Integration builds. At least YOU got around to posting about it. 🙂
Keep it up man… it will all payoff one day…
Very cool work and awesome that your family is loving what you’re doing. Thanks for sharing–cheers!
that guy is right… just add a webcam and replace the spary with the spray used by police force… :))
excuse my bad english 😀
any idea how to over ride the motion based controls on the Glade Sense & Spray Motion Sensor?thanks
The simplest way would be to cover the IR LEDs with some electrical tape or paint them directly to prevent them from working. Then the only way to trigger it is either push the button or the patched wire I use for the trigger.
There are remote controlled air fresheners on the market. I imagine that you could hook up one of these remote controls to your iPhone or something to remotely control the air freshening in your house, much like you can control your security system with some apps. I suppose someone will read this comment and make a million dollars.
That said, I applaud your effort. This is awesome.
please can someone help me with any material or writeup i can use to write on a some work on the topic “software in the implementation of indoor air freshening” thanks alot..
I am in desperate need of bypassing the lockout feature this air freshener has that only allows it to spray by motion detect for 30 minutes, Its for a Halloween project I’m making. Do you know how I could do this? Is there any way to email you? Thanks
I haven’t worked with the air-freshner in a while now, and honestly don’t know where it is at this point. If I knew what you where trying to do, I might be able to help you come up with another way of doing it?
It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog! I guess for now i’ll settle
for book-marking and adding your RSS feed to my Google account.
I look forward to new updates and will talk about
this site with my Facebook group. Talk soon!