Finally, we have the checkForBuzz function:
void checkForBuzz()
{
if (data[0]==0x54 && data[1]==0x12 && data[2]==0x01)
{
analogWrite(buzzerPin, buzzerVolume);
delay(buzzMinDuration);
analogWrite(buzzerPin, 0);
}
}
This function checks the first 3 bytes of the message sent from the other module, and if they match, it turns on the vibration motor for the duration specified in milliseconds by buzzMinDuration.
USING THE HAPTIC COMMUNICATOR
This project is a lot of fun to use. I’m pretty sure casinos are wise to this kind of contraption, though, so to avoid trouble, don’t use it to cheat at the gaming tables. Money will have little use after the apocalypse in any case.
If you’re prepared to learn Morse code, the handsets can be used with Morse, although they are a little slow. Alternatively, you could come up with a simplified vocabulary along the following lines:
• One short buzz: All is well
• One long buzz: Zombies sighted
• Three long buzzes: Zombies close
• Three short buzzes: Run!!
This is the final project in the book, and I hope you have had fun as you’ve equipped yourself for the apocalypse. Whether you’re building these projects in anticipation of the coming zombie hordes or you’re already in hiding, I also hope they help you to survive!
A
PARTS
In this appendix, you will find more information about the parts used to make the projects in this book. Unlike the individual project supply lists, the tables in this appendix list two types of sources: preapocalypse and postapocalypse. If you’re looking to buy parts and stockpile them in your secret underground bunker before the dead rise, look to the suppliers in the preapocalypse column. Buy your materials in bulk online now, and you can even order extras so you’ll be prepared to replace any components that break.
If you’re reading this guide after zombies have already taken up residence in your neighborhood, you want the postapocalypse column. Your options will be limited without the Internet, but if you’re lucky, you’ll find the odd brick-and-mortar hobby shop to loot, and there should be plenty of cars, microwaves, and other electronics that you can harvest components from. Good luck!
A NOTE ON BRICK-AND-MORTAR SUPPLIERS
When it comes to brick-and-mortar stores for electronic components, since the demise of Radio Shack, your choice in the United States has been reduced pretty much to Fry’s Electronics in California, Texas, and a handful of other states (http://www.frys.com/) and a few independent stores around the country. If you live in the UK, then Maplin Electronics (http://www.maplin.co.uk/) is your best bet. Both Fry’s and Maplin offer online ordering as well.
ELECTRONICS MODULES
This section describes items that could loosely be termed modules, or preassembled parts, rather than basic electronic components.
ITEM
PREAPOCALYPSE SOURCE
POSTAPOCALYPSE SOURCE
7A (or more) 12V charge controller
eBay, Fry’s (4980091)
Abandoned RVs and boats
Arduino Uno R3
Adafruit, Fry’s (7224833), SparkFun
Fry’s
Screwshield
Adafruit (196)
LCD shield
eBay, SparkFun (DEV-11851)
PIR module
Adafruit (189), Fry’s (6726705)
Fry’s, security store
Door latch
Farnell
Fry’s, security store
RF remote single-channel relay, 12V
eBay
Reed switch and magnet pair
Adafruit (375), Fry’s (1908354)
Fry’s, security store
4-channel relay shield
eBay, http://www.sainsmart.com/
USB Bluetooth adapter
eBay
Computer store
HC-06 Bluetooth serial module
eBay
Servo motor (small, 9 g)
Adafruit (196), eBay
Hobby store
Servo motor (standard)
Adafruit (155), eBay
Hobby store
NRF24 radio module
eBay
Protoshield
eBay (Arduino code: A000077)
RASPBERRY PI AND RELATED PARTS
This list includes all Raspberry Pi–specific parts you’ll need, including the Pi itself.
ITEM
PREAPOCALYPSE SOURCE
POSTAPOCALYPSE SOURCE
Raspberry Pi
Adafruit (2358), Fry’s (8258726)
Small HDMI monitor
Adafruit (1934), eBay
Raspberry Squid
Amazon, http://www.monkmakes.com/
LEADS AND CONNECTORS
In this list, you’ll find all the wires, leads, jacks, and other bits you’ll need to connect your circuits.
ITEM
PREAPOCALYPSE SOURCE
POSTAPOCALYPSE SOURCE
Heavy-duty alligatorclip leads (7A or more)
Auto parts store
Auto parts store
Terminal block (10A)
Home Depot, Lowe’s, Menards
Home Depot, Lowe’s, Menards
Small alligator clip leads
Auto parts store
Terminal block (2A)
Home Depot, Lowe’s, Menards
Home Depot, Lowe’s, Menards
Female-to-female jumper wire
Adafruit (266)
0.1 inch header pins
Adafruit (392), eBay
Female-to-male jumper wire
Adafruit (826)
2.1 mm jack plug-to-cigarette lighter adapter
Auto parts store
Auto parts store
2.1 mm barrel jack with flying leads
Broken DC power supply
DC power supply
Long male-to-male jumper wires (20 cm)
Adafruit (760)
0.1 inch right-angle header pins
eBay
9V Arduino battery lead
Adafruit (80), eBay
Solid-core wire for proto-screwshield PCB links
Adafruit (1311)
Abandoned electronics
TOOLS
No self-respecting zombie apocalypse survivor should be without the following general household tools:
• A drill
• Screwdrivers
• Pliers
• Snips
• A wood saw
• Scissors
You should be able to find these at any hardware store. To complete the projects in this book, you will also need a few electronics construction tools, listed below.