This is a project that i made for my hobby of shooting with co2 guns. I needed a fun but a good game to work on my speed to shoot on targets. After a little googling on the internet i find some good projects but i'm going to do this project a little more advanced.
The goal is to have 4 custom made targets that are controlled thru a base that holds Arduino uno. On the 4 targets there will be sensors that reacts on vibration (Piezo) there will also be a led on all targets to indicate when to hit them.
Right now there is 3 games.
First there is Quickdraw (Shoot as fast as you can)
Then there is timed mode (shoot as many times you can in 10 sec)
Then there is Rapid Fire (Shoot 32 times on time
This version of the game will use wires to the targets, but i'm also working on an wireless model to the target.
What you need:
1x Arduino Uno
1x Arduino Uno prototype shield (I use wireless SD shield)
4x Piezo Element
4x Multilayer Ceramic Capacitors MLCC - Leaded 50volts 0.01uF 10% X7R
4x Carbon Film Resistors - Through Hole 1Mohms 0.05
4x Zener Diodes 5.1 Volt 0.5W 5%
8x Schottky Diodes & Rectifiers Vr/20V Io/1A BULK
4x Led diod (i use super strong clear blue model)
1x Serial LCD
4x 220 ohm resistor
And some wires and buttons
Step 1: Step 1: Making the Sensor
The first thing we are going to do is to build the sensors for the game.
For this we need some electric components to succeed. The Piezo is an great component, they can be a buzzer but they also can feel vibrations. When the vibration appear on the target the Piezo will send an signal to an analog pin on the arduino to inform that we made a hit on the target.
To protect the Arduino from high voltage that can come from the Piezo we need some components.
On each sensor we need
1x Zener diod,
2x Schottky diods,
1x 1mohm resistor
This components is for the Piezo part to protect the Arduino. Take a look at my schema how to connect them.
You start with one Schottky diod, then the Zener diod, then another one Schottky diod, after that the resistor and then the capacitor.
For the led i Recommend you to add a resistor for protection, i use 220 ohm resistor.
For connection i used 3.5 m.m female phono contacts. I used left for the piezo sensor and right for the led and then the ground for the ground. I also made my own cables from a phone cable so i have 12.5 meters cable to the sensors, but you can use audio cable also.
Make four of this sensor. I put them in a plastic case for protection. The Piezo sensor i placed behind the target, added some super glue on the back of them and i know electric tape is not the best solution but that was the only thing i got at home. Its for to hold the cables and protect the sensor.
Step 2: Step 2: Build the System
For the system I'm using a black waterproof case (i hade one at home that i didn't use) also i use 4 m.m. plywood to install the system on.
I have placed all the electronics on one side of the case, because i'm going to make a little hatch to store the targets inside also.
The LCD is an serial LCD it uses only 3 pins on Arduino.
Connect the ground to ground on arduino, the 5v to 5v out on arduino and the read pin to pin 1 on Arduino.
For the start and reset button i used Arcade buttons (they are big and i like them)
The reset button is added between the ground and the reset pin on arduino.
The start button is added between ground and analog 4 pin.
The game has a game switch to choose game mode. There are 3 types of games right now,
2. Timed mode
3. Rapid fire
For this i used a rotary switch to switch game mode.
They are going to be added to digital inputs on Arduino so the incoming signal is going to ground and the three game signal is going to digital pin 2, 3 and 9
The sensors are connected to the game thru 3.5 m.m female phono contacts, add 4 of them. To make it simple i did take an copper plate (the one you have when making pcb) and install them on. That way you don't need to add ground to all contacts sins the ground is in the chassi of the contact.
Connect the Piezo signal to Analog 0-3 and the led diods to digital pin 5, 6, 7 and 8 just remember that the sensor connected to Analog 0 is going to use the led pin 5 and so on.
For the power to the game, i have two options. I can switch between 9v battery and 9v from cable. For that i have also an rotary switch to choose how i will power the arduino. The i have connected the plus pole from battery to one pin on the rotary and the other pin is for the plus pole on the incoming cable (9v). And then it send away the plus pole signal to a power switch.
Take a look at the electric sheet for more detail connection.
Step 3: Step 3: Program the Arduino
It's now time to program the arduino.
Download the code and transfer it over to the Arduino.
Then the system is ready to use.
Please note how i write to my serial lcd, maby you need to change that so it will match your LCD.
Now you have made a shooting game. Feel free to visit my blog page for more info and to follow my development of wireless sensors for the game.