AT89S8253 based chronograph

A place for general potato gun questions and discussions.
User avatar
FighterAce
Specialist 2
Specialist 2
Croatia
Posts: 295
Joined: Fri Oct 23, 2009 1:28 pm
Location: Croatia/Zagreb
Has thanked: 1 time
Been thanked: 4 times
Contact:

Tue Jun 10, 2014 9:20 am

Last week I've defended my graduation project and got an excellent mark so I guess now I can finally share this project with you.
It all started 6 months ago with me choosing the project "Microcontroller based projectile speed measurement". The first thing on the list was designing a frame that would hold two pairs of light sources and sensors at a precise distance from each other. After many design changes I've come up with this:

Image

It consists of 6 spacing elements (5,4), 4 mirror housings (3), 2 laser module housings(1) and 2 adjustable mirrors (6). It holds two pairs of mirrors perfectly parallel to each other so a laser beam could bounce a few dozen times inside the 20x30cm area. The angle of the laser beam can be adjusted, thus the number of reflections can be changed depending on the diameter of the projectile. The BPW-34 photodiodes are held in an adjustable fixture on the spacing element, below the laser module housings.

Image

For the project I chose AT89S8253 microcontroller since thats what we mostly used at school. Its running at 24MHz which gives me a time measurement resolution of 500ns. When the laser is directed onto the sensor, the photodiode output voltage is only about .4V which is not enough to set the microcontroller input to "1" so I had to use a LM319N high speed voltage comparator in a basic photo detector circuit. On its output I can get 3.5V when the laser is on the photodiode, and 0.8V when the laser beam is broken. This is just within specs for the AT89S8253 logic "0" and "1" voltage levels. It enabled me to program the microcontroller to check only two ports for the time measurement. Once the first laser beam is brkoen, the microcontroller starts a timer. When the second laser beam is broken, it stops the timer. Then it automatically calculates the speed v=0.3/t (sensors are .3m apart). After that it freezes the result for 1 sec so anything flying behind the projectile won't break the first laser beam and restart the measuring sequence, erasing the previous result. After that 1 sec the measurement can be repeated or the result can be displayed in fps or km/h. Power source is a Leoch hermetically sealed 12V lead acid battery regulated down to 5V with a LM317 voltage regulator.
Here is the inside of the control box:

Image

The two lasers and photodiodes mounted in the aluminum frame connect to the control box with a VGA cable. It has just enough wires to connect everything I need but unfortunately it left a mess inside. On the front of the control box there is a simple power switch. To the right of that is the 20x2 LCD. Under the LCD are two status LEDs. Once the front laser is directed onto the start photodiode, the left green LED will turn on. The same goes for the rear laser/stop photodiode and right LED.
On top of the control box are two buttons which allow for unit conversion. The default is m/s but pressing the appropriate button will display the speed in fps or km/h. This was the 10th measurement at 10 bar: (PS: "Brzina" is "Speed" in Croatian ;) )

Image

I don't have a commercial chronograph to compare the results but I did run a couple of tests. For the first test I've calculated the speed at which a .50 cal paintball will hit the ground after falling from a height of 1.8m. Its around 5.78m/s. Then I measured the speed of the same scenario with my chronograph. After 10 measurements the average measured speed was 5.85m/s which turned out to be an error of about 1%. Heres the setup:

Image

For the second test I've fired 10 .50 cal paintballs from my Barret 98b at a chamber pressure of 10 bar.

Image

The average measured speed was 178.53m/s. The only thing I could compare this to was GGDT. I'm just not 100% certain of the dead volume value since I didn't really measure the volume of the 5cm long safety switch between the barrel and QEV. Even if this value is incorrect by a fraction, the results are still surprising.

Image

GGDT estimates a speed of 178.6m/s which would mean the chronograph accuracy is 99.96%. I know that speed is just an estimate and I'm probably introducing an error with my inconsistent reading of the tiny pressure gauge and really cheap ammunition but these tests at least proved the chronograph is not spitting out complete nonsense. The real test will come when I get to compare it directly to a commercially made chronograph. The only problem is finding somebody willing to do the experiment.
“The combined synergy of a man and rifle is matchless.
The steadiness of hand, the acuity of vision and finally
the art of knowing how to make the rifle an extension of the
body all equate to the ultimate synthesis of man and machine.”
User avatar
POLAND_SPUD
Captain
Captain
Posts: 5402
Joined: Sat Oct 13, 2007 4:43 pm
Been thanked: 1 time

Tue Jun 10, 2014 10:22 am

Heh awesome build
Children are the future

unless we stop them now
User avatar
mobile chernobyl
Corporal 3
Corporal 3
United States of America
Posts: 756
Joined: Sun Dec 03, 2006 11:53 am
Been thanked: 7 times

Tue Jun 10, 2014 1:10 pm

Really cool!

I love the idea of bouncing the laser back and forth like that to essentially create a "plane" the projectile must pass through.

Now just for positive object identification so that particulate in the air/wadding doesn't through false positives when measuring muzzle velocity close to the barrel!
User avatar
wyz2285
First Sergeant 2
First Sergeant 2
Austria
Posts: 2385
Joined: Sat Mar 06, 2010 7:50 am
Location: Porto, Portugal
Has thanked: 1 time
Been thanked: 3 times
Contact:

Tue Jun 10, 2014 2:55 pm

Things like this make me wish I had learnt more about electronics... :cry:
Excellent, well done. Love the laser wall :thumbright:
CpTn_lAw wrote: :D "yay, me wanna make big multishot pnoob with 1000 psi foot pump compressor using diamond as main material. Do you think wet bread make good sealant? " :D
User avatar
jackssmirkingrevenge
Five Star General
Five Star General
Posts: 26179
Joined: Thu Mar 15, 2007 11:28 pm
Has thanked: 543 times
Been thanked: 321 times

