Tuesday

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:


4 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

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.