Designing An Electronic Trigger Mechanism For A Paintball Marker To Allow User Selectable Firing Rates ECE 4884/4007 Fall 2007 Nathan Densmore Matthew Roese Andrew Adams Chris Britton (Team Leader) Overview • Design and implement an electronic trigger • Upgrading is more practical compared to other high end electronic markers • Target customers will be scenario paintball enthusiasts • Principal expense is development cost Georgia Institute of Technology ECE 4007 Fall 2007 Design Objectives • Electronic trigger upgrade for the 98 Custom paintball marker • Two firing modes: semi-automatic and fully automatic • LCD screen will display the mode and selected rate of fire • LED indicator for low ammunition and selected firing mode • User friendly up/down buttons to select the rate of fire Georgia Institute of Technology ECE 4007 Fall 2007 Design Approach • Key component is PIC Microcontroller (16F690) • Powered by 9V battery • Trigger pressed will activate the micro switch allowing 9V signal to energize the solenoid • PIC will output to an LED indicating firing mode • PIC will output to LCD module indicating firing mode and rate Georgia Institute of Technology ECE 4007 Fall 2007 Top Level Design of Circuit Components 3 Supply VSS VDD +5V 2 VSS VDD +5V 2 LED VDD +5V Push Button 2 VSS I/O I/O I/O I/O PIC Microcontroller 8 or 4 I/O I/O Data Path 3 Control Inputs I/O LCD Module I/O Push Button 2 VSS VDD +5V Trigger Georgia Institute of Technology ECE 4007 Fall 2007 2 VSS VDD +9V Solenoid PIC Controller • • • • • • 20 pins – 1 VDD, 1 VSS, up to 18 I/O pins Operates on 2.0-5.5V Up to 20MHz oscillator/clock Up to 200ns instruction cycle 8-bit and 16-bit timer/counters FLASH/EEPROM – up to 100,000 writes Georgia Institute of Technology ECE 4007 Fall 2007 PIC Microcontroller 1 20 VSS - Supply RA5 – LCD Enable Output 2 19 RA0 – Supply (Firing Mode) Input RA4/CLKOUT – Solenoid Output 3 18 RA1 – Trigger Input RA3 – LCD Read/Write Output 4 17 RA2 – LCD Register Select Output RC5 – LCD Data Bit 5 Output 5 16 RC0 – LCD Data Bit 0 Output RC4 – LCD Data Bit 4 Output 6 15 RC1 – LCD Data Bit 1 Output RC3 – LCD Data Bit 3 Output 7 14 RC2 – LCD Data Bit 2 Output RC6 – LCD Data Bit 6 Output 8 13 RB4 – LED Green Output RC7 – LCD Data Bit 7 Output 9 12 RB5 – LED Red Output RB7 – Pushbutton Down Input 10 11 RB6 – Pushbutton Up Input PIC16F690 VDD - Supply Georgia Institute of Technology ECE 4007 Fall 2007 PIC Programming Environment • MPLAB Integrated Development Environment (IDE) included as tool to program PIC • MPLAB is programmed in assembly language • PIC Kit 2 software responsible for debugging code and loading chip Georgia Institute of Technology ECE 4007 Fall 2007 Pseudo-code Example Set BPS default; Set Ball Count; When ROF switch Semi or Full LED if Semi ROF GREEN Solid if Semi ROF RED Solid LCD if Semi ROF Display “Semi” if Full ROF Diplay “Full” and BPS PUSHBTN if Full ROF when UP PUSHBTN BPS + = 1 when DOWN PUSHBTN BPS - = 1 when UP & DOWN BPS = 0, Go to LED, LCD Georgia Institute of Technology ECE 4007 Fall 2007 Power Supply Schematic Georgia Institute of Technology ECE 4007 Fall 2007 Debounced Trigger Circuit • “Beginning” of circuit, and activated when trigger is pulled • Switch will send a high input to the PIC controller Georgia Institute of Technology ECE 4007 Fall 2007 Push Buttons (Up/Down) • • • UP and DOWN pushbuttons are inputs to the PIC; used only when in Full Auto Mode UP pushbutton will increase firing rate; DOWN will decrease firing rate Both UP and DOWN selected simultaneously will RESET ball count Georgia Institute of Technology ECE 4007 Fall 2007 LED Mode Indicator • Semi Mode: Green LED • Full Mode: Red LED • Low Ammo Status: LED alternates red and green Georgia Institute of Technology ECE 4007 Fall 2007 LCD Module • Display numbers and words • More versatile than 7segment LED • Line length 8 characters • 14 pins in order to interface PIC controller • 8 data lines, 3 control lines, & 2 power lines • Time delay between LCD and PIC interface 2 - VDD 1- Ground PIC Georgia Institute of Technology ECE 4007 Fall 2007 2 Enable 6 4 Read/Write 5 5 Data bit 5 12 6 Data bit 4 11 7 Data bit 3 10 8 Data bit 6 13 9 Data bit 7 14 14 Data bit 2 9 15 Data bit 1 8 16 Data bit 0 7 17 Register Select 4 LCD Module Solenoid • Powered by +9V • PIC outputs +5V and closes transistor circuit • Current freely flows and fires the solenoid • PIC outputs 0V and opens transistor circuit • Current stops flowing and solenoid returns to initial state • Diode prevents residual current from damaging transistor Georgia Institute of Technology ECE 4007 Fall 2007 Mechanical Operation • • • • • • • Operator pulls trigger Trigger throws trigger switch Solenoid fires and forces rod upward Rod rotates sear rocker pin and releases bolt Bolt spring sends bolt forward inducing firing operation Blowback resets bolt, locking sear into initial position Solenoid magnet resets solenoid to initial position Georgia Institute of Technology ECE 4007 Fall 2007 Component Enclosure • Plastic enclosure will mount on marker’s magazine • Enclosure will house all of the electronic trigger assembly Georgia Institute of Technology ECE 4007 Fall 2007 Technical Advantages and Disadvantages • LCD module is more flexible than 7-segment LED display • Relatively inexpensive production cost • Circuit components are easily replaceable98 • Circuit design larger than existing products • LCD module is bulky Georgia Institute of Technology ECE 4007 Fall 2007 Marketing Advantages • Ability to change firing modes quickly • Able to change rate of fire efficiently • Easy operator interface allows for quick selection of system configurations • LCD data display • No special tool or manual to switch modes or firing rates Georgia Institute of Technology ECE 4007 Fall 2007 Cost Analysis Design Cost Purchased Item Description Quanity Unit Price Amount Digi-Key Corporation Resistor 4.7K Ω 6 0.15 0.90 Digi-Key Corporation Resistor 1K Ω 1 0.15 0.15 Digi-Key Corporation Resistor 150 Ω 2 0.15 0.30 Digi-Key Corporation NPN Transistor 1 0.11 0.11 Digi-Key Corporation 2-In Nand Gate 2 0.56 1.12 Digi-Key Corporation Rectifier GPP 50V 1 0.26 0.26 Digi-Key Corporation Lever Switch 1 1.10 1.10 Digi-Key Corporation Pushbutton Switch 2 3.04 6.08 Digi-Key Corporation Rocker Switch 1 1.80 1.80 Digi-Key Corporation Regulator 1 0.72 0.72 Digi-Key Corporation Capacitor .1µF 1 0.11 0.11 Digi-Key Corporation Capacitor .33µF 1 0.15 0.15 Digi-Key Corporation 9V Battery Lead 1 0.33 0.33 Digi-Key Corporation LED Light 1 0.75 0.75 Digi-Key Corporation 8x1 LCD Module 1 24.24 24.24 Digi-Key Corporation PIC16F57 28-DIP 1 1.55 1.55 Digi-Key Corporation PIC16F628A 18-DIP 1 3.35 3.35 Digi-Key Corporation PICKIT 2 Starter Kit 1 49.99 49.99 Adv. Paintball Electronics Solenoid 1 19.95 19.95 Tippmann Parts Bag of Parts for Trigger 1 16 16.00 Shipping Cost 16.96 Total Design Cost 145.92 Georgia Institute of Technology ECE 4007 Fall 2007 Future Work • Program the PIC microcontroller to fire paintball marker (2 weeks) • Design an etched circuit board for more efficient production (1 week) • Program PIC microcontroller to work with LCD module (4 days) • Assemble product and test on marker (3 days) Georgia Institute of Technology ECE 4007 Fall 2007