Donating Members

Wed Jun 11, 2014 8:14 am

Fantastic!

As part of this school project, I had to figure out how calculate velocity in the absence of a chrony, so with the help of my physics mentor came up with the system illustrated below (we happened to be covering capacitors at the time). The time across the two foil strips is calculated as follows:

time = resistance x capacitance x ln(voltage across resistors/initial battery voltage)

I never compared this system to a "proper" chrony but for the launcher being tested I got an average velocity of 30 metres per second which sounds about right.

Image
hectmarr wrote:You have to make many weapons, because this field is long and short life
jimmy101
Sergeant Major
Sergeant Major
United States of America
Posts: 3197
Joined: Wed Mar 28, 2007 9:48 am
Location: Greenwood, Indiana
Has thanked: 5 times
Been thanked: 15 times
Contact:

Wed Jun 25, 2014 6:28 pm

Someday people will realize they have a high performance analog to digital system at their finger tips (literally) that can do everything a laser+uP or some caps+battery+DVM can do. And do it better. And usually without any external circuitry, or at most $5 worth of parts.

Every person that teaches math, physics, chemistry ... at the high school or college level needs to be retrained so that "laptop" is their first response any time a timing problem presents itself.
Image
User avatar
FighterAce
Specialist 2
Specialist 2
Croatia
Posts: 295
Joined: Fri Oct 23, 2009 1:28 pm
Location: Croatia/Zagreb
Has thanked: 1 time
Been thanked: 4 times
Contact:

Thu Jul 03, 2014 1:09 pm

Jack that really reminds me of the first ballistic chronograph designed by Kiryako Arvanetakis. I've had an entire segment about him in my presentation ;) Nice to see the design hasn't been forgotten, or perhaps reinvented?

Jimmy, the whole point of my graduation project was using the things I was taught during high school (PCB design, programming, analog circuits, machining, mechanical drafting, etc.) and applying them in a single project. Using a laptop to do all the work would make things too easy and probably wouldn't get me a silver medal from the Faculty of mechanical engineering and naval architecture inventors competition.
“The combined synergy of a man and rifle is matchless.
The steadiness of hand, the acuity of vision and finally
the art of knowing how to make the rifle an extension of the
body all equate to the ultimate synthesis of man and machine.”
jimmy101
Sergeant Major
Sergeant Major
United States of America
Posts: 3197
Joined: Wed Mar 28, 2007 9:48 am
Location: Greenwood, Indiana
Has thanked: 5 times
Been thanked: 15 times
Contact:

Tue Jul 08, 2014 6:31 pm

FighterAce wrote:Jimmy, the whole point of my graduation project was using the things I was taught during high school (PCB design, programming, analog circuits, machining, mechanical drafting, etc.) and applying them in a single project. Using a laptop to do all the work would make things too easy and probably wouldn't get me a silver medal from the Faculty of mechanical engineering and naval architecture inventors competition.
Probably true, but as a potential employerthe laptop approach would have impressed me more.
Image
tahirmaqsood
Recruit
Recruit
Posts: 2
Joined: Wed Mar 23, 2016 3:15 am

Wed Mar 23, 2016 3:59 am

FighterAce
sir your project ; AT89S8253 based chronograph;
is very grat
sir i want make this project for cricket ball speed
plz send me code and schematic
thanks
User avatar
FighterAce
Specialist 2
Specialist 2
Croatia
Posts: 295
Joined: Fri Oct 23, 2009 1:28 pm
Location: Croatia/Zagreb
Has thanked: 1 time
Been thanked: 4 times
Contact:

Fri Mar 25, 2016 11:05 am

Hey if you think you can reproduce this, go ahead. I couldn't find my last code with m/s to km/h and fps conversion so I'm posting the original one I submitted in paper.

Code: Select all

Dim A As Byte , Brojac As Word ,
Broj As Long , Ukup As Long , 
Time As Single , V As Single , 
Targ As Iram String * 6	

$crystal = 24000000				
Config Timer0 = Timer , 			
Gate = External , 				
Mode = 1				
On Timer0 Pot
Enable Timer0				
Enable Interrupts	
			
Config Lcd = 20 * 2				
Config Lcdbus = 4				
Config Lcdpin = Pin , 
Db7 = P1.4 , Db6 = P1.5 , 			
Db5 = P1.6 , Db4 = P1.7 ,
E = P2.1 , Rs = P2.0				
Cursor Off					

Prov:					
A = 0						
Counter0 = 0					
Cls						
Lcd " Brzina:"					
Locate 2 , 10					
Lcd Targ ; " m/s"				
Do
If P1.0 = 0 Then				
Goto Kreni					
End If						
Loop

Kreni:						
Start Timer0					
Do
If P1.1 = 0 Then				
Goto Stani					
End If						
Loop

Stani:						
Stop Timer0					
Brojac = Counter0
Goto Mat					
Pot:						
Incr A					
Return	
					
Mat:						
Do
Broj = 65535 * A				
Ukup = Broj + Brojac				
Time = Ukup / 2000000			
V = 0.3 / Time				
Targ = Fusing(v , #.##)		
Goto Prov:					
Loop

The electrical schematic is in the attachment. Good luck ;)
Attachments
Electrical schematic
Electrical schematic
“The combined synergy of a man and rifle is matchless.
The steadiness of hand, the acuity of vision and finally
the art of knowing how to make the rifle an extension of the
body all equate to the ultimate synthesis of man and machine.”
tahirmaqsood
Recruit
Recruit
Posts: 2
Joined: Wed Mar 23, 2016 3:15 am

Sat Mar 26, 2016 9:15 am

bundle of thanks sir
plz say me how to you use compiler for this code
Thanks
Post Reply