December 30, 2018

Super sonic doppler shift in a military jet



SUPER SONIC DOPPLER SHIFT IN MILITARY JET


INTRODUCTION

We know that Doppler Effect or Doppler shift occurs between a source and observer when they are in relative motion with respect to each other. In this case we’ll determine the Doppler shift that occurs when a supersonic military jet is moving toward a stationary observer in a building. A supersonic military jet is a jet that moves faster than the speed of sound thereby leading to a sonic boom. A sonic boom is an explosion that occurs when any object travels faster than sound. Consider a military jet moving at a speed of Mach2 approaching an observer who is inside a building. We’ll determine the apparent frequency of the jet’s noise as registered by the observer.

ASSUMPTIONS

1. The atmospheric air has standard temperature and pressure conditions
·         Temperature T = 298 K or 25°C or 77°F
·         Pressure = 1 bar = 105 N/m2
2. The effect of humidity on sound is negligible
3. The amplitude of sound is unity
4. The air molecules do not move with respect to source and observer

CALCULATION

The equation for Doppler shift is given by,
f’ = f0*{[V ± Vo]/[V ± Vs]} (Eqn. 1) 
f0 – Original frequency (Hz)
f’ – Apparent or observed frequency (Hz)
V – Velocity of Sound in air at standard temperature and pressure conditions (m/s) {V = 343 m/s}
Vo – Velocity of observer (m/s)
Vs – Velocity of Source [Jet] (m/s)

Since the observer is stationary,
Vo = 0 (Eqn. 2)

Substitute equation (2) in equation (1),
f’ = f0*{[V]/[V – Vs]} (Eqn. 3)

The ‘–’ sign in the denominator of equation (3) indicates that the source is approaching the observer.

The velocity of jet Vs = Mach2
           = 2*speed of sound                                           {⸪ Mach1 = speed of sound}
           = 2*343
           = 686 m/s (Eqn. 4)

Frequency of jet exhaust noise f0 = 1000 Hz (Eqn. 5)
Speed of sound in air V = 343 m/s (Eqn. 6)

Substitute equations (4), (5) and (6) in equation (3),
f’ = 1000*{343/[343 – 686]}
f’ = – 1000 Hz

This is the frequency of sound as registered by the stationary observer in a building when a supersonic military jet approaches him. The negative value of apparent frequency indicates that the object [jet] is traveling faster than sound waves. Therefore the observer will hear the same frequency but after the jet has passed as the sound waves take some more time to reach the observer. Apparently there is no Doppler shift since the observer is registering the exact frequency of sound as emitted by the source. The observer will hear sound of different frequency when the jet moves away from him which we’ll discuss in the next post.

Difference in frequency = f’ – f0
                                       = – 1000 – 1000
                                       = – 2000 Hz

CONCLUSION

We thus determined the apparent frequency as registered by the observer due to Doppler shift and concluded that the observer will be able to hear the exact value of frequency of jet noise only after the supersonic jet has passed.


December 23, 2018

Arduino Theatre dim lights tutorial


ARDUINO THEATRE DIM LIGHTS TUTORIAL


INTRODUCTION

Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate theatre dim lights. The dimming or fading of lights is observable in theatres, car interior cabin lights, etc. Dimming or fading is a process of gradually increasing or decreasing the brightness of light. The theatre dim light setup consists of three yellow LED’s. Together they switch on and off gradually within a specified time. The time value here is 300 millisecond.  

COMPONENTS REQUIRED

1. Breadboard
2. Arduino UNO and USB cable
3. Three 5mm Yellow LED’s
4. Three 20 Ohm resistors
5. Jumpers
6. A 5V Power supply

CIRCUIT SCHEMATICS

Figure.1 Arduino theatre dim lights schematic

Make the appropriate connections as shown in the schematic above

CODE

This is the code for simulating Arduino Theatre dim lights. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed but ensure only analog pins are selected. Analog pins are usually marked with a ‘~’ in front of the pin number. Copy and paste the code in Arduino IDE sketch area.

int led1 = 3;           // the PWM pin the LED is attached to
int led2 = 5;
int led3 = 6;
int brightness = 0;    // how bright the LED is
int fadeAmount = 5;    // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
  // declare pins 3,5,6 to be outputs:
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
  // set the brightness of pins 3,5,6:
  analogWrite(led1, brightness);
  analogWrite(led2, brightness);
  analogWrite(led3, brightness);
  // change the brightness for next time through the loop:
  brightness = brightness + fadeAmount;
  // reverse the direction of the fading at the ends of the fade:
  if (brightness <= 0 || brightness >= 255) {
    fadeAmount = -fadeAmount;
  }
  // wait for 300 milliseconds to see the dimming effect
  delay(300);
}

December 16, 2018

Arduino 10 second timer tutorial


ARDUINO 10 SECOND TIMER TUTORIAL


INTRODUCTION
Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate a 10 second timer. Timers are used to count down time from a specified value to zero in increments of 1 second. The numbers ‘9’ to ‘0’ are displayed by the LED’s themselves. This is possible by arranging a 3x3 matrix of 9 LED’s where each LED is either switched on or off in order to display the particular number. The codes define which LED should light up and which shouldn’t in order to display the number accurately. The LED’s display numbers from ‘9’ to ‘0’ with a delay of 1 second and hence is the 10 second timer.

