Hacking the Glade Wisp

Hacking the Glade® Wisp®

Build an Arduino-controlled Aromatic Atomizer!

This article describes how, for less than $10, you can build an easy to make, computer-controlled "aromatic atomizer."  My design converts a Glade "Wisp" into a scent output peripheral you can use in all sorts of practical and artistic projects.  The Wisp runs off a single AA battery and uses a specially-designed, piezoelectric disc to atomize and disperse an aromatic oil in short, smoke-like "puffs."  This article will show  how to modify a Wisp so it can be controlled by an Ardunio board using only a few lines of code.

With some additional work, you can also adapt many of the ideas in the book "Making Things Talk" to create more adanced, scent-enabled applications, such a network-controlled aroma generator (send an fragrance-based "mood" message to someone!), or even create your own home theater version of "Smell-O-Vision".  It's all up to your imagination and ingenuity.

Why Hack an Air Freshener?

My encounter with the Wisp began when my 11 year old daughter, Belle, wanted to create a gadget to amuse her dog, Panda, and needed a way to dispense different scents for Panda to sniff.  Since I had no idea how to control dispensing fragrances, we took a trip to the local pharmacy to check out the various air freshening products.  Most of the products seemed to use heat and/or fans to diffuse fragrances but one, the Glade “Wisp",  claimed to use a "microchip" to automatically “puff” aromatic compounds into the air.  Intrigued, I decided to buy one just to see what made it tick.

To duplicate this project, you'll need the following:

The first step is to unpack the Wisp (see image below) and get familiar with how its maker intended it to work.  Please take the time to screw in the included scent bottle, remove the red blocking tab from the battery and watch the unit in operation for a few minutes before you go tearing it apart.  This will give you a reference for normal operation so you'll know what to expect from your modified unit.  Use a desk lamp to illuminate the Wisp from the side and hold a dark piece of paper behind the unit for contrast and you should be easily able to see the white smoke puff out from the top of the unit about once every 10 to 15 seconds.  If you're curious about how the Wisp works, I recommend you take a look at the patent "Delivery system for dispensing volatiles" issued to S. C. Johnson & Son.

Disassembly

OK.  Now let's rip it open and see what's inside.  My first attempt at disassembling didn’t go very well until I just got a bit more physical and pried the top cover off of the base.  As you might be able to see in figure below, the top shell is held to the base with snap fit plastic tabs that ring the cover.  Since the puff adjustment switch sticks out on one end, I recommend that you start prying from the other end so the tabs sort of “unzip” in the direction of the switch end.  I used a small, flat blade screwdriver, but a butter knife might work as well.

The base and shell are rather flexible and all the circuit components are rather loosely attached, so I don’t think you can damage it unless you happen to slip and rip out the red, or black wires that attach the circuit board to the piezoelectric atomizer, which is just to the right of the PC board, as shown below.

Once you have the cover off, take a closer look at the small, green PC board.  You're looking for a square block of black epoxy with three connection leads coming out of one side and one big lead on the opposite side (see the closeup image below.) It will probably be marked "3055L" and is a power MOSFET (a type of transistor switch) that's used to drive a transformer (on the reverse side of the board) that boosts the battery voltage up to the higher voltage needed to power the piezoelectric atomizer disc.

The first step in the mod, is to use an X-acto-type knife to cut the trace that connects the MOSFET to a control microchip that's located under a bigger, circular blob of epoxy (just above the MOSFET in the picture above.)  Note: if you look closely at picture, you can see where I cut this trace just to the upper right of the fatter connection lead coming out of the MOSFET.  Once this trace it cut, it will let the Arduino send a signal to vibrate the piezoelectric disc.

The next step is to cut 2 lengths of 24 gauge hookup wire long enough to reach from the Wisp to your Arduino board.  Connect the wires as shown in the photo above while trying to be careful not to create any short circuits by bridging one of the MOSFET's pins to another.  The MOSFET is small, so you may need a "helping hands" type of magnifier to assist.  Inspect your work carefully once you're done.  If everything looks correct and matches the photos above and below, then that's it for the hardware mods needed to control the Wisp.

The modified Wisp is then connected to an Arduino Nano running software that generates a 150,000 KHz signal that drives the atomization process.  The wire you connected to the MOSFET connects to the Arduino's "D2" digital output pin and the other line will connect to the Arduino's ground pin, as shown below.

The following Arduino code simulates the signal normally output by the Wisp's on-board microchip, except that it commands the piezoelectric disc to puff out some fragrance every 2 seconds instead of every 10-15 seconds.  If you've wired everything correctly, you should see white puffs coming out the top of the atomizer as soon as you run the code (remember to attach the fragrance bottle.)

void setup () {

  DDRD = 0xFF;

}

void atomize (char pins) {

  unsigned int ii;

  char kk;

  while (digitalRead(8) == HIGH)

    ;

  for (ii = 0; ii < 2000; ii++) {

    PORTD |= pins;

    for (kk = 0; kk < 12; kk++)

      ;

    PORTD &= !pins;

    for (kk = 0; kk < 12; kk++)

      ;

  }

}

void loop() {

  atomize(0x04);

  delay(2000);

}

