Pages: [1]   Go Down
Author Topic: Motocross lap timer  (Read 1168 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 4
Posts: 391
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So i ride motocross and it sucks balls timing your buddy and writing his times on a pit board for him to see so thats where this idea came from. Automation and electronics is your friend:)

So the First thing was to build a big ass Seven Segment Display. i used 5mm LED's and 360 of them haha. the Display is about 10 inches high by about 32 inches wide. It has 4 digits and decimals as well. The next thing was to drive the Display. What a learning curve.

I am using an atmega328 to do all the thinking. And obviously there are not enough pins to control all 31 segments so what did i do? At first i panicked and though i wasted my money buying the arduino uno R3 but i did research and came across multiplexing:) it Took me a very long time to understand what multiplexing is cause this is my first electronics project ever!!!!!!!!!!!!!! i started about 2 months ago reading on electronics and read up on the raspberry pi and i was like wow thats kewl. I have a background in programming as i got into it a few years ago but i learnt python and basically just wrote useless command line programs and one nice GUI, like a data base for names numbers bla bla. Anyways so i researched further on this Raspberry pi because i thought "Hey now i can actually do something useful with my programming knowledge like interact with lights and switches and the real world!!!" so i carried on reading and came across the arduino and microcontrollers and then i was like that one!!!!!!!!!!! So i bought the arduino uno R3 and started learning C programing.

Sorry im talking so much im just giving a whole background to my project. Ok but thats enough. back to the LAp timer.

So i figured out that multiplexing is basically just switching between the displays very fast and your feeble human brain is fooled and it thinks all the digits are on at the same time. So this was like so interesting for me, i could not believe how clever this was, it is unbelievably clever!!!!!! So i was like i AM DOING MULTIPLEXING AND THATS THAT!!!!!!!!!!!! i bought shift registers and a whole bunch of stuff and read up on that but i still wanted to do the multiplexing because i wanted to learn about it.

So the display i built is wired up as a Common Anode and i switch between grounds to multiplex the different digits.

The next brick wall i hit was that the microcontroller can only put out so much current and i panicked again!!!!!!!!!!!1 but then i hit google and discovered the world of transistors and mosfets!!!!!!!!! YAY!

So then i found out that i need to do high side switching and i need to use n channel mosfets or npn transistors to drive p channel mosfets or pnp transistors!!!!!!!! i was like HUH!!!!!!????????

I asked for help on this forum and many people helped me understand this concept so thanx alot to everyone that helped me.

So the way the timer works is i have a laser shining on a photodiode which is connected to the analog pin and ground. When a bike comes past the analog value drops and the program triggers the timing mechanism and displays a lap time. Its hard to explain but i will post the code i wrote.

Here are some pictures of my project


The Display



The Display frame


The Control Box with all the electronics


High side switching


Low side switching


Stand alone atmega328


Display with LED's in displaying 15 seconds


viewing display headon (the LED's have a 20 degree viewing angel and are very bright if you within the angle. The photo is a complete blur but the human eye can read it perfectly. very bright.



I still need to sort the laser out as it gets hot and dims after about a minute or so but i have a heat sink and will be fitting it shortly. Anyways ya this post might be a mess but thanx to all the people that helped me out especially MR CrossRoads


So let me know what you guys think:)
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 391
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried posting my code but it exceeded the max characters
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Click on "Additional Options", Choose File, and browse to the sketch file and attach it.
Be sure to document all you've done in case you need to make changes, repairs, or another one smiley
« Last Edit: December 13, 2013, 12:50:46 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

NSW Australia
Offline Offline
Faraday Member
**
Karma: 87
Posts: 3548
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still need to sort the laser out as it gets hot and dims after about a minute or so but i have a heat sink and will be fitting it shortly.

I think we came to the conclusion that the laser may not be rated for continuous operation.  If you can arrange to pulse it at say, 100 Hz with a 20% duty cycle, its average power can be constrained accordingly, and you can AC couple the detector to provide ambient light rejection.
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 391
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still need to sort the laser out as it gets hot and dims after about a minute or so but i have a heat sink and will be fitting it shortly.

I think we came to the conclusion that the laser may not be rated for continuous operation.  If you can arrange to pulse it at say, 100 Hz with a 20% duty cycle, its average power can be constrained accordingly, and you can AC couple the detector to provide ambient light rejection.


Will this not cause the analog value of the photodiode that is used to detect a bike breaking the laser to fluctuate as the laser is pulsed?

And I'm still confused because if the laser was designed to be pulsed I'm pretty sure the driver of the laser will make sure it is getting pulsed. I have not removed the driver from the laser
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 391
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the code if anyone is interested. please keep in mind that im new to this so my code might be inefficient but it works

* track_timer_v4_5_auto_setup.ino (17.68 KB - downloaded 30 times.)
Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 87
Posts: 3548
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will this not cause the analog value of the photodiode that is used to detect a bike breaking the laser to fluctuate as the laser is pulsed?

Yes, exactly!  That is how you know you are receiving the laser light and not ambient light - including other shadows.  Given that the pulses are much shorter than the beam being broken by a bike, it is the lack of such fluctuations that you detect as an indication the beam has been broken.

And I'm still confused because if the laser was designed to be pulsed I'm pretty sure the driver of the laser will make sure it is getting pulsed. I have not removed the driver from the laser

The laser is designed to be powered on for a few seconds as it is pointed at some object such as a projection screen.  It may even have the button mounted on the module for use in a laser pointer housing.

The principal limitation to modulating (switching) the laser is whether the driver has a capacitor on it which slows its response.  I believe the problem of rapid switching was addressed in the reference to which you were directed in the previous thread.

Some laser modules are sold with a third, yellow control line as "TTL" - in other words, logic - control for either modulation to distinguish them from ambient light sources, or for communications.
Logged

Offline Offline
Sr. Member
****
Karma: 4
Posts: 391
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Will this not cause the analog value of the photodiode that is used to detect a bike breaking the laser to fluctuate as the laser is pulsed?

Yes, exactly!  That is how you know you are receiving the laser light and not ambient light - including other shadows.  Given that the pulses are much shorter than the beam being broken by a bike, it is the lack of such fluctuations that you detect as an indication the beam has been broken.

And I'm still confused because if the laser was designed to be pulsed I'm pretty sure the driver of the laser will make sure it is getting pulsed. I have not removed the driver from the laser

The laser is designed to be powered on for a few seconds as it is pointed at some object such as a projection screen.  It may even have the button mounted on the module for use in a laser pointer housing.

The principal limitation to modulating (switching) the laser is whether the driver has a capacitor on it which slows its response.  I believe the problem of rapid switching was addressed in the reference to which you were directed in the previous thread.

Some laser modules are sold with a third, yellow control line as "TTL" - in other words, logic - control for either modulation to distinguish them from ambient light sources, or for communications.




Well I did the official testing today and it works perfectly. The laser voltage regulator gets about 80degrees Celsius  but other than that it works perfectly. The laser does not dim at all even after a 20minute moto. I'm pretty sure that the laser is not gana last long though haha but so we learn.

Thanx though for planting the seed of modulation in my head I will try learn to incorporate this in to future projects.
Logged

Pages: [1]   Go Up
Jump to: