Devices & Components
Arduino Uno Rev3
Breadboard (generic)
IR Proximity Sensor
Speaker, Micro
5 mm LED: Red
Hardware & Tools
Plier, Long Nose
Multitool, Screwdriver
Software & Tools
Arduino IDE
Project description
Code
Source Code For Marker Beacon System
c_cpp
1int irInner=6,irMiddle=7,irOuter=8,irRunway=10; 2int ledInner=4,ledMiddle=2,ledOuter=3; 3int sound = 11; // Declaration of variables with pin numbers of components 4int valIn=0,valMd=0,valOt=0,valRunway=0; 5int check1=0, check2=0, check3=0; // Declaration and initialization of variables 6 7void setup() 8{ 9 10 Serial.begin(9600); 11 12 pinMode(irInner, INPUT_PULLUP); // input component 13 pinMode(ledInner, OUTPUT); //output component 14 15 pinMode(irMiddle, INPUT_PULLUP); 16 pinMode(ledMiddle, OUTPUT); 17 18 pinMode(irOuter, INPUT_PULLUP); 19 pinMode(ledOuter, OUTPUT); 20 21 pinMode(irRunway,INPUT_PULLUP); 22 23} 24 25void loop() 26{ 27 28 valIn=digitalRead(irInner); //getting current state of sensor(HIGH or LOW) 29 valMd=digitalRead(irMiddle); 30 valOt=digitalRead(irOuter); 31 valRunway=digitalRead(irRunway); 32 33 34 if(valOt==LOW ) //if obstacle on outer sensor 35 { 36 digitalWrite(ledOuter, HIGH); //led on 37 check1=1; 38 } 39 else 40 { 41 digitalWrite(ledOuter,LOW); //led off 42 } 43 44 45 if(valMd==LOW ) 46 { 47 digitalWrite(ledMiddle, HIGH); 48 check1=0; 49 check2=1; 50 } 51 else 52 { 53 digitalWrite(ledMiddle, LOW); 54 } 55 56 57 if(valIn==LOW ) 58 { 59 digitalWrite(ledInner, HIGH); 60 check3=1; 61 check2=0; 62 } 63 else 64 { 65 digitalWrite(ledInner, LOW); 66 } 67 68 if(valRunway==LOW) 69 { 70 check3=0; 71 delay(6000); //programme execution delay for 6 sec 72 } 73 74 75 if(check1==1) // 76 { 77 tone(sound, 1000, 350); //buzzer or speaker making sound 78 delay(500); 79 } 80 if(check2==1) 81 { 82 tone(sounds, 4000, 100); 83 delay(150); 84 tone(sounds, 1000, 150); 85 delay(300); 86 87 } 88 if(check3==1) 89 { 90 tone(sound, 4000, 100); 91 delay(150); 92 } 93 94}
Downloadable files
Circuit Diagram
A) IR Proximity sensor connections: 1. Connect OUT of inner marker (Sensor) to Arduino's digital pin 6. 2. Then connect the OUT of middle marker (Sensor) to Arduino's digital pin 7. 3. Same as inner and middle connect the OUT of outer marker (Sensor) to Arduino's digital pin 8 4. Then connect OUT of NRI (No Return Indication sensor) to Arduino's digital pin 10. 5. Connect the GRD i.e. (ground) of all sensors to Arduino's pin ground. 6. Connect VCC of all sensors to Arduino's pin of +5 V. B) LED's connections: 1. Connect +ve terminal of inner marker (LED) to arduino's digital pin 4. 2. Then connect the +ve terminal of middle marker (LED) to Arduino's digital pin 2. 3. Connect the +ve of outer marker (LED) to Arduino's digital pin 3. 4. After that connect all the -ve outer marker (LED) to Arduino's pin ground. C) Buzzer connection: 1. Connect one terminal to Arduino's digital pin 11. 1. Connect another terminal to arduino's Pin GRD. Circuit diagram stanltjx1s
Circuit Diagram

Circuit Diagram
A) IR Proximity sensor connections: 1. Connect OUT of inner marker (Sensor) to Arduino's digital pin 6. 2. Then connect the OUT of middle marker (Sensor) to Arduino's digital pin 7. 3. Same as inner and middle connect the OUT of outer marker (Sensor) to Arduino's digital pin 8 4. Then connect OUT of NRI (No Return Indication sensor) to Arduino's digital pin 10. 5. Connect the GRD i.e. (ground) of all sensors to Arduino's pin ground. 6. Connect VCC of all sensors to Arduino's pin of +5 V. B) LED's connections: 1. Connect +ve terminal of inner marker (LED) to arduino's digital pin 4. 2. Then connect the +ve terminal of middle marker (LED) to Arduino's digital pin 2. 3. Connect the +ve of outer marker (LED) to Arduino's digital pin 3. 4. After that connect all the -ve outer marker (LED) to Arduino's pin ground. C) Buzzer connection: 1. Connect one terminal to Arduino's digital pin 11. 1. Connect another terminal to arduino's Pin GRD. Circuit diagram stanltjx1s
Circuit Diagram

Documentation
Block Diagram
Block Diagram

Block Diagram
Block Diagram

Comments
Only logged in users can leave comments