One thing to note is the use of the DDRD and PORTD keywords in the code.  These commands are used to directly configure the Arduino's D0-D7 pins as outputs, then directly control them.  You may have seen Arduino code that uses the digitalWrite() command to output to the Arduino's pins, but digitalWrite() is too slow to generate a 150,000 kHz signal, so I had to use the Ardunio's Port Manipulation commands, instead.  In effect, the value of  the "pins" parameter that's passed to the atomize() function and written to PORTD is used to turns on one, or more of the Ardunio's D0-D7 pins.  Writing a value of 0xFF to PORTD sets D0-D7 to a logic HIGH and writing a value of 0x00 turns them all off.  The 0x04 value passed to atomize() in the example above turns just the D2 pin on and off.

The program uses a repeat loop in atomize() to toggle the D2 pin on and off a total of 2000 times.  After turning the pins on, or off the program uses a set of delay loops to introduce a very short pause after each bit change.  The code shown above tries to mimic the signal I observed coming from the epoxy-potted microchip (I used an oscillosope to monitor the unmodified Wisp's signal while it was operating.)  When the switch on the Wisp was set to the longest marking (strongest setting), I saw the microchip generate a 150,000 kHz signal that lasted for about 10 milliseconds, then stayed off for about 10-15 seconds.So, I chose values for these delay loops that, combined with the overhead of the repeat loop, causes the Arduino to produce a signal that roughly matches this except that I used a shorter, 2 second delay between puffs. 

Once you have this test code working, feel free to experiment with adjusting the various loop control values to see how this changes the atomization process.  One caveat about this shorter delay time, however, is that the power that feeds the MOSFET with the voltage it needs to drive the transformer comes from a large, 3300 ufd capacitor that needs a few seconds to recharge after each puff is atomized.  So, you may notice a significant decrease in smoke output if you try to make the value passed to delay() too short. 

Next, Replace the Packaged Fragrance with Your Own!

As interesting as it might be to have a computer-controlled air freshener (not very, IMO), the real fun begins when you replace the original fragrance provided with the unit with something more exotic, such as, say, the smell of freshly baked Cinnamon Buns, or Hazelnut Coffee.  Or, perhaps you'll want to go in a different direction and select a fragrance with a romantic association.  This is where you get to start using your own imagination and creativity to create something unexpected.

To do this, you first need to select and obtain about 1/2 an ounce of an "essential oil" in the fragrance, or aroma of your choice.  A good place to start is to Google "fragrance oils."  You can also investigate sellers of candle, or soap making supplies, as these companies sell a wide variety of fragrances and aromas you can use.  I have no specific recommendations to make here, as the number of choices available is just too vast.  

The design of the fragrance bottle included with the Wisp makes it a bit difficult to remove the cap, but it can be done.  I used a small, flat blade jeweler's screwdriver to pry around the cap to pull it away from the neck of the bottle and break the hold of the glue attaching it.  However, you can also drill a small hole in the top side of the bottle and use this to extract out the old oil and then fill it with new.  Whichever method you use, you'll probably want to first let the bottle air dry then clean it with rubbing alcohol to remove as much of the old scent as possible before you add in a new one.  Once you've added your own fragrance, you can use a bit of hot glue to reattach the cap to the bottle so it can twist into place in the Wisp. 

Create an Orchestra of Fragrance

Since port manipulation can write to all the PORTD bits at the same time, you can make the Arduino control up to 6 Wisps simply by connecting each one to a different output pin and passing a different value for "pins" to the atomize() function (Note: you should avoid using pins D0 and D1, as these pins share their function with the Ardunio's serial port.)  For example, setting the value of pins to 0x18 would trigger Wisps connected to pins D3 and D4.

The following code reads a character from the Arduino's serial port and uses the character to select which of 4 different Wisps to should emit a puff of Fragrance (you can use the Arduino programming environment's Serial Monitor feature to send characters to the Arduino board.)  Sending the character '2' commands the Wisp connected to pin D2, sending '3' commands pin D3, and so forth.

void setup () {

  DDRD = 0xFF;

  Serial.begin(9600);

}

void atomize (char pins) {

  unsigned int ii;

  char kk;

  for (ii = 0; ii < 2000; ii++) {

    PORTD |= pins;

    for (kk = 0; kk < 12; kk++)

      ;

    PORTD &= !pins;

    for (kk = 0; kk < 12; kk++)

      ;

  }

}

void loop() {

  char cc = Serial.read();

  switch (cc) {

  case '2':

    atomize(0x04);

    break;

  case '3':

    atomize(0x08);

    break;

  case '4':

    atomize(0x10);

    break;

  case '5':

    atomize(0x20);

    break;

  }

}

To send a serial command, first load the code to the Arduino board, then click the "Serial Monitor" button (it's the rightmost button at the top of the Ardunio's development environment.)  This should display a set of controls near the bottom of the window.  Make sure 9600 baud is selected, then type a number (2-5) into the text box and press "Send."  This should trigger the Wisp connected to the matching pin (sending '2' controls D2, '3' controls D3, etc.)

By using a variation of this code, you might program a set of units to play out a "soundtrack" of aromas as pictures of different foods appeared on a screen (a small fan to gently blow the aromas toward the audience might be helpful here.)  However, again, it's up to your imagination how you choose to use this technology.  Belle and I will be busy working on the device she's designing for Panda, but we hope you will have fun with this idea, too!

Text and All Photos Copyright Wayne Holder, 2008