Hardware Reference
In-Depth Information
When you run this sketch, the color picker should appear just as it did in
Chapter 6. Click a color. It will be transmitted to the remote Arduino, and the
RGB LED will become the color you've picked. The values transmitted should
show up in the Processing terminal as well. At this point, you've completely
tested that your XBees can communicate back and forth with a computer. In the
next section, you use the techniques that you developed here to communicate
directly between two Arduinos.
TalkingwithAnotherArduino:BuildingaWireless
Doorbell
Facilitating wireless communication between Arduinos is extremely useful.
You can use multiple Arduino nodes to create sensor networks, transmit con-
trol commands (for a radio-controlled [RC] car, for example), or to facilitate
remote monitoring of an electrical system. In this section, you use two Arduinos
equipped with XBees to make a doorbell for your home, apartment, or office.
A remote Arduino at your door will respond to button presses from a visitor.
When a visitor “rings” the doorbell, your other Arduino will light up and make
sounds to indicate that you have a visitor. You might want to watch the video
demo of the system in action at www.exploringarduino.com/content/ch11
before you build the project.
SystemDesign
The system you'll build consists of two Arduinos. Each will have an XBee shield
and a radio. One Arduino can be placed outside of your home or apartment for
people to press the button, and the other can be placed anywhere inside to alert
you when somebody rings the doorbell. The range of the two units depends
on the type of XBees, how many walls are between the two units, and other
environmental factors.
Because just making a generic buzzer is boring, the receiving Arduino will
flash multicolor lights and alternate tones to get your attention. You can easily
customize the system to add your own sound effects. While the outdoor system
in this example will be a simple pushbutton, you could replace the pushbutton
with an IR sensor, light sensor, or occupancy sensor to automatically determine
when somebody is approaching.
When designing a multifaceted system, it's good engineering practice to devise
a high-level system design, such as the one shown in Figure 11-19. The level of
detail that you use when designing such a diagram is up to you. Designing
a simple diagram like the one shown here will help you to devise a plan for
building each part of the individual system.
 
Search WWH ::




Custom Search