My wife asked for us to have an air freshener installed in the bathroom. I don’t like the plug in types, even if they don’t burn your house down. At my office we have air fresheners which run on a schedule, or maybe run 24×7, but seem to spray every fifteen minutes. I found a model on Amazon which was similar:
This would probably work OK an in office, where you program it 9-5 M-F, but at home the schedule is not so easy. For one, we don’t want it going off when we’re asleep or not home. That’s trivial to set up a home automation to do that, but I could find no air fresheners which would connect to SmartThings.
I decided to order the device and hack the motor to be controlled via SmartThings. Opening the device up, I found it ran on 3.2v via 2 AA batteries and had a simple PCB with two wires for the battery and two for the PCB. The PCB even had pads which I assume one could reprogram the controller. If the controller had a radio, my approach my have been to try to hack it. However, I assumed it didn’t, so I unsoldered the green(-) and yellow(+) wires from the motor.
It’s difficult to have a wifi device connected via batteries, so I decided I’d convert the device to run off of 5V micro-usb. This was easily powered via an ethernet cable and POE adaptor dropped down from my attic.
Fortunately, the battery compartment had a generous amount of space. I decided to use the Wemos D1 Mini because of its small size and I flashed the Konnected firmware on. Using Konnected allowed for quick integration into SmartThings.
Once I had the software / hardware working, I mounted it on the wall. Because SmartThings has connections to Alexa and Google home, it was easy to get the voice assistants to activate the air freshener as well.
I created a basic piston to run it once an hour when my wife is home and not asleep. I also setup a routing to run it once when she first arrives home.
Parts List:
- SVAVO Automatic LCD Fragrance Dispenser $27.99
- Air Wick Pure Freshmatic 2 Refills Automatic Spray, Lavender & Chamomile $7.98
- IZOKEE D1 Mini NodeMcu Lua 4M Bytes WLAN WiFi Internet Development Board $4.33
- One ceramic capacitor from kit $0.02
- One diode from kit $0.05
- ELEGOO 6PCS 170 tie-Points Mini Breadboard kit for Arduino $1.16
- Breadboard Jumper Wires Male to Male Multicolored Dupont $0.12
- AuviPal Gigabit PoE Splitter $13.00
- uxcell AC 300V 10A 4 Pins PCB Terminal Block Connector $0.49
- Resistor from kit $0.03
- 1 Pair Right Left 90 Degree Angle Micro USB Male to Micro USB Female Adapter $2.43
- 2N2222 from kit $0.01
I spent $35.97 on the air freshener and sprays, $21.64 on the parts for a total of $57.61. Most of the cost was my POE power supply and adaptor.