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

USING THE FLASH DISTRACTOR

Before you tape together all the parts of the flash distractor, test it with the parts laid out as shown in Figure 9-3. Turn on the flash switches of each camera and attach the 9V battery to the battery clip. The flash units should flash in turn, before pausing for 20 seconds and then repeating the cycle.

When you know your Arduino can activate the flashes, tape everything together, or if you prefer, stick the cameras together with a hot glue gun. Make sure to leave yourself access to the cameras’ battery compartments so you can change the batteries.

The small 9V battery that powers the Arduino will probably last about four or five hours. If you need to power the distractor for longer, then Figure 9-10 shows some other options.

Figure 9-10: Options for powering the Arduino

A 6 × AA battery holder will last around 10 times as long as the PP3 9V battery, but for the ultimate battery duration, you can use one of your car batteries with the cigarette lighter–to–barrel jack adapter shown on the left of Figure 9-10. However, the AA batteries in the cameras won’t last more than a few hundred flashes before they need replacing, so if you plan to reuse your distractors—as you might if you’re in a zombie-rich neighborhood—keep an extra set of batteries on you.

I suggest you stockpile a few flash distractors and always keep one complete unit in your bag when you venture out for supplies or reconnaissance. Then, if there’s a mob of zombies between you and that grocery store you want to scavenge from, just set up the distractor, wait out of sight as it draws the zombies, and when the coast is clear, make a stealthy dash for the doors.

You might want to use the flash distractor in combination with the next project to maximize your ability to distract the undead.

NOTE

This project has no on/off switch, so when you are not using it, unplug the 9V battery and turn off the flash switches on the cameras. You could also use an in-line power switch like this: https://www.adafruit.com/products/1125/.

PROJECT 16: ARDUINO MOVEMENT AND SOUND DISTRACTOR

Remember the smoke alarm that we used to make “Project 11: Quiet Fire Alarm” on page 120? In this project, we’ll use the piezo buzzer we removed from that smoke alarm, along with a waving flag powered by a servo motor, to make a lot of distracting noise and movement.

Figure 9-11 shows the project in action. Next to the project, I’ve shown a coiled cigarette lighter adapter, which you can use as an alternative to the AA battery pack if you want to power the setup from a car battery for long-term usage.

Figure 9-11: Sound and movement in disharmony

WHAT YOU WILL NEED

To make this project, you will need the following parts:

ITEMS

NOTES

SOURCE

Arduino Uno

Arduino Uno R3

Adafruit, Fry’s (7224833), Sparkfun

6 × AA battery holder

9V battery pack

Adafruit (248)

9V Arduino battery lead

DC power jack-to-9V battery clip adapter

Adafruit (80), eBay

Jumper wires

3 long male-to-male jumper wires

Adafruit (760)

100 Ω Resistor

2W or 1/4W

Mouser (594-5083NW100R0J or 293-100-RC)

Pin header

2-way pin header

Adafruit (392), eBay

Servo motor

Small or standard

Adafruit (155 or 196), eBay, hobby store

Buzzer

Discarded from the smoke detector of Project 11 or another high-volume buzzer

Security store, smoke alarm

Wooden upright (a post or rod)

Hardware store

Base

Wood or plastic, for attachment of the upright

Hardware store

Wooden food skewer and paper

To make a flag

Household items

The power for this project is supplied through the Arduino barrel jack. The same power options as used in “Project 15: Arduino Flash Distractor” on page 158 also apply to this project.

If you just want to wave a small, lightweight flag like the one shown in Figure 9-11, a small servo motor will work just fine, but for something bigger, use a standard servo. Just be aware that if you use a bigger servo, you may find that your Arduino resets because of voltage drops caused by the load of the bigger motor. In this case, you can power the servo from a separate 6V battery pack as described at http://communityofrobots.com/tutorial/kawal/how-connect-servo-arduino/.

Also note that while this project is intended to use the buzzer removed from the smoke detector of “Project 11: Quiet Fire Alarm” on page 120, you can also just use a new buzzer.

CONSTRUCTION

Figure 9-12 shows the wiring diagram for the project.

Figure 9-12: Wiring diagram for the distractor

The male-to-male jumper wires in the supply list will link the servo motor, which terminates in a three-way socket, to the Arduino. You’ll connect the resistor and one buzzer lead to a pair of header pins so that you can plug the buzzer into the Arduino, too.

STEP 1: REMOVE THE PIEZO BUZZER FROM THE SMOKE ALARM COVER

The smoke alarm’s buzzer may be integrated into the smoke alarm cover. In that case, don’t try to remove the buzzer; you can use it while it’s still attached to the cover, or you can just scavenge a different buzzer. If the buzzer looks like it will come away, then remove it as shown in Figure 9-13 to make the project a little more compact.

Figure 9-13: Removing the buzzer from the smoke alarm cover

STEP 2: SOLDER THE HEADER PINS, BUZZER, AND RESISTOR

Check your buzzer: you only need two buzzer leads, so if it has three, see “Project 11: Quiet Fire Alarm” on page 120 to work out which two of the three leads you need.

Once you have that cleared up, solder the 100 Ω resistor to one buzzer lead—it doesn’t matter which one. Solder the other end of the resistor to one of the header pins and the other buzzer lead to the other header pin. You may wish to strengthen these soldered connections using heatshrink (see “Using Heatshrink” on page 235) or electrical tape. These connections are shown in Figure 9-14.

Figure 9-14: Soldering the buzzer, resistor, and header pins

STEP 3: TEST THE PIEZO SOUNDER

Before we go further, we’ll test the buzzer using the USB connection to power the Arduino. This step will help us find the optimum frequency of the buzzer to make it as loud as possible.