Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

chronograph project using AT89S51

Status
Not open for further replies.

aegis

Junior Member level 2
Joined
Jan 14, 2006
Messages
21
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,467
running led project using at89c51

Currently i'm doing some chronograph project, i'd like to calculate the speed of bullet ithin some distance between two photodiode sensors, i use 8051 one of the timer mode, to record bullet time travel from first sensor and to the second, after that i simply use velocity calculation to get the speed of the bullet,

i planned that these chronograph will be able to calculate velocity between 90 - 1000 fps (feet per second). i use 12Mhz crystals oscillators so that 1 cycle machine is equal to 1µs , so lets says for the worse case, the maximum time before the timer overflow is

TH * TL * one cycle machine time = 255 * 255 * 1µs = 65025 µs

i set the range between two sensors are about 0,5 feet (15,24 cm)
then i calculate 90 fps , so it takes about 5555,56 µs
for 1000 fps , it takes 500 µs

so that i will never have a timer overflow problem, but i'd like to ask some question :
1.how to write codes on AT89S51 for arimethic math operation in assembly language or maybe BASIC language(i don't understand C language), like multiply or dividing operation ?
2.is there any suggestion for this project, advice, links, comments are welcomed , thx
 

bascom code for at89s51

Multiplication and Division examples for 8051-derivatives can be found at:
**broken link removed**

Regards,
IanP
 

download compiler bascom 8051 untuk at89s51

Use BASCOM 8051, there is a free demo version with 4 K code generate limitation, enough for your project

https://www.mcselec.com/index.php?option=com_content&task=view&id=16&Itemid=41

BASCOM-8051 is the Windows BASIC COMPILER for the 8051 family. It is designed to run on W95/W98NT/XP and has all the features of BASCOM LT. In addition it has full support for arrays and the single floating point type.

Key Benefits

* Structured BASIC with labels.
* Structured programming with IF-THEN-ELSE-END IF, DO-LOOP, WHILE-WEND, SELECT- CASE.
* Fast machine code instead of interpreted code.
* Variables and labels can be as long as 32 characters.
* Bit, Byte, Integer, Word, Long, Single and String variables.
* Compiled programs work with any 8051 uP such as AT89C1051, AT89C2051, 8031, 8032, 8051, 8052, 80552, 80535 and 80537 m Processors.
* Statements are highly compatible with Microsoft’s VB/QB.
* Special commands for LCD-displays , I2C chips and 1WIRE chips.
* Integrated terminal emulator with download option..
* Integrated simulator for testing.
* Integrated flash programmer and support for SPI, PG2051, PG302, SE512, SE514, TAFE. (hardware can be purchased separately)
* Editor with statement highlighting.
* Context sensitive help.
* For compatibility with BASCOM LT, there is also a 32-bit version of the BASCOM LT compiler.

Download link:
https://www.mcselec.com/index.php?option=com_docman&task=cat_view&gid=98&Itemid=54
 

bascom chronograf

I am making ths project too, but instead of using 8051, I am using PIC micro.

My problem is using interrupts in CCS C, and also, using timers.
 

division in at89s51

is it AT89S51 is still have enough accurate timers to calculate the velocity or i should change to other micros ??
 

examples timer at89s51

Will you be using this for airsoft too? I am using PIC, timing is not very good yet on ym side because I am usig CCS delay_us(time) to count the time consumed, I ma now asking help how to do it by using timers.

Where is your location anyway?
 

at89s51 bascom

i'm live in Indonesia, yes i'm gonna use it for airsoft and i apply it for my assignment project, i just have 3 more weeks before deadline =), if u familiar with airsoft chronograph, i tried to design similar to Guarder chronograph, they also use AT89C51, so i think it can handle the timers,

so finally i found someone involve with airsoft here =),
 

+bascom +at89s51 +clock

Mas aegis wrote:
is it AT89S51 is still have enough accurate timers to calculate the velocity or i should change to other micros ??

at your first post you make a detail calculation :
TH * TL * one cycle machine time = 255 * 255 * 1µs = 65535 µs

