The only electronic website that replies to every comment, and addresses all circuit related issues.

Automatic Stopwatch Circuit for Runners

In this post we are going to construct a stopwatch which automatically starts timer when the runner begins to run and the timer stops when the runner reaches the end. The elapsed time between starting and ending point is displayed on a 16 x 2 LCD.

By Girish Radhakrishnan

This project is developed for athletes who wish to develop his or her running skills without counting help on others for start and stop the timer/stopwatch. It is better to automatically start the timer by detect your motion than someone starting/stopping the stopwatch, which might add their reaction time too.

NOTE: This project is designed for measuring the time between point ‘A’ to point ‘B’ covered by ONE user at a time.

The setup consists of two lasers placed at starting point and ending point, two LDRs is also placed opposite to two laser module. When the athlete interrupts the ‘starting’ laser the time begin to calculate and when the athlete reaches the end, interrupts ‘ending’ laser and timer stops and displays the elapsed time between two points. This is the method used to measure the elapsed time in the proposed idea.

Let’s look each and every component of the circuit in detail.

The circuit is kept fairly simple, it consists of 16 x 2 LCD module, few resistors, two LDRs and a push button.



Automatic Stopwatch Circuit for Runners


The interface between LCD and arduino is standard; we can find similar connection in many other LCD based projects.

Two analogue pins A0 and A1 are used to detect laser interruptions. Analogue pin A2 is connected with push button which is used to arm the stopwatch.

Three resistors, two 4.7K and one 10K are pull-down down resistors which helps input pins to stay at low.

10K potentiometer is provided for adjusting contrast in LCD module for optimal visibility.

The proposed circuit has designed with fault detection mechanism for lasers. If any one of the laser is fault or not aligned properly with LDR, it displays an error message on LCD display.

· If START laser is not functioning, it displays “ ‘start’ laser is not working”

· If STOP laser is not functioning, it displays “ ‘stop’ laser is not working”

· If both the lasers are not functioning, it displays “Both lasers are not working”

· If both the lasers are functioning properly, it displays “Both lasers are working fine”

The error message appears until the laser module fixed or alignment is done properly with LDR.

Once this step is free of problem, the system goes to standby mode and displays “-system standby-“. At this point the user can arm the setup by pressing the push button any time.

One the push button is pressed the system is ready to detect motion from the user and displays “System is ready”.

The runner may be few inches from the ‘start’ laser.

If the “start” laser is interrupted the time begins to count and the displays” Time is being calculated……” The time is calculated in the back ground.

The elapsed time won’t be displayed until the runner reaches/interrupts the “stop” laser. This is because displaying the elapsing time on LCD as traditional stopwatch does, require several additional instructions to be executed in the microcontroller, which deteriorates the accuracy of the setup significantly.

NOTE: Press reset button on arduino to clear the readings.

How to set the circuit on running track: 






Please use thick wires to connect between LDRs and arduino circuit as the distance between these two may be several meters apart, and voltage must not drop significantly. The distance between LDR1 and LDR2 can be few hundred meters maximum.

How to mount LDR: 





The LDR must be mounted inside hollow opaque tube and front part must also be covered and only a hole with few millimetres in diameter is made for allowing laser beam to enter in.

The LDR must be protected from direct sunlight as it cannot differentiate from laser beam and other source of light and might not register motion from the user.

Program:

//-------- Program developed by R.GIRISH-------//

#include <LiquidCrystal.h>

LiquidCrystal lcd(12,11,5,4,3,2);

int strt = A0;

int stp = A1;

int btn = A2;

int M = 0;

int S = 0;

int mS = 0;

float dly = 10.0;

void setup()

{

lcd.begin(16,2);

pinMode(strt,INPUT);

pinMode(stp,INPUT);

pinMode(btn,INPUT);

}

void loop()

