Cowboy shoot-out game

Alisha's Cowboy shoot-out game

Alisha Campbell
Ngaruawahia High School
Year 12 Electronics
Teacher: Nicholas Bowskill

Ngaruawhaia High School student Alisha Campbell gave herself a deceptively complex challenge for her Year 12 Technology project – creating a cowboy shoot-out game using sophisticated electronics programming – that saw her win the NCET Category of the 2010 BrightSparks Awards.

Alisha's brief for entering the competition was simple, "to design and create a project controlled by the Picaxe microcontroller circuit," but her solution expanded that definition significantly.

Alisha's initial idea was to "produce a cowboy shoot-out game for all ages to enjoy" but as the project evolved, it became increasingly more complex as she continually improved her design. Alisha wanted to create a three-dimensional cowboy cutout with a robotic arm that would come up at a designated time, initiating the shoot-out sequence. Contestants would try to hit two (head and body) light-dependent resistor (LDR) targets with a laser pointer as many times as possible from a distance.

Alisha started with a simple drawing of the cowboy and a flowchart for the circuit to see how she could get the game to work. This flowchart was then converted to BASIC programming language so it could be tested and simulated in Programming Editor, free software provided by the Picaxe company to assist in creating programming for their circuits.

In creating her program, Alisha had several tasks that she wanted her circuit to perform: "I wanted the gun to draw randomly at different times so that I could point the laser at the head and heart of the cowboy to score points. I wanted the points to be displayed and the green LEDs to flash when the gun draws or red when not drawn."

Alisha then purchased all of the components she thought she would need, including, capacitors, LDRs, LEDs, and numerous switches to accompany the Picaxe Microprocessor supplied by the BrightSparks Foundation.

Alisha began testing the combination of her components and the program she developed on a solderless breadboard, or plugboard, a valuable method of testing prototype and custom circuits in development. The advantage of testing in this way is that changes can be made to the circuit without permanent soldering as components can be easily slotted in and out of the holes within the plastic board with ease.

Alisha tried various configurations on the breadboard, taking photos of each for her own reference and for assessment purposes.

Happy with the circuit's performance, Alisha constructed the wooden base for her cowboy character's shape then glued the cowboy picture and its desert background to the base. Alisha wanted the board to have some 3D elements, so she left a space for the cowboy's mechanical arm to come out of.

With the outer construction and frame ready, Alisha then tested a model of her circuit using Circuit Wizard, freeware for the virtual creation and testing of circuit designs. Satisfied that the circuit was effective, Alisha made the copper board to hold the circuit and began soldering on the different components.

While the circuit worked, Alisha had some difficulty with the mechanical operation of the shooting arm as the solenoid she had tried first proved too weak to hold it and had to be replaced with a servo, a more advanced and complicated component.

"Getting the servo to work at the right speed and without joints took a while but in the end I got advice from an expert to use capacitors to smooth the drawing action. This meant I also had to rewrite the programming to include servo commands to make it work and redesign the cooper board to accommodate the new components."

As Alisha wanted the game to have a professional and finished appearance, she remade the copper board to be double sided so that the components that would be seen from the front – such as the scoreboard and LEDS – could be connected without intrusive flyaway wires visible from the front.

Alisha then put the copper board together with the cowboy frame to check that it would function, finding that the reset switch wasn't connected properly. Alisha added another wire from the resistor to the negative and the circuit performed perfectly.

While she could have left the game at this stage, Alisha was keen to improve the game play of her project as well as meeting the prerequisites for a level 3 project.

"I wanted to write a program that involved a timer so that each game lasted the same amount of time and was fair for each competitor, but because of the randomness of the draw time, I couldn't think of a program to write for it. As a modification to my brief my teacher suggested creating another circuit with a 555 timer to interface with the cowboy shoot-out game circuit to stop it after a certain length of time."

The 555 circuit was powered with another Picaxe microprocessor, which Alisha programmed to control the time as well as a theme tune that would come in when the cowboy drew his gun.

"I had to decide how long I wanted the game to last so I timed the tune and decided to make it eight tunes long (about two minutes). I then had to match that to the 555 circuit's timer pace."

To get the timer and tune working together Alisha altered both the variable resistor and the frequency of the capacitor until she finally had a match between the song length and the timing of each game.

To stop the game when the two minutes was up, Alisha inserted a basic AND logic gate for the circuit so the game would freeze, the score could be recorded, and the game reset for the next player. This completed her circuit design.

"Finally, I drew the timer circuit, designed the printed circuit board in Circuit Wizard, made it, and then plugged it in to the original scoring circuit and it worked!" Alisha says.

Alisha's finished project surpassed the specifications of her brief and her teacher Nick Bowskill was impressed with her dedication throughout this project.

"Even though she didn't have much experience with electronics before this, Alisha had an idea in her mind right from the start about what she wanted to do and the process she thought would work and she just made it happen. Alisha is an extremely diligent student who really listens to what you have to say, takes it on board, and then applies that knowledge and experience in her own practice. The fact that she was so thorough in following, and also documenting, the process that she developed really contributed to her project's success."

Alisha's presentation of her game to BrightSparks