i set the range between two sensors are about 0,5 feet (15,24 cm)
then i calculate 90 fps , so it takes about 5555,56 µs
for 1000 fps , it takes 500 µs

so that i will never have a timer overflow problem

above calculation is right, so you should not change to other micro.

Maximum operating frequency of AT89S51 is 33 MHz, if you use 24 Mhz xtal, you get twice accuracy than you calculation!

i'm live in Indonesia
Merdeka !
 

timer lcd pic chronograph

Let assume that speed of bullet for a gun is about 150 - 200 meters per sec and there are 2 proximity sensors put to sense a bullet on trajectory placed 1 meter apart from each other . From above we can get that 1meter distance will be approached in 1/200 = 5 milliseconds. To get a speed from these measurement we should calculate :
Speed = 1/Tdelay
For given max error time granuality for easurement must be

Speed + Err = 1/(Tdelay + Terr)

Terr = 1/(Speed + Err) - Tdelay

That means your accuracy is depended on :
- your cpu clock stability should be scaled to time dfelay measurement case.
- proximity sensor delay time (mainly differential value between 2 proximity sensors)
- Other delays in electrical circuits

Let say for accuracy of 1 m/s you need to measurem timing resolution better than 25 usec. That means
24 usec > Terr_clock + Terr_sensor + Terr_int


What i would do if will do this project :
- Evaluate photodiodes for speed
- Evaluate transimpednace amplifier and candidate opamps
- Evaluate cadidate comparators on transpimpednace amplifier output
- Use input capture timers (in avr micro terms)
- Consider using visible light laser for proximity sensor (i suppose that when gun is shot , in front of bullet there could be air flow which can lead to early proximity sensor triggering).
 

avr chronograph

aegis said:
i'm live in Indonesia, yes i'm gonna use it for airsoft and i apply it for my assignment project, i just have 3 more weeks before deadline =), if u familiar with airsoft chronograph, i tried to design similar to Guarder chronograph, they also use AT89C51, so i think it can handle the timers,

so finally i found someone involve with airsoft here =),

Have you seen the internals of the guarder chrono? Can you post some pics of an opened chrono?

Thanks.

Glenjoy
 

chronograph 8051

i'll asked my friend to do that, because that chrono wasnt mine

i'll post the pic here when i already got it

btw how do u put ur photodiode sensors placement ? is one photodiode for each sensor are enough , or should i use more than one, to cover all area ?
 

I used phototransistors and LED's, I am thinking if it will be better to use visible light or an infrared.

Have you seen the sensors and lightsource being used by the guarder?

I haven't seen an actual chrono.

Glenjoy
 

phototransistors are not the best choice because they are slow. Before considering it you should define your acceptable measurement error ... If your project needs accuracy of course.
 

So the best to use is photodiode? Btw, can PIC at 8Mhz using CCS C can measure time to a minimum of 312 us?

A pellet running at 800 feet per sec, and sensors placed 3 inches apart, time measured to travel that distanceis 312 us, can pic measure it accurately?

Thanks.
 

what kind of LED did u use ? an IR or just usual LED ? what u gonna do to prevent any external light disturbance ? since what i know , the photodiode is really sensitive with any light , CMIIW

i already have a backup plan, if the photodiode doesnt worked, i gonna use an IR slit (4 or 5 pin maybe), it similar to IR for mouse scrolling system, i already tested using manual calculation with a help from osciloscope, but the problem is, the max range for the slit, is really small , the package is come with the range less than 6mm (bb size), so i must cut in the mid of slit, so the bb can pass through the sensors
 

As of now I am not yet really on the type of LED or sensor to be used, I am still under the test of themicro if it can really handle such time constraint using CCS C.

Added after 2 minutes:

**broken link removed**
 

thx for the link is helping me,

i'll add some more progress later
 

Re: chronograph 8051

i'll asked my friend to do that, because that chrono wasnt mine

i'll post the pic here when i already got it

Hi ,
I am working on chronograph project too . Did you get the pics ? Inside pics of another chronos would be nice . So we can see which microcontroller and crystal used.

I am planning to use atmega16 with 16 Mhz crystal.
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top