November 30, 2016

Arduino Traffic Lights



ARDUINO TRAFFIC LIGHTS

INTRODUCTION
 
Arduino is a micro-controller which can be programmed to do certain operations like lighting led, controlling servo, etc. We’ll use Arduino UNO or any other clone to create Traffic lights. A Traffic light usually consists of three lights red, yellow and green. They switch on and off within a certain time interval. The time interval between the lights is similar to the real traffic light system.



MATERIALS REQUIRED

  • Arduino UNO or any other clone and USB cable

  • 5mm LED (Red, Yellow and Green)

  • 20 K ohm resistor (3)

  • Breadboard

  • Jumpers


PROCEDURE


  • Connect digital pin 8 of Arduino to longer leg of led via a resistor and connect the shorter leg of ‘Red’ LED to ground pin on Arduino.

  • Similarly connect digital pin 7 to ‘Yellow’ LED and digital pin 4 to ‘Green’ LED via a resistor and back to another ground pin on Arduino.

  • The circuit is complete, upload the code and you can verify the output.

  • The USB cable serves both as a medium to upload code as well as 5V power source.


CODE

The code for Traffic lights is as follows. Copy and paste it on Arduino IDE.

void setup() {

  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(4, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(8, HIGH);   // turn the red led on
  delay(5000);              // wait for some time
  digitalWrite(8, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(7, HIGH);   // turn the yellow led on
  delay(1000);             // wait for some time
  digitalWrite(7, LOW);    // turn the yellow led off
  delay(100);              // wait for some time
  digitalWrite(4, HIGH);   // turn the green led on
  delay(5000);             // wait for some time
  digitalWrite(4, LOW);    // turn the green led off
  delay(200);              // wait for some time
}

November 27, 2016

Time dilation in Concorde Airplane



TIME DILATION IN CONCORDE AIRPLANE

INTRODUCTION
Concorde was a French Commercial airliner which was capable of traveling at supersonic speeds. The Concorde had a top speed of 2.04 Mach. Consider an observer in Concorde who travels from destination A to B and another observer who is stationary with respect to the Concorde. According to the Special Theory of Relativity, the Concorde’s clock would run slower compared to the observer’s clock. We’ll find the time gained by the Concorde relative to the stationary observer.



ASSUMPTION
The effect of Gravitational time dilation is negligible.

CALCULATION
The Concorde’s velocity is,
v = 2.04 Mach = 605.27 m/s

According to the Special Theory of Relativity, the time dilation equation is,
t' = t/γ [s]
t’ – Actual time or Concorde’s time. [s]
t - Proper time or Stationary observer’s time. [s]
γ – Relativistic gamma factor, γ = 1/√ [1-(v/c) 2]
c - Velocity of light [c = 3*108 m/s]

t' = t*√ [1-(v/c) 2]
t' = t*√ [1-4.0705*10-12]
t' = t*√ [0.999999999995929]
t' = t* 0.999999999997965

CONCLUSION

We can observe that proper and actual time isn’t the same which proves that time dilates on Concorde relative to the stationary observer. We’ll consider 3 different t’ values and calculate t value. The larger the t’ the more is the difference between t and t’. Thus the Concorde gains 7.33nanosecond in 1 hour and 51.3nanosecond in 7 hours over the stationary observer. 

Time
t’ [Stationary observer] (s)
t [Observer in Concorde] (s)
Difference (s)
1 minute
60
59.9999999998779
0.0000000001221
1 hour
3600
3599.99999999267
0.00000000733
7 hours
25200
25199.9999999487
0.0000000513