{

if(digitalRead(strt)==HIGH && digitalRead(stp)==HIGH)

{

lcd.setCursor(0,0);

lcd.print("Both lasers are");

lcd.setCursor(0,1);

lcd.print("  working fine");

delay(4000);

{

while(digitalRead(btn)==LOW)

{

lcd.clear();

lcd.print("-System Standby-");

lcd.setCursor(0,1);

lcd.print("Press Start btn");

delay(100);

}

lcd.clear();

lcd.setCursor(0,0);

lcd.print("System is ready");

lcd.setCursor(0,1);

lcd.print("----------------");

while(digitalRead(strt)==HIGH)

{

delay(1);

}

lcd.clear();

lcd.setCursor(0,0);

lcd.print("Time is being");

lcd.setCursor(0,1);

lcd.print("Calculated......");

while(digitalRead(stp)==HIGH)

{

delay(dly);

mS = mS+1;

if(mS==100)

{

mS=0;

S = S+1;

}

if(S==60)

{

S=0;

M = M+1;

}

}

while(true)

{

lcd.clear();

lcd.setCursor(0,0);

lcd.print(M);

lcd.print(":");

lcd.print(S);

lcd.print(":");

lcd.print(mS);

lcd.print(" (M:S:mS)");

lcd.setCursor(0,1);

lcd.print("Press Reset");

delay(1000); 

}

}

}

if(digitalRead(strt)==HIGH && digitalRead(stp)==LOW)

{

lcd.setCursor(0,0);

lcd.print("'Stop' laser is");

lcd.setCursor(0,1);

lcd.print("  not working");

delay(100);

}

if(digitalRead(strt)==LOW && digitalRead(stp)==HIGH)

{

lcd.setCursor(0,0);

lcd.print("'Start' laser is");

lcd.setCursor(0,1);

lcd.print("  not working");

delay(100);

}

if(digitalRead(strt)==LOW && digitalRead(stp)==LOW)

{

lcd.setCursor(0,0);

lcd.print("Both lasers are");

lcd.setCursor(0,1);

lcd.print("  not working");

delay(100);

}

lcd.clear();

}

//-------- Program developed by R.GIRISH-------//

Author’s prototype:






Please Share this Post:
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble



  • 18 comments:

    1. Hello Sir, i have a laptop charger 65W 19V 3.42A. One day while charging it stopped working giving a pop sound and burning smell, so i opened it find a capacitor 420V 120uf and a fuse (T3.15A 250V cq mst) blowout. In local shop I did not find the same fuse but shopkeeper give me a (rh 150c 2A 250V) which is a thermal fuse and i replaced with it and new same capacitor. Now it works fine but i have doubt the thermal fuse is worth in terms of safety as compared to original (T3.15 250V CQ MST) slow blow fuse.Please clear my doubt.

      ReplyDelete
      Replies
      1. Hello Amit, I have not yet investigated these fuses much, but I can say that thermal fuses are good, since before blowing these will tend to cause an increase in their resistance value thereby allowing a grace time for the SMPS to correct itself instead of blowing immediately...you can go ahead with the one which you are using at the moment.

        Delete
      2. Thank you sir for clearing my doubt. In my laptop charger i have noticed the blown electrolytic capacitor 440v 120uf is touching one of the heatsink and this heatsink is connected to mosfet. Is it good that capacitor touches heatsink or capacitor had blown due to overheating by heatsink.

        Delete
      3. Ideally it is not good to allow a capacitor to touch anything that may be heating up while operating.....so it must be either separated with an air gap or a non-conductor heat proof material such as a mica or a thick cardboard

        Delete
    2. Hello, in the prototype I cannot see any LDR's, so not sure how the look. Also I want to test this but would like to add up to 10 more LDRs to capture split time. Is this possible using the circuit example above ?

      Thanks

      ReplyDelete
      Replies
      1. I'll forward this question to Mr. Girish soon, and hope for an appropriate answer ..thanks for posting the question

        Delete
      2. Hi Andrew,

        In my prototype there are no LDRs. I shorted the wires in the place of LDR, which could emulate the same as a real LDR.

        You can add 10 LDRs to measure split time, but the code I wrote is intended to measure start to stop time only.

        If you request to make one with your requirements, i will try to post one soon. Just comment here.

        Regards

        Delete
    3. Hello,

      Thank you. I purchased an Arduino Uno Starter kit, and i have it sort of set up, but i won't be shy and say with a small breadboard it is confusing.

      I currently have 5 LDR's so can only use them, and once I have it working, i need to start expanding the project to the field. So any help with the code would be ideal. How do I add photos of what i have done ?

      ReplyDelete
      Replies
      1. Glad to know you have started the project, and we appreciate it....

        If it's possible Mr.Girish will try to solve it for you, he might send the necessary data to my email which will be updated in the above article soon for your reference.

        you can send the images to the following email

        homemadecircuits@gmail.com

        Delete
    4. Hello,

      Just an update, I have built the lasers, which work okay. I used a 9v battery going through a voltage regulator down to 5v, to power 5v lasers.

      The sensors, however, are a little more tricky when building them off the breadboard. The main issue I have found, is the negative going to the Analog, which shows the voltage change, has to be wired to the sensor. In the image "How to set the circuit on running track: " Where it shows 2 wires going from a sensor to the main computer box, it needs to show three. No matter which way I build the circuit it fails. Can this be confirmed pls ?

      Thanks

      Andrew

      ReplyDelete
      Replies
      1. Thanks for posting the question,I have forwarded the question to Mr. Girish for a reply

        Delete
      2. Hi Andrew,

        As per you assumption (3 wires from LDR) is when you connect the pull down resistor in the LDR module itself and then wire them all the way to main computer box.

        To reduce the usage of wire keep those pull down resistors in the main computer box and only extent those LDR wires to your starting and ending point. That is, A0 and +ve is for LDR1 and A1 and +ve for LDR2. And don't forget to align the LDRs and Lasers properly.

        I am currently designing a circuit as per you requirements which you requested before. Hopefully will be published soon.

        Regards

        Delete
      3. Great, thank you Girish.

        If I want to take this off Arduino and onto its own board, which can be powered by USB as I need the data from the sensor to travel up to a laptop, what would I need?

        I would need a chip which I can load the core OS (Arduino I guess) with power and the analog / digital node space. Am I correct in thinking I would need a chip and tiny processor? Or should a micro controller chip be enough? Perhaps I am completely wrong?

        Thanks

        Andrew

        Delete
    5. Hi Andrew,

      From Arduino you can transfer the sensor data to laptop via serial monitor only. I am not sure whether we able to extract those values to out of serial monitor.

      if you need to send those values via network or internet as you said in one of your previous mail, you need raspberry pi based project. but this doesn't mean arduino is incapable of connecting to internet.

      Regards





      ReplyDelete
      Replies
      1. Hi Girish, After pondering on what you said, I have had a look at the connectivity of the Uno, and what I was thinking is using Bluetooth to connect to the iPad, and using Arduino Manager App, I could then read the data from the Arduino. So I purchased a BLE from Amazon which arrived today, and tested it. Seems pretty good, but, I fear it will not be as easy as I would have liked. So once you have done your bit to log the timers for each sensor, I would need to learn some coding myself to ensure the data is transferred via Bluetooth to my iPad, and then create a way to present it in a acceleration graph. I think I should be able to do this, but might need a few pointers.

        I have also purchased some stuff which will allow me to make my own board, including a ATMega328p chip, and also some nano boards pre-booted with Arduino so I can test it. I have also purchased some wireless receiver/transmitters because the cable is so expensive. I am hoping to send the time to the main circuit wirelessly. These are the ones I purchased:

        https://www.amazon.co.uk/gp/product/B07254T1YQ/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1

        Of course this is when I have a working prototype, before I can send anything wirelessly, and i have a bit to learn. But thanks to your time and help I have done huge amounts in just a few weeks. So thank you for that.

        Andrew

        Delete
      2. Hi Andrew,

        I won't recommend the RF transmitter/receiver module for transmitting time data.
        You will need one arduino at each of the LDRs to send data back to main arduino, which might make your project more expensive, better stick with cables.

        coincidentally I am working on a project based on the same RF module, which is only good for transmitting data for very short distance around 10 meter. I think this is not suitable for transmitting data over 100 meter.

        Regards



        Delete
    6. what a great electronics site More crease to your elbow Swanatam and Girish

      ReplyDelete

    Please Note: If you find any DEAD link starting with http//:homemadecircuitsandschematics.blogspot.com, please replace it with http://www.homemade-circuits.com/ for making it visible and alive again.