to reach from the Wisp to your Arduino board.
Connect one wire to the upper left MOSFET lead, and
connect the other to the board contact nearest the
lower right corner (Figures C and D). Take care not to
create short circuits by bridging the MOSFET’s pins,
and inspect your work carefully. The MOSFET is small,
so you may need a “helping hands” tool to assist.
Connect the Arduino’s digital output pin D2 to
the wire connected to the MOSFET, and connect
the Arduino’s ground pin to the other lead from the
Wisp board (Figure E). That’s it for the hardware
mods needed to control the Wisp.
2. Program the Arduino.
I used an oscilloscope to probe the Wisp onboard
controller’s output, and found that it drives the
atomization process by generating a 150MHz signal
that lasts about 10 milliseconds. We’ll program our
Arduino board to mimic this signal. The following
Arduino code simulates the Wisp’s signal pattern,
except that it tells the piezoelectric disc to “puff”
every 2 seconds instead of every 10–15 seconds.
Reattach the fragrance bottle to the Wisp, then
upload and run the code, and if you’ve wired everything correctly, you should see white puffs coming
out of the atomizer immediately.
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);
}
In the code, the DDRD and PORTD keywords configure the Arduino’s D0–D7 pins as outputs to be controlled directly, by using the Arduino’s port manipulation commands. The nested loops in the atomize()
function toggle the D2 pin (specified by passing in
the value 0x04) on and off a total of 2,000 times, with
a very short pause after each change.
The values I chose for the delay loops make the
Arduino’s output roughly match the Wisp controller’s,
but with a shorter, 2-second delay between puffs.
You may have seen other code that controls the
Arduino’s digital outputs by calling digital Write(), but
this would be too slow to generate a 150MHz signal.
You can experiment with setting the loops to
count up to values other than 2,000 and 12 to see
how this changes the atomization process, but note
that shorter delay times may not give the circuit’s
3,300μF capacitor enough time to fully recharge
between puffs, which will result in significantly
decreased vapor output.
3. Substitute your own fragrance.
As interesting as it might be to have a computer-controlled air freshener (not very, IMO), the real
fun begins when you replace the unit’s original
fragrance with something more meaningful or
exotic, such as, say, the smell of freshly baked
cinnamon buns, or hazelnut coffee.
To do this, you need about ½oz of an essential oil
in the fragrance or aroma of your choice. The design
of this bottle makes it difficult to remove the cap,
but it can be done. I used a small, flat-blade jeweler’s
screwdriver to pry around the cap, pulling it away
from the neck and breaking the glue that attached it.
You can also drill a small hole in the top of the bottle.
Whichever method you use, you should clean the
bottle with rubbing alcohol and let it dry, to remove as
much of the old scent as possible. Once you’ve added
your own fragrance, reattach the cap to the bottle
with hot glue so it will twist back into place in the Wisp.
4. Further development:
Create an aroma orchestra.
Because the Arduino’s PORTD value lets you write to
all of its digital outputs at the same time, one Arduino
can control up to 6 Wisps simultaneously. You
simply connect each Wisp to a different output pin
and pass different values into the atomize() function.
Using the Arduino programming environment’s
Serial Monitor feature, you can send keyboard
Make: 163