COMPONENTS REQUIRED

1. Breadboard or Perforated board
2. Arduino UNO and USB cable
3. 5mm White LED’s (9 nos.)
4. 20 Ohm resistors (9 nos.)
5. Jumpers
6. A 5V DC Power supply

CIRCUIT SCHEMATICS

Figure.1 Arduino 10 second timer schematic

Make the appropriate connections as shown in the schematic above

CODE

This is the code for simulating Arduino 10 second timer. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed. Copy and paste the code in Arduino IDE sketch area.

void setup() {
  // put your setup code here, to run once:
pinMode (2,OUTPUT);
pinMode (3,OUTPUT);
pinMode (4,OUTPUT);
pinMode (5,OUTPUT);
pinMode (6,OUTPUT);
pinMode (7,OUTPUT);
pinMode (8,OUTPUT);
pinMode (9,OUTPUT);
pinMode (10,OUTPUT);
}
void loop() {
  // put your main code here, to run repeatedly:
//number9
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number8
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number7
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
delay(1000);
//number6
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number5
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number4
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
delay(1000);
//number3
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number2
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
//number1
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
digitalWrite(10, HIGH);
delay(1000);
//number0
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, HIGH);
digitalWrite(6, LOW);
digitalWrite(7, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
digitalWrite(10, HIGH);
delay(1000);
}

December 9, 2018

Arduino street lights Pt2 Tutorial


ARDUINO STREET LIGHTS PT2 TUTORIAL


INTRODUCTION

Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate street lights using 20 LED’s and transistors for amplification. Currently due to advancements in technology, LED’s are replacing incandescent, fluorescent and halogen lamps. LED’s are inexpensive, robust and most importantly efficient. LED’s are already powering many parks, streets in cities and villages. They themselves are recharged by solar power thus they represent a completely green source of energy.

COMPONENTS REQUIRED

1. Breadboard
2. Arduino MEGA and USB cable
3. 5mm White LED’s (20 nos.)
4. 20 Ohm resistors (20 nos.)
5. 10 Ohm resistors (20 nos.)
6. NPN Transistor (20 nos.)
7. Jumpers
8. A 5V DC Power supply

CIRCUIT SCHEMATICS

Fig.1 Arduino street light pt2 schematic

Make the appropriate connections as shown in the schematic above

CODE

This is the code for simulating Arduino Street lights version 2. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed. The schematic only displays for 5 LED’s due to lack of space. Mimic the same setup for other LED’s as well. The given code is for 20 LED’s. Copy and paste the code in Arduino IDE sketch area.

void setup() {
  // put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
pinMode(14, OUTPUT);
pinMode(15, OUTPUT);
pinMode(16, OUTPUT);
pinMode(17, OUTPUT);
pinMode(18, OUTPUT);
pinMode(19, OUTPUT);
pinMode(20, OUTPUT);
pinMode(21, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite (2, HIGH);
digitalWrite (3, HIGH);
digitalWrite (4, HIGH);
digitalWrite (5, HIGH);
digitalWrite (6, HIGH);
digitalWrite (7, HIGH);
digitalWrite (8, HIGH);
digitalWrite (9, HIGH);
digitalWrite (10, HIGH);
digitalWrite (11, HIGH);
digitalWrite (12, HIGH);
digitalWrite (13, HIGH);
digitalWrite (14, HIGH);
digitalWrite (15, HIGH);
digitalWrite (16, HIGH);
digitalWrite (17, HIGH);
digitalWrite (18, HIGH);
digitalWrite (19, HIGH);
digitalWrite (20, HIGH);
digitalWrite (21, HIGH);
}

December 2, 2018

Arduino Club lights tutorial


ARDUINO CLUB LIGHTS TUTORIAL


INTRODUCTION

Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate club lights. Clubs usually have cool colors like red, pink, blue and purple. These colors are flashed randomly without any pattern which creates a perfect environment for disco and partying.

COMPONENTS REQUIRED

1. Breadboard
2. Arduino UNO and USB cable
3. 5mm Red LED (5 nos.)
4. 5mm Blue LED (5 nos.)
5. 20 Ohm resistors (10 nos.)
6. Jumpers
7. A 5V DC Power supply

CIRCUIT SCHEMATICS

Figure.1 Club lights schematic

Make the appropriate connections as shown in the schematic above

CODE

This is the code for simulating Arduino Club lights. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed. Copy and paste the code in Arduino IDE sketch area.

void setup() {

  pinMode(2, OUTPUT);  //red led
  pinMode(3, OUTPUT);  //blue led
  pinMode(4, OUTPUT);  //red led
  pinMode(5, OUTPUT);  //blue led
  pinMode(6, OUTPUT);  //red led
  pinMode(7, OUTPUT);  //blue led
  pinMode(8, OUTPUT);  //red led
  pinMode(9, OUTPUT);  //blue led
  pinMode(10, OUTPUT);  //red led
  pinMode(11, OUTPUT);  //blue led
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(2, HIGH);   // turn the red led on
  delay(100);              // wait for some time
  digitalWrite(2, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(3, HIGH);   // turn the blue led on
  delay(100);             // wait for some time
  digitalWrite(3, LOW);    // turn the blue led off
  delay(100);              // wait for some time
  digitalWrite(4, HIGH);   // turn the red led on
  delay(100);             // wait for some time
  digitalWrite(4, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(5, HIGH);   // turn the blue led on
  delay(100);             // wait for some time
  digitalWrite(5, LOW);    // turn the blue led off
  delay(100);              // wait for some time
  digitalWrite(6, HIGH);   // turn the red led on
  delay(100);             // wait for some time
  digitalWrite(6, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(7, HIGH);   // turn the blue led on
  delay(100);             // wait for some time
  digitalWrite(7, LOW);    // turn the blue led off
  delay(100);              // wait for some time
  digitalWrite(8, HIGH);   // turn the red led on
  delay(100);             // wait for some time
  digitalWrite(8, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(9, HIGH);   // turn the blue led on
  delay(100);             // wait for some time
  digitalWrite(9, LOW);    // turn the blue led off
  delay(100);              // wait for some time
  digitalWrite(10, HIGH);   // turn the red led on
  delay(100);             // wait for some time
  digitalWrite(10, LOW);    // turn the red led off
  delay(100);              // wait for some time
  digitalWrite(11, HIGH);   // turn the blue led on
  delay(100);             // wait for some time
  digitalWrite(11, LOW);    // turn the blue led off
  delay(100);              // wait for some time

}

November 25, 2018

Arduino Street lights tutorial


ARDUINO STREET LIGHTS TUTORIAL


INTRODUCTION

Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate street lights. Currently due to advancements in technology, LED’s are replacing incandescent, fluorescent and halogen lamps. LED’s are inexpensive, robust and most importantly efficient. LED’s are already powering many parks, homes, streets in cities and villages. They themselves are recharged by solar power thus they represent a completely green source of energy.

COMPONENTS REQUIRED

1. Breadboard
2. Arduino UNO and USB cable
3. 5mm White LED’s (10 numbers)
4. 20 Ohm resistors (10 numbers)
5. Jumpers
6. A 5V DC Power supply

CIRCUIT SCHEMATICS

Figure.1 Arduino Street lights schematic

Make the appropriate connections as shown in the schematic above

CODE
This is the code for simulating Arduino Street lights. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed. 

Copy and paste the code in Arduino IDE sketch area.

void setup() {

  pinMode(2, OUTPUT);  //white led1
  pinMode(3, OUTPUT);  //white led2
  pinMode(4, OUTPUT);  //white led3
  pinMode(5, OUTPUT);  //white led4
  pinMode(6, OUTPUT);  //white led5
  pinMode(7, OUTPUT);  //white led6
  pinMode(8, OUTPUT);  //white led7
  pinMode(9, OUTPUT);  //white led8
  pinMode(10, OUTPUT);  //white led9
  pinMode(11, OUTPUT);  //white led10
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(2, HIGH);   // turn the white led1 on
  digitalWrite(3, HIGH);    // turn the white led2 on
  digitalWrite(4, HIGH);   // turn the white led3 on
  digitalWrite(5, HIGH);    // turn the white led4 on
  digitalWrite(6, HIGH);   // turn the white led5 on
  digitalWrite(7, HIGH);    // turn the white led6 on
  digitalWrite(8, HIGH);   // turn the white led7 on
  digitalWrite(9, HIGH);    // turn the white led8 on
  digitalWrite(10, HIGH);   // turn the white led9 on
  digitalWrite(11, HIGH);    // turn the white led10 on
}

November 18, 2018

Arduino Traffic Lights Tutorial


ARDUINO TRAFFIC LIGHTS TUTORIAL


INTRODUCTION

Arduino is a microcontroller which can be programmed to do certain operations like lighting led, controlling servo, etc. This is a DIY Arduino project intended to simulate traffic lights on the streets. A Traffic light usually consists of three lights red, yellow and green. They switch on and off within a certain time interval. The usual cycle of traffic light starts with red light for some time, followed by a momentary yellow light as a warning and finally green light for the remaining time before switching back to red.

COMPONENTS REQUIRED

1. Breadboard
2. Arduino UNO and USB cable
3. One 5mm LED each of three colors (Red, Yellow and Green)
4. Three 20 Ohm resistors
5. Jumpers
6. A 5V DC Power supply

CIRCUIT SCHEMATICS

Traffic Light wiring schematic

Make the appropriate connections as shown in the schematic above

CODE

This is the code for simulating Arduino Traffic lights. Note that this code is valid only for the particular schematic represented in figure1. The values and choice of ports can always be changed. 

Copy and paste the code in Arduino IDE sketch area.

void setup() {

  pinMode(2, OUTPUT);  //red led
  pinMode(4, OUTPUT);  //yellow led
  pinMode(7, OUTPUT);  //green led
}

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