Thursday, December 24, 2015

Air Freshener "DRM"

A family friend recently bought a refill for their automatic air freshener and after one spray a warning light came on to indicate that it wasn't an authentic refill.  After that it wouldn't work any more.  To find out what's going on I bought my own to do a tear down and reveal the secrets of the big freshener cartels. :-)

Air Freshener
AirWick Air Freshener
The kit from the store comes with the automatic sprayer, an authentic refill, and batteries.  You put the can in the sprayer, insert the batteries and turn on the device via a dial on the back.  The dial also allows you to control how often the spray goes off.

Air Freshener
Battery and Fragrance Spray
I also purchased a generic replacement can that causes the problem.  It's the same size as the authentic can, and does work at least once in the sprayer before being identified as inauthentic.  In early versions of the sprayer these cans were interchangeable without causing a problem.

Air Freshener
Replacement Fragrance
A label inside the sprayer describes the problem that I'm investigating.

When the can is removed, you can see the red lever that pushes down to activate the sprayer.  When a non-original can is used, the red indicator light that goes off is located deep in the case near this lever.

Actuating Lever
After looking at this part of the sprayer closer you can see a small slot in the image below next to the black smudges.  It's hard to make out, but if you know your electronics you can see that they've added a reflective light sensor on a small circuit board.

light sensor
Light Sensor
But what's it sensing?  It's pretty obvious what they're doing when you look at the two nozzles.  The authentic nozzle has two black marks on the shaft while the other one doesn't.  When the nozzle is depressed, The two black stripes pass the light sensor.  The sequence of events that qualify as authentic is unclear.  Is the device looking for rising edges, falling edges or a combination of both on the light sensor?

AirWick Nozzle with black marks.  Replacement without marks.
I wanted a closer look at the sensor so I pulled the rest of the sprayer apart.  The small green motor shown below is what drives the gears to control the lever that depresses the spray can.

A doubled sided board containing a chip on board device and a lot of discrete components controls the sprayer.

Control PCB
PCB Bottom
In the image below you can see a 4 pin header that's connected to a secondary board containing the light sensor.

The sensor is wedged in placed by a plastic retaining guide.

Light Sensor
Add caption
The sensor is the standard two part reflective type.  It's hard to see, but the device below is divided into two parts.  One half is an infra-red LED and the other half is a sensor to detect any reflected light from the LED.

Light Sensor

So everything is now clear.  When you insert a non authentic can and turn the device on, it presses the can the first time, as it does this it tries to detect the the black marks on the stem of the nozzle.  If it can't find them it will stop working.   To make it work again, the sprayer needs to be turned off and on again.

How do you get around it?  Well, you can just get a marker pen and draw two lines on the stem of the other nozzle.  I should point out that the nozzles aren't interchangeable as the size of the part it connects to on the can is different.  The nozzle with the marks has a larger internal shaft.  In theory you could also slip something like a small piece of plastic tubing over the part that comes out of the can before attaching the nozzle to space it out.  That would be hard to find though as it's a very specific size.

Another way to solve this would be to program a cheap microcontroller to only power the device at specified times.  This circuit could be powered by the batteries that the sprayer uses.  After power is restored the sprayer would spray the can and then fail.  After the fail you would then cut power again as the red indicator light would keep flashing and waste power.  With appropriate hardware the restart could also be triggered by light, sound, or remotely via a phone.

I just find it a bit strange that they decided to put so much effort into something that's ultimately easy to bypass.  Can't the generic cans just go and get their own sprayer made?  It's not a complicated piece of equipment.  Then again, I'm not an insider in the high stakes world of automated air fresheners.