Introduction: Zombie Attack! Easy to Build!

Picture of Zombie Attack! Easy to Build!

Hello, I am here, presenting you, another project, which is low in cost, that is easy to build. Zombies are attacking, and you need a way to defend against them, so you decide to build the zombie rifle to defend against Zombies. Overall, this project is a low cost, quick build. Most if not all of the materials, you can buy at Radio Shack, or Sparkfun. No, this project is not on an Arduino, because the next step of this project, is to bare-bones it. You will be using the cheapest development board known to man, it is by Texas Instruments; yes, TI is a calculator company, but they also manufacture cool development kits. The name of the Development kit is MSP430 LaunchPad; which you can order at the TI E-Store or Sparkfun, or really any other major electronics distributor. It costs about $6 by the way, and it comes with one of the chips you will use, and another free chip, which you can use for any other project.
**Please click on the orange vote ribbon in the upper right-hand corner of this page if you enjoy this Instructable.**
This is a Zombie Game and it uses processing to create a GUI based thread. I used Processing because it is easy for anybody to use and I used the TI MSP430 LaunchPad because it is a versatile platform and also easy to use. I worked on this project, by myself, for about an hour. My plans and ideas did not change while creating the project, because I thoroughly calculated all of the needed resistances and capacitances, so there should be not problem. I made this at home, so I think that anybody could really be able to build this. I learned that it is always best to calculate values to my electronic components because it shortens build time and brings the cost down. The biggest challenge in this build was actually calculating the needed component values. I think that the only thing that I would change, when I do another build of this project, is embed a serial adapter on the board with the MSP430G2553 embedded, so that there would be no extra headers on board.
(Thank-you juani_c [the original]:

Step 1: Materials

Picture of Materials

You will need:
1 .01uF Polyester-Film capacitor
1 .022uF Polyester-Film capacitor
1 10K POT
1 22K Resistor
1 small Perf-Board
1 8 pin DIP socket, or 8 pin female Headers
1 Five pin Male headers (or just 2 pin male headers and one 3 pin male headers)
1 Button
Some wire
1 USB-B mini B cable 

Step 2:

Picture of

Take one perf-Board out of the packaging. Then take one DIP socket and cut it in half, unless you are using Female Headers.

Step 3:

Picture of

Now solder the socket onto the Perfboard, as close to the outside of the right side and as far up as possible. (if you are confused look at the picture)

Step 4:

Picture of

Flip the board over, now position your POT with the VCC pin two holes to the left of the "headers", but the pin must line up with the header pin which is closest to the big hole. Now solder the VCC pin to the header pin which is two holes across from the POT.

Step 5:

Picture of

Now get the 22K resistor, and solder one leg (lead) to the VCC pin on the POT and the other lead to the Fifth header pin.

Step 6:

Picture of

Now break you headers into a group of 3 and bend them in the holes of your board. Place them on the opposite side of the female headers. Solder them down. (These headers will be called the Signal Headers)

Step 7:

Picture of

Now get the other male headers, and bend them in the holes on the other side of the POT right next to the hole (not diagonal from the POT though nor next to the other headers you just placed) Now solder the headers down. (These headers will be called the power headers.)

Step 8:

Picture of

Now take out the .01uF Capacitor. Take one lead, and solder it onto the Pin on the Power headers which is farthest from the big hole (known as GND) and solder the other lead, to the 22K resistor meets pin 5 of the Female headers.

Step 9:

Picture of

Now take out your .022uF capacitor out.  Flip the board, so you can solder it underneath. Position this Capacitor to have the leads connect to GND and pin 6 of the female header. Flip the board. Solder the Capacitor leads to GND pin and to pin 6 of the Female Header.

Step 10:

Picture of

Cut a wire to connect GND to the pin Farthest from the hole on the Signal Header. Solder it down.

Step 11:

Picture of

Now solder another wire from the Middle pin of the the Signal Header to pin 3 of the POT.

Step 12:

Picture of

Make a solder bridge, from pin 3 of the POT, under the .01 uF capacitor lead, to pin 6 of the Female header.
(or connect a wire from Pin 3 of the POT to pin 6 of the Female header.)

Step 13:

Picture of

Now attach the another wire to the sensor header pin which is closest to the hole, to pin 5 of the Female Header pin.

Step 14:

Picture of

Now solder a wire from Pin 1 of the Female header, to the Power header's pin which is closest to the big hole.

Step 15:

Picture of

Now put it on the Launchpad, lining up Female Pin 1's female side to the connector on the Launchpad, which is labeled VCC and says a small 1 next to it.

Step 16:

Picture of

Now attach a Female-Female wire to GND and GND on the LaunchPad.

Step 17: Now for the "Gun"

Picture of Now for the "Gun"

All you need to use for this part is: the button and the LDR.

Step 18:

Picture of

Solder one LDR pin to one of the pins on the switch.

Step 19:

Picture of

Now attach a Long wire to the LDR and Switch joint. Connect that wire to another wire that has a female end connector. Then plug the connector into the Signal header's pin which is farthest from the big hole.

Step 20:

Picture of

Now solder another wire, connected to a female connector on the other side, to the LDR's other pin, and use the nut on the switch to hold the LDR in place. Then plug the female connector to the middle Signal header pin.

Step 21:

Picture of

Now solder another wire to a female connector, then solder it to the other lead of the switch. Plug the female wire into the pin of the signal connector which is closest to the big hole.

Step 22:

Picture of

Twist all of the wires together to get a neat single strand.

Step 23: Program the MSP430

Picture of Program the MSP430

Install CCS (Code Composer Studio) Here 
After installing, open CCS use when it asks you about the workspace, allow it to make one with the name it generated.
Then press File->New->CCSProject
A window will pop up, name your project, Zombie Game.
Then Select MSP430 series
Then in the search type in: MSP430G2553 (or just find it)
Select the template Blink LED and on opening of the blink program, Delete all of it.
Paste the code posted here and press the little bug. If you have no problems, then you will have a small toolbar after it programs the chip, which is a debug console, and there will be a > button, press it and the MSP430 Launchpad will be sending back data via UART, so you can check the data on terminal. 

#include "msp430g2553.h"
#include <intrinsics.h> // Intrinsic functions
#include <stdint.h> // Standard integer types

#define TXD BIT1 // TXD on P1.1
#define Bitime 104 //9600 Baud, SMCLK=1MHz (1MHz/9600)=104

unsigned char BitCnt; // Bit count, used when transmitting byte
unsigned int TXByte; // Value sent over UART when Transmit() is called

unsigned int i,j,h;
unsigned int ADCVal;
// Function Definitions
void Transmit(void);
void Single_Measure(unsigned int);
#define NSAMPLES 16 // Number of samples in each block

void main(void)

  unsigned int uartUpdateTimer = 10; // Loops until byte is sent

  uint32_t average=0; // Average value of block

  BCSCTL1 = CALBC1_1MHZ; // Set range

  P1DIR |= 0x01;                            // Set P1.0 to output direction
  P1SEL |= TXD; //
  P1DIR |= TXD; //

  __bis_SR_register(GIE); // interrupts enabled\

  /* Main Application Loop */
    if ((--uartUpdateTimer == 0))
      //__bis_SR_register(CPUOFF + GIE);        // LPM0, ADC10_ISR will force exit

      if(0x08 & P1IN){
        for (i = 0; i < 1000; i++);        // Dummy delay for debounce
        if(0x08 & P1IN){
         P1OUT &= ~0x01;  //board led OFF
       for (i = 0; i < NSAMPLES; ++i) {
         ADCVal = ADC10MEM;
         average += ADCVal; // Accumulate sum
         average /= NSAMPLES; // Arithmetic mean of samples
        P1OUT |= 0x01;//board led ON
        average=average & 0xFF;
        TXByte = average;
      average=0;//reset avarage
      uartUpdateTimer = 10;
      for (h = 0; h < 10000; h++);        // Dummy delay between communication cycles

// Function Transmits Character from TXByte
void Transmit()
  CCTL0 = OUT; // TXD Idle as Mark
  TACTL = TASSEL_2 + MC_2; // SMCLK, continuous mode

  BitCnt = 0xA; // Load Bit counter, 8 bits + ST/SP
  CCR0 = TAR;

  CCR0 += Bitime; // Set time till first bit
  TXByte |= 0x100; // Add stop bit to TXByte (which is logical 1)
  TXByte = TXByte << 1; // Add start bit (which is logical 0)

  CCTL0 = CCIS0 + OUTMOD0 + CCIE; // Set signal, intial value, enable interrupts
  while ( CCTL0 & CCIE ); // Wait for TX completion
  TACTL = TASSEL_2; // SMCLK, timer off (for power consumption)

// Timer A0 interrupt service routine
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
  CCR0 += Bitime; // Add Offset to CCR0
  if ( BitCnt == 0) // If all bits TXed, disable interrupt
    CCTL0 &= ~ CCIE ;
    CCTL0 |= OUTMOD2; // TX Space
    if (TXByte & 0x01)
      CCTL0 &= ~ OUTMOD2; // TX Mark
    TXByte = TXByte >> 1;
    BitCnt --;

// ADC10 interrupt service routine

#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
  __bic_SR_register_on_exit(CPUOFF);        // Clear CPUOFF bit from 0(SR)

void Single_Measure(unsigned int chan)
ADC10CTL0 &= ~ENC; // Disable ADC
ADC10CTL0 = ADC10SHT_3 + ADC10ON + ADC10IE; // 16 clock ticks, ADC On, enable ADC interrupt
ADC10CTL1 = ADC10SSEL_3 + chan; // Set 'chan', SMCLK
ADC10CTL0 |= ENC + ADC10SC; // Enable and start conversion

Step 24:

Picture of

This is the processing sketch, open it and run it; it will look for the COM port.

Step 25: Enjoy!

Picture of Enjoy!

Enjoy the Game!


juani_c (author)2014-04-16

It looks veeeeeeerrryyy similar to the one I made, though I couldn't find any reference...:(

simonfrfr (author)juani_c2014-05-04

Yes, I did use your game as a basis. I figured though that I could explain how to build this. I added a few things in the GUI on processing as well. Although you are right, you deserve credit; I will add your name to reference.

Raphango (author)2013-10-09

Any chance of doing this with Arduino? I didn't even know this Lauchpad.. =P
Thanks in advance!

Raphango (author)Raphango2013-10-09

Video please?

juani_c (author)Raphango2014-04-16

This is the original.....

Bobey (author)2013-04-18

You invented the game?

masynmachien (author)2013-04-18

Looks interesting. Or rather intriguing, as I can't find a description of the concept of the game, schematics or anything on how it actually works.
I guess the game runs as a Processing sketch on the computer and somehow interacts with an LDR based "gun" built based on the TI MSP430 LaunchPad.
Nice details on how to build it, but not on what the different parts are needed for. You tell calculating the components was the biggest challenge, but you do not explain how you proceeded.
I do not want sound like a critic, but remember many people will not want reproduce what you did literally, but want to learn from it to make other things...

simonfrfr (author)masynmachien2013-04-18

Ok, for the calculation of the components, This article would be of some help if you want to learn how to figure out the capacitance and resistance needed: here. The idea of this project, is actually a test on the ADC port on the MSP430 based processor. It "grabs" analog values and converts them into digital ones. Think of the LDR as a POT, depending on the output resistance given by it determines the "light colour" and intensity. The Processing Sketch runs a very simple program which uses animated GIFs to be "zombies". The reason for the total difference in colours, is so that the LDR can tell the difference between "zombies". The whole protocol is actually quite simple, it runs USART (Serial in arduino terminology) to communicate to the computer. I will post some schematics, I drew them on paper, but I'll make a virtual version for clarity. Simon

hcohen1 (author)2013-04-18

This is a great project; the current price of the board is $9.99, but still cheap!

billbillt (author)2013-04-18


About This Instructable




Bio: Hey YOU! Yeah, I'm talking to you who is reading this. Send me ideas for instructables, like things that you are wondering how to ... More »
More by simonfrfr:DIY Spectrometer) Explore the Unknown ->Zombie Attack! Easy to build!Newton Labs Projects Arduino Guide (2012)
Add instructable to: