FIGURE 5. COMMERCIAL PHONE DIALERS SUCH AS
THIS ONE MAKE IT EASY FOR YOUR HOME TO CALL
YOU AND YOUR NEIGHBORS WHEN AN INTRUDER
HAS BEEN DETECTED.
Even if you are just a novice, don’t think that these
features are out of your reach. Controlling servomotors,
for example, can be handled easily in RobotBASIC by
using a USB-based servomotor controller. Once you set
up the controller as a virtual serial port, use RobotBASIC’s
SerOut command to send commands to the controller
with the desired positions for each servomotor, and that’s
it. The controller will continue sending the necessary
pulses to hold each motor’s position until commanded
differently.
Since it is easy for RobotBASIC to communicate with
microcontrollers, you can incorporate them in your system
FIGURE 6. THIS BASIC SECURITY SYSTEM
INCLUDES A SIMULATION THAT MAKES IT EASY
TO TES T YOUR IDEAS.
50
August 2012
in a variety of ways. Suppose you want your intelligent
security system to monitor the windows in a detached
garage or outbuilding, and you don’t want the hassle of
running wires between the house and the remote
structure.
One easy solution would be to program a
microcontroller to monitor the garage windows and
transmit the information to the system PC using a
Bluetooth link. Once you interface a serial Bluetooth
transceiver with the microcontroller and a USB Bluetooth
transceiver with the PC, RobotBASIC has commands to
handle all the communication.
Even with all these improvements, our intelligent
house still has many potential options. We could interface
photoresistors and perhaps thermistors in appropriate
rooms so the system can utilize that data, as well as clock
and calendar information to determine when drapes
should be opened or closed (in order to minimize air
conditioning costs in the summer or to make an empty
home appear to be occupied).
Remember, the cost of building a custom security
system does not have to be an issue since you have the
option of dispensing with standard monthly monitoring
fees by interfacing with a commercial phone dialer, such
as the one shown in Figure 5.
To help you get started, the complete code for a basic
alarm system can be downloaded from
www.RobotBASIC.com. To make it easy to test your ideas,
the program includes a working simulation (see Figure 6
for a sample output screen) that allows you to see how
the system responds to sensory data (you can trigger
different zones by clicking them with the mouse). Such a
simulation can greatly simplify the development of your
own customized system.
One point should now be clear. If you are truly
interested in designing a custom security system or even a
fully intelligent house, there is nothing standing in your
way. Remember, you don’t have to do everything at once.
After you get a basic system operational, you will often
find that software enhancements alone can boost its
functionality. If that’s not enough, just add additional
hardware over time, and expand and enhance your
software to implement the features you desire.
SUMMARY
Implementing a custom security system for your home
can be far less intimidating than you might think,
especially with the right software. This article guides you
through the basic principles you need to get started
before discussing enhancements that can turn a simple
alarm system into an intelligent house. NV