Выбрать главу

Now just attach your project to your desired location, preferably one with 360-degree visibility, and start blinking your message. Figure 10-18 shows the project fixed to my zombie-proof shed.

Figure 10-18: Installing the Morse beacon

If you want to conserve power, only use your beacon at night, when it is most likely to be spotted. But beware: popular culture gives us mixed messages on whether zombies are attracted to flashing lights. You may want to reinforce your stronghold before sending out messages, just in case.

In Chapter 11, we will continue with the theme of communication. For the final project of this book, we’ll build a pair of haptic communication devices that will allow you and a fellow survivor to communicate silently, without alerting zombies to your presence.

11

HAPTIC COMMUNICATION

If you’re out on a supply run, then you’ll definitely want this silent communication device, which uses trembling buzzer motors and radio modules to send two-way messages. With this final project, you can communicate without attracting unwanted attention.

PROJECT 20: SILENT HAPTIC COMMUNICATION WITH ARDUINO

The problem with walkie-talkies is that, as the name suggests, they require talking. Zombies have very acute hearing for human speech and will easily home in on any desperate request for backup that you shriek into a walkie-talkie. This is where a silent two-way haptic communication device comes into its own (see Figure 11-1).

Figure 11-1: “When the sign said ‘press for attention,’ this wasn’t what I thought it meant!”

Haptic is just a fancy way of saying “relating to touch,” and instead of making noise, the devices you’ll build in this project will vibrate like a cell phone. You will make a pair of these haptic devices, one of which is shown in Figure 11-2.

Each device has a push-button switch and a small buzzer motor of the sort you find in cell phones. When you press the button on one handset, it causes the buzzer on the other handset to vibrate, and vice versa. The whole thing is powered by a 9V battery.

Then when you are out and about, you can get in touch with your partner using a set of prearranged signals: one short buzz means, “I’m OK”; one long buzz means. “Come quickly, I’m about to be eaten!” In your free time (which has probably increased now that your old school or office is full of zombies), you could even memorize the Morse code you used in “Project 19: Arduino Morse Code Beacon” on page 196 and send more detailed messages.

Figure 11-2: A haptic communicator

WHAT YOU WILL NEED

To make this pair of haptic communicators, you’ll need the following parts:

ITEMS

NOTES

SOURCE

Arduinos

2 x Arduino Uno R3

Adafruit, Fry’s (7224833), SparkFun

Protoshields

2 x Arduino Protoshield PCB

eBay (Arduino code: A000077)

Header pins

Header pins 64 way in total (for 2 handsets)

Adafruit (392), eBay

9V battery leads

2 x Arduino 9V battery leads

Adafruit (80), eBay

9V batteries

2 x PP3 batteries

Hardware store

R1

2 x 1 kΩ resistor

Mouser (293-1k-RC)

Transistors

2 x 2N3904 NPN bipolar transistor

Adafruit (756)

Vibration motors

2 x 5V or 3V vibration motor

eBay

Tactile switch

2 x tactile push switch

Adafruit (504)

RF modules

2 x NRF24 RF modules

eBay

Assorted hookup wire

Stranded wire

Wire

Insulated solid-core wire for making PCB connections

You might also want to enclose your communicators in plastic boxes to protect them from the elements. If you choose to do so, then you will need to find something big enough to contain the Arduino, protoshield, and battery. It will also need a hole so that you can press the button and add an on/off switch.

Electronically, this is probably the most complicated project so far. You might struggle to find all the parts after a zombie apocalypse, as some, like the vibration motors and the RF modules, are best bought off eBay or Amazon. So make this project now, before the postal service un-dies. Vibration motors can also be scavenged from cellphones.

CONSTRUCTION

These instructions will tell you how to make one haptic module, and Figure 11-3 shows the schematic for one communicator. Of course, to communicate with someone else, you will need to make two devices.

Figure 11-3: The schematic for one haptic communicator

Pin 2 of the Arduino will be set up as a digital input with internal pullup resistor enabled, connected to the push button S1. When the button is pressed, the Arduino will control the NRF24 radio module to send a message to the other handset, activating its vibration motor.

The vibration motor is controlled from pin D5 of the Arduino. We use a transistor (T1) because the motor uses more current than the Arduino output can cope with by itself, and the 5V supply is used because the 3V supply cannot provide enough current. Pin D5 is controlled as an analog output to manage the level of vibration with the software, keeping the device as quiet as possible; this also prevents the motor from burning out, as most vibration motors are 3V rather than the 5V the Arduino usually uses.

Note that strictly speaking, the motor should be accompanied by a diode to protect the Arduino from current spikes from the motor, but a little testing with one of these tiny motors showed that a very minimal amount of noise was added to the Arduino supply rails. So for the sake of keeping things simple the normal diode was omitted.

This project uses a protoshield rather than the screwshields used in most of the projects in this book. A protoshield is like a screwshield but without its screw terminals and hence is a bit cheaper and smaller.

STEP 1: ASSEMBLE THE PROTOSHIELD

Protoshields sometimes come with a full set of extra components, such as reset switches and header pins, but for this project you don’t want glowing power LEDs that might attract unwanted attention. Therefore, it’s better (and cheaper) to buy the bare Protoshield PCB and some headers.

Solder the header pins to the outermost rows of holes on each side of the PCB. A good way to keep the header pins straight is to put them into an Arduino and then put the Protoshield PCB on top of the headers. When all the pins are attached, the protoshield should look something like Figure 11-4.