This is something I’ve been working on for months – lots of failed attempts, but this one appears to be working. It’s a car proximity sensor for my smart house. When the house is unoccupied, Watchdog turns off the AC/heater to save energy. When we get home, Watchdog automatically kicks the air back on, but sometimes it is too hot/cold. What I needed was a way for Watchdog to anticipate my return when I was away.
I evaluated several wireless network devices that claimed to be “long range”, but fell far short of my needs for this project. In the end, I chose a pair of Digi Xbee Pro XCS radios with a U.FL antenna for maximum range. Just getting these radios to communicate with each other proved to be a challenge. The XCS line is very different than the other Xbee Pro line and many of the registries and configuration parameters do no exist. The online documentation was dizzying and the community was not a lot of help because they were mostly discussing other Xbee Pro lines.
My next challenge with this project was getting enough power to these radios to get the range that I needed. For the PC-connected Xbee, I chose the Parallax Xbee USB Adapter board. No modification to this circuit was necessary. For the car-mounted Xbee, I chose the Sparkfun Xbee shield to sit on top of an Arduino Uno. This shield had major problems and I ended up making major modifications. I had to bypass a diode on the board just to get it to transmit properly. Also, I replace the 3.3V voltage regulator with one that allowed more current (500mA).
I already had a PC mounted to the wall of my upstairs corner bedroom running the SARAH interface and not doing much else, so I tasked it to also run the new WDCarProximity module for Watchdog. The app queries the Watchdog database to wait until the house becomes Unoccupied. Once that happens, it starts transmitting pings every 1 second. The 5 minute delay I used to detect that the house was unoccupied is enough time for the car to depart and get out of range, so I rarely get false triggers. Once a response is received, the module notifies Watchdog, and Watchdog automatically adjusts the thermostat in anticipation of my return.
I found a nice, slim project box for the PC-connected Xbee at Frys Electronics. I used the Sparkfun Arduino project box which gives me plenty of room for the Xbee Shield, and room to mount the antenna. I ran a 25 foot USB cable from the PC in my upstairs bedroom around the room and to the large window. I mounted the Xbee project box inside the window sill so that it was protected from the elements, and the signal has only glass to pass through to get outside. Having it mounted in a high location gave me better range due to fewer obstructions. For the car-mounted module, I just used a hook-and-loop fastener and mounted on the inside of the center console of my wife’s car. that worked fine for a while until it got nailed by an Arduino-seeking purse, so I moved it up to the dashboard (which actually helped with the range). I powered the car-mounted module directly from the cigarette lighter connector in the car (nice that the Arduino can handle the 12V). The car automatically turns off the power to this port when the ignition is off, so I don’t have to worry about it draining the battery.
My goal was to have the radio communicate at a range of at least 1 mile (about 2-3 minutes of travel time), although a longer range would give the Watchdog more time to adjust the temperature before I arrived home. After months of testing, it was clear that there are certain “hot spots” and “dark spots” where the transmitters could communicate as the car approaches the house. I learned that the frequency used by the Xbee modules is not impacted by weather, so only had to deal with obstructions. The maximum distance I successfully received a ping was about 4.1 miles. I can consistently get pings at 1.25 mile out regardless of the route I take home.
Finally, I updated Watchdog to change the welcome home greeting when it detects car proximity. Now when we enter the house it says, “Welcome home, I’ve been expecting your return. While you were gone you missed 2 phone calls, 1 visitor and the mail was delivered”.
Dec, 2013 Update: See this link for a new, smaller car transceiver.
Initial mounting location inside the car. (It’s not usually this clean)