Smart Shot - Electronic Target With Smartphone Application
Smart Shot - Electronic Target With Smartphone Application
Smartphone Application
By:
Tyler Stuart Pickett
Taylor Jacob Hutchinson
Advisor:
Dr. Bridget Benson
Senior Project
June 2015
Table of Contents
List of Figures ................................................................................................................................................ 3
List of Tables ................................................................................................................................................. 3
Abstract ......................................................................................................................................................... 4
1.0 Introduction ............................................................................................................................................ 5
1.1 Market Overview ................................................................................................................................ 5
1.2 Project Description.............................................................................................................................. 7
2.0 Requirements and Specifications............................................................................................................ 9
2.1 Customer Needs Narrative.................................................................................................................. 9
2.2 Engineering Specifications ................................................................................................................ 10
2.4 Deliverables and Schedule ................................................................................................................ 11
2.5 Cost Estimation ................................................................................................................................. 11
3.0 Functional Decomposition .................................................................................................................... 12
3.1 System Description ........................................................................................................................... 12
3.2 Testing and Verification .................................................................................................................... 13
4.0 Target Assembly .................................................................................................................................... 14
4.1 Preliminary Design ............................................................................................................................ 14
5.0 Sensors .................................................................................................................................................. 15
6.0 Control Module ..................................................................................................................................... 15
6.1 Embedded System Architecture ....................................................................................................... 15
6.2 Algorithm Progress............................................................................................................................ 17
7.0 Smartphone Application ....................................................................................................................... 19
8.0 System Integration ................................................................................... Error! Bookmark not defined.
9.0 Testing Results ......................................................................................... Error! Bookmark not defined.
10. 0 Conclusion .......................................................................................................................................... 22
References .................................................................................................................................................. 23
Appendix A: Senior Project Analysis ........................................................................................................... 25
Appendix B: User Manual ........................................................................................................................... 27
Part 1: Target & Associated Hardware.................................................................................................... 27
Part 2: Smartphone Application.............................................................................................................. 27
2
List of Figures
Figure 1: Example of a commercially available paper target. Pros: convenient and cheap. Cons: Non-
reusable and no technology integration....................................................................................................... 5
Figure 2: Example of a SIUS competitive scoring system. [4] Pros: Accurate electronic system. Cons: For
competitive shooters, non-portable, expensive. .......................................................................................... 6
Figure 3: System Overview (with acoustic sensor option shown) ................................................................ 8
Figure 4: Level 0 Block Diagram of Electronic Target System ..................................................................... 12
Figure 5: Level 1 Block Diagram of Electronic Target System ..................................................................... 13
Figure 6: Target Assembly deployed. The spikes have been pressed into the ground to create a sturdy
base. ............................................................................................................................................................ 14
Figure 7 : Acoustic sensor layout. Tn represents the time it takes the sound wave to reach sensor n. ..... 15
Figure 8: Block diagram of PmodMICRefComp. CLK, RST, START, DONE, and DATA(11:0) connect to the
Cortex-A9. SDATA, SCLK, and nCS connect to the PmodMIC. [8] .............................................................. 16
Figure 9: State Diagram for PmodMICRefComp [8] .................................................................................... 16
Figure 10: Flowchart for software on Cortex-A9 using FreeRTOS. ............................................................. 17
Figure 11: Strike at center of the plate. The initial peaks line up well. The following oscillation is ringing
from the plate. ............................................................................................................................................ 17
Figure 12: Hit at 1 inch left of center. ......................................................................................................... 18
Figure 13: Hit at 3 inches left of center. ..................................................................................................... 18
Figure 14: Hit at 3 inches up and 3 inches left of center. ........................................................................... 19
Figure 15: Smartphone application screen flow chart ................................................................................ 19
Figure 16: Smartphone application screenshots ........................................................................................ 21
List of Tables
Table 1: Target Solution Comparison............................................................................................................ 7
Table 2: Division of Labor.............................................................................................................................. 8
Table 3: Market Requirements Summary ..................................................................................................... 9
Table 4: Engineering Specifications Summary ........................................................................................... 10
Table 5: Deliverables ................................................................................................................................... 11
Table 6: Summary of Cost Estimate ............................................................................................................ 11
Table 7: Level 0 Description ........................................................................................................................ 12
3
Abstract
The objective of this project is to develop an electronic system for recreational shooters that
functions as a target with real-time feedback. The system provides a user-friendly alternative to paper
targets and expensive competition scoring systems. One of the largest challenges presented by this
project is balancing cost, durability, and sensitivity. The scope of this project includes the design and
implementation of a target assembly, an electronic system, and a smartphone application.
The system is comprised of three main modules: the target, the control module, and the
smartphone app. The electronic target communicates wirelessly with the smartphone via Bluetooth.
Once the shot information has been sent, the app receives the data and stores it for retrieval and
analysis. The app also retrieves and logs environmental data through the www.worldweatheronline.com
free API.
4
1.0 Introduction
The most popular target used by recreational shooters today is a simple paper target (Figure 1).
Typically mounted on a wooden or cardboard stand, the paper rips and in some models, changes color
where the bullet pierces. This target has the advantage of being cheap, but the technology is primitive.
The shooter is required to use an optical device such as binoculars to view when the target is
downrange; even with optical aid, it can be difficult to clearly see the shot placement from a far
distance. In addition, the shooter must go walk out periodically to view the shots up close or to apply a
replacement target.
Figure 1: Example of a commercially available paper target. Pros: convenient and cheap. Cons: Non-reusable and no
technology integration.
Electronic target and scoring systems do exist for competitive sport shooting. SIUS is one of the
leading manufacturers of electronic target systems. They have a wide variety of products. The SIUS
systems range from those that are bulky, permanent installations (Figure 2), to some smaller caliber
targets as well. The majority of their products, however, are expensive and designed with sport
shooting in mind. These systems are designed to be used in conjunction with a portable monitor with a
computer for shot display.
5
Figure 2: Example of a SIUS competitive scoring system. [4] Pros: Accurate electronic system. Cons: For competitive shooters,
non-portable, expensive.
There are currently few software options on the market for target shooting. For PC based
systems, there is software that is designed for shooting competition scoring and database logging.
These programs are also designed primarily for competitive shooting applications. The few apps on the
markets that do exist use a variety of methods to determine shot location. The most common methods
include photographic scanning of a paper target or direct user input via touch screen. None of these
include integrating electronic systems with a smartphone app directly. Furthermore, these systems
typically do not have any type of automatic environmental data collections system.
6
Table 1: Target Solution Comparison
The proposed project would be a system that could automatically measure and record the
location of a shot, along with the environmental data at the time of the shot, and output the
information to the user via smartphone (Figure 3). The user interface will update in real-time and show
the location of each shot on a digitally rendered on-screen target. After measuring the shot
information, the data will be stored on the phone for later retrieval and analysis. The user will be able
to retrieve previous shooting session data and overlay the shots on a single screen to compare the
variation in shot placement over time. This will allow the user to compare shot performance in relation
to varying parameters such as ammunition type, sight settings, or environmental conditions.
7
Figure 3: System Overview (with acoustic sensor option shown)
The project will require two main divisions of labor: system design and implementation, and
android app development. This will require two students, an Electrical Engineer (EE) for system design
and implementation, and a Computer Engineer (CPE) for app development. Once the two sections are
complete, the two engineers will work in conjunction to achieve total system integration. A further
breakdown of the project is shown in Table 2.
8
2.0 Requirements and Specifications
The first market requirement is cost. The initial cost requirement is an approximate selling price
of $300. This price would allow the system to be competitive in market place while still making a profit.
For this project, smaller caliber ammunition such as .22LR rounds will be focused on due their popularity
and low cost. The following requirements will be based off of .22LR ammunition.
With the customer paying a large price tag, the system must be durable. This system should be
robust enough to withstand the impact of smaller caliber ammunition of the lifetime of the product.
While being durable enough to withstand the impact of bullets, the system must be accurate enough to
determine the shot placement within 0.1”, approximately half the diameter of a 0.22LR round [1]. One
of the features this system will have is wireless communication with the smartphone. One of the
features of the app is the system should store data from previous shooting sessions for later retrieval.
Due to the compact nature of the data, an average smartphone should be able to store several thousand
sessions with little effect on available storage space.
# Market Requirement
1 Designed for small caliber rounds
2 Durable enough to withstand shot impact over product lifetime
3 Precise and accurate to detect correct shot location within half the
diameter of a 0.22LR round
4 Selling price: $300 to be competitive in the market
5 Storage of previously recorded data for easy retrieval
6 Adult should be able to carry without assistance
7 Easy to use for someone with little to no technical experience
9
2.2 Engineering Specifications
Taking the market specifications into consideration, the engineering specifications act as
guideline for this project. Table 4 shows a summary of the Engineering Specifications for this project.
Because the method of shot detection has not yet been determined, a variety of options will be
researched. The current methods on the market include laser or infrared detection and acoustic
sensors. Bases on the market requirements of accuracy and affordability, acoustic sensors appear to
provide the best method of detection for this project. Further research and experimentation will be
performed to determine the type and exact specifications of the sensors.
10
2.4 Deliverables and Schedule
Table 5 shows a breakdown of deliverables and milestones that occur throughout the 2014-2015
academic year.
Table 5: Deliverables
The estimated number of development hours required for this project is 500. The work for the
project by the design engineers will be done free of charge, keeping the overall costs low. The main
costs will be materials. A budget breakdown is show in Table 6. This cost breakdown also assumes the
user already owns an android smartphone for use with the system.
This system is being designed to be completely reusable. Once the system is purchased, no
replaceable parts should be required for operation. The only long term cost would be battery
replacement if disposable batteries are chosen. This helps keep the ongoing cost low.
11
3.0 Functional Decomposition
Type Description
Inputs Shot Impact The mechanical energy of the impact of the shot
will be used to determined shot location.
Environmental Data Data collected via website and will be recorded for
data logging.
Power Power will be supplied to the control module.
Outputs Shot Location and Data will be output into memory and to the user
Environmental Data via app interface.
Functionality The completed system will be able to take the input shots and environmental
data, perform calculations to determine shot location within the control
module and output the data to the user via app interface.
Figure 5 shows the level 1 block diagram of the system. The acoustic data is collected with four
PMOD-MIC modules; the data is then transferred to the FPGA on the Zynq-7000 via SPI. The FPGA
receives the acoustic data and packages it into an array which is passed along to the Coretex-A9
processor via the AXI bus. The Coretex-A9 runs the algorithm to determine the point of impact. An (x,y)
coordinate is then passed along to the Arduino which relays the coordinate to the Android via
Bluetooth. The Android App collects environmental data from a website and then communicates the
shot location and environmental data to the user through a custom GUI.
12
Figure 5: Level 1 Block Diagram of Electronic Target System
To test the sensor system, the sensors are hardwired to a Zybo Zynq-7000 and the output from
the sensors will be relayed directly to a computer via USB. A hammer strikes various locations on the
plate and the sensor output is recorded and analyzed.
The next phase includes design and testing of the wireless communication system. A test
program generates simulated coordinates on the Zybo, relays the data to the Bluetooth module which
then transmits to the phone. The output coordinate on the phone should match the coordinate
generated on the Zybo.
13
4.0 Target Assembly
The legs are designed to fold out from the back of the assembly to provide a stable base for the
target. The flat bottom of the legs will allow the user to press down the foot, effectively forcing the
spikes into the ground. This will provide a sturdy base for the target while allowing the user to install
and remove the target easily by hand.
Figure 6: Target Assembly deployed. The spikes have been pressed into the ground to create a sturdy base.
14
5.0 Sensors
The sensors used in the project are PMOD-MICs from Digilent. They are microphones combined
with 1 MSPS (Mega samples per second) ADCs. With all four sensors being read simultaneously at
1MSPS, the system should be able to achieve 0.25” resolution.
The acoustic sensor array is shown in Figure 7. Tn represents the time it takes for the sound
wave from the bullet impact to reach acoustic sensor n. By analyzing multiple sensor response times,
one can calculate the impact location. The first sensor to detect the sound wave will be used as the
reference sensor, and the subsequent sensors will be used to calculate the position relative the
reference sensor.
Figure 7 : Acoustic sensor layout. Tn represents the time it takes the sound wave to reach sensor n.
15
Figure 8: Block diagram of PmodMICRefComp. CLK, RST, START, DONE, and DATA(11:0) connect to the Cortex-A9. SDATA,
SCLK, and nCS connect to the PmodMIC. [8]
Because the system is still in the proof of concept phase of development, the program only runs
for one hit. If another hit’s data needs to be collected, the program needs to be rerun. In a finished
product this would be modified to run continuously without the need for resetting the system.
The sensor data sampling rate is read in at 992 kHz and analyzed. A 100 sample queue for each
sensor is implemented in software and refreshes until a hit is detected. A rising edge above an ADC
value of 1500 or a falling edge that goes bellow 750 is consider a hit. When a strike to the plate occurs,
another 500 data samples per sensors get added on to the end of the array. These three 600 entry
arrays are then passed along to the USB port and transmitted via UART. While the data is being
transmitted to the USB, a simulated X, Y coordinate is passed along to the Arduino using a parallel
communication bus.
16
Figure 10: Flowchart for software on Cortex-A9 using FreeRTOS.
The UART terminal Realterm collects the transmitted sensor values and saves them in a text file
as hexadecimal numbers. A python program called formatTXT.py then formats the data so that is can be
read in three columns by excel. Excel then plots the data in an amplitude vs index graph.
3000
2000
1000
0
273
307
341
375
409
443
477
511
545
579
1
18
35
52
69
86
103
120
137
154
171
188
205
222
239
256
290
324
358
392
426
460
494
528
562
596
Index
Sensor 0 (Right) Sensor 1 (Top) Sensor 2 (Left)
Figure 11: Strike at center of the plate. The initial peaks line up well. The following oscillation is ringing from the plate.
17
As the strike location changes, the waveform shape at each location changes based on the
phase the sound wave when it reaches the sensor (Figure 12 - Figure 14). This causes the waveform to
have falling edges, rather than rising, on the initial strike. An example of a falling edge at the strike is
sensor 2 in Figure 13. In addition to different directions in the edges, often there is a small peak or
trough that is generated from movement of the plate when it is struck. Sensor 0 in Figure 12 has one of
these small peaks. This peak makes it appear the sound wave reached sensor 0 first even though it is
the farthest away. This issue manifest itself in Figure 14 where sensor 0 appears to have a rising edge at
the same time as the other waveforms.
2500
2000
1500
1000
500
0
273
307
341
375
409
443
477
511
545
579
103
120
137
154
171
188
205
222
239
256
290
324
358
392
426
460
494
528
562
596
1
18
35
52
69
86
Index
Sensor 0 (Right) Sensor 1 (Top) Sensor 2 (Left)
2500
2000
1500
1000
500
0
273
307
341
375
409
443
477
511
545
579
103
120
137
154
171
188
205
222
239
256
290
324
358
392
426
460
494
528
562
596
1
18
35
52
69
86
Index
Sensor 0 (Right) Sensor 1 (Top) Sensor 2 (Left)
18
Hit at 3 inches up and 3 inches Left of Center
3000
2500
Signal Magnitude
2000
1500
1000
500
0
273
307
341
375
409
443
477
511
545
579
1
18
35
52
69
86
103
120
137
154
171
188
205
222
239
256
290
324
358
392
426
460
494
528
562
596
Index
Sensor 0 (Right) Sensor 1 (Top) Sensor 2 (Left)
These types of abnormal peaks and troughs create a large challenge when trying to write an
algorithm that compares waveforms. From visual inspection, and with enough experience, one can
determine which edges correspond to each other. Getting this to work in code on the Zybo board
proved to be too large of a task for the timeframe of this project. The concept of using acoustic sensors
as a method to triangulate a hit has been supported by the results of this project. This system provides
the platform in which an algorithm could be successfully implemented.
19
One phone can be shared by many users. It can also store any weapons, ammunition, and
locations given to it. The user can begin shooting without putting in any information at all if they choose
to. They can edit this information from the shooting screen if they change their mind. A user can also
continue an old session. The main use for this is if you accidentally close the app or let your phone die,
you can still continue upon re-opening the app.
The app can overlay up to 10 sessions on top of each other using a different color hit indicator
for each session. The user can tap a session in the listing to show or hide the shots from that session.
Sessions will be saved based on the person shooting and the date of the shooting session. Multiple
sessions on the same date will be given identification numbers showing the order in which they were
created. Upon beginning a shooting session, the phone will use its current location and the weather
service from www.WorldWeatherOnline.com to retrieve current weather conditions and display them
below the target. The user can update the weather information at any time through the options menu.
Example screenshots are shown in Figure 16.
20
Welcome Screen Session Info Screen Shooting Screen
21
9. 0 Conclusion
Although the triangulation algorithm is incomplete, this project confirms that using acoustic
sensors mounted on a steel plate is a viable option for detecting shot location. One potential step
towards completing the algorithm is collecting waveforms from various strikes on the plate and storing
them as a database on the Zybo. The Zybo could then compare the measured signals to those of known
location. This would restrict the resolution to how close the samples in the database are. This also
requires a larger amount of memory and is inefficient.
Further work is also required to convert this into a product that can be used by consumers.
Currently, this system is suited best for a laboratory environment. Creating a system that is easier to set
up and is more rugged would be a good improvement.
Overall, this prototype proved that an electronic target integrated with a smartphone is
possible. With further development work and more funding, this project has the potential to become
successful on the market. From an academic standpoint, this project provided a wide ranges of
challenges in a broad spectrum of engineering topics, from signal processing and programing to
mechanical design. This project was a wonderful capstone in our education and a testament to all we
have learned at Cal Poly.
22
References
[1] Sporting Arms and Ammunition Manufactures Institute, “ANSI/SAMMI RimFire –Z.299.1,” 1992
Defense of source: SAMMI is the association in charge of setting the national standards for
ammunition.
[2] R. Ford and C. Coulston, Design for Electrical and Computer Engineers, McGraw-Hill, 2007
Defense of source: This book provides a guideline for Electrical Engineers on design projects.
[4] SIUS Electronic Scoring Systems, “Large Installations Overview and Components” 2014
Defense of source: SIUS is one of the leading manufacturers of electronic scoring systems
worldwide.
Defense of Source: Statistics are updated every 7 days from all apps running the Google Play
Store App (Android 2.2 and above)
Defense of Source: A research paper published by the NSSF on the economic impact of target
shooters. The NSSF is the trade association of the firearms industry in the US.
23
[8] Digilent Inc., “PmodMICRefComp”, 2009
http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,401,517&Prod=PMOD-MIC
Defense of Source: Digilent is the manufacturer of the PmodMIC and the corresponding VDHL
driver
24
Appendix A: Senior Project Analysis
Project Title: Electronic Target with Smartphone Integration
2. Primary Constraints
Some of the biggest challenges with this project are in the design of the target. It must be
durable to withstand the impact of the projectile, while being sensitive enough to detect the
shots. The other main constraint is cost. It must be affordable for recreational users.
3. Economic
Because this system is being developed as a senior project, it alleviates much of the labor costs
that would normally be associated with the design of such a product. This means the majority
of the cost will be in raw materials. The financial contribution required by such a project, would
fall largely on the shoulders of the student designing the system. Below shows a preliminary
cost estimate for this project.
5. Environmental
Because this is a non-invasive system, it should have minimal environmental impact. The main
concern is with manufacturing, and any byproducts that could be produced as a result.
25
6. Manufacturability
Because of its simple mechanical design, this system should be easy to manufacture on a large
scale. As the scale increases, the overall cost should go down, a benefit for both the
manufactures and the consumer.
7. Sustainability
This system should be able to last at least 5 years before need of repair. The overall design
requires a minimal amount (if any) of replaceable parts, keeping the maintenance costs low.
One area that has potential for expansion is using multiple of these systems in conjunction with
one another. If a range were to purchase a set of these, the would be able to save money by
only needed one RF transmitter or control unit, depending on the design upgrades that were
implemented.
8. Ethical
In the IEEE Code of Ethics it says,
“To accept responsibility in making decisions consistent with the safety, health, and welfare of
the public, and to disclose promptly factors that might endanger the public or the
environment;” [3]
This means that safety considerations must be made when using and designing for firearms.
26
Appendix B: User Manual
This manual explains how to setup & use the Smart Shot system and smartphone application.
1. Plug in PmodMIC: Right sensor in Pmod header JD(3:0), top sensor in Pmod header JD(7:4), left
sensor in Pmod header JC(3:0).
2. Connect the Arduinio Uno: Digital Pins(9:2) connect to Pmod Header JE(7:0), Digital Pins(13:10)
connect to Pmod Header JB(3:0).
3. Power up Zybo and download program via Xilinx SDK, connect Arduino to power.
4. Turn on app launch new session. Verify Bluetooth connection.
5. Click resume twice in SDK until idling in main()
6. Launch Realterm and connect to Zybo, check “capture Hex” and click “Start Capture”
7. Strike the plate with the hammer
8. Wait for data to finish transferring and click “Stop Capture”
9. Run formatTXT.py on capture.txt from Realterm
10. Open data in excel and select “text” as data format.
27
Figure 1: Bluetooth Settings
Once the target is paired successfully, open the app by tapping the icon. At this point the app
will check to make sure your Bluetooth is enabled. If it is not, please turn it on by clicking “yes” on the
Bluetooth permission request. From here, tap “New Session” to begin.
28
Once you have tapped new session, you should see the Session Info Screen, as pictured below in
figure 2. You can select the appropriate information by first tapping on the drop-down menus, then
tapping the correct entry. If the entry you want is not present, tap “new” to add one. Once you are
done, tap “Save.” You may optionally skip this by tapping “Skip this step.”
29
At this point you should be on the shooting screen, as shown below in figure 3. From here you
are ready to begin shooting. Any shots you take that hit the target will show up on the target. You may
also access the options menu at the top right to save, exit to the main menu, start a new session, update
weather information, undo shots, or clear the target. If you wish to view information about the session,
tap “Session info.” If you wish to edit any of the information on screen, tap “Edit.”
When you enter this screen, the app will try to retrieve weather information based on your
current location. If a failure message shows, please check to ensure that your location services are
enabled. Once they are, tap “Update Weather” in the options menu to refresh.
30
Once you are done shooting, you can exit to the main menu via the settings menu. Any action you take
which leaves the shooting screen will automatically save your session.
To review old sessions, tap the “View Old Sessions” button on the main menu. This will take you
to the session management screen, as shown below in figure 4. Tap a shooter to expand or hide their
files. Select files by tapping them. Once one or more files are selected, you may overlay them by tapping
“Overlay Selected,” delete them by tapping “Delete Selected,” or continue a session by tapping the
“Continue Session” button. Note that a single session must be selected in order to continue it.
31
If you choose to overlay sessions, you will be taken to the overlay screen, as shown below in
figure 5. There you may tap each session to show or hide it from the target, or click “details” to show the
information associated with that session. You may exit either by pressing the back button or exiting to
the main menu via the options menu.
32