Another illustration how to build a simple physical intrusion detection with laser and photoresistor (or light-dependent resistor, LDR, or photocell). This guide shows how to wire and build a laser tripwire that triggers an alarm or output when the laser is interrupted with any objects that pass. As you can see the diagram below it uses a module for this demonstration. There are two options to be followed here one is wiring manually and two wiring together with the prebuild modules. See the illustration below.
Components Required for Assembly
- ESP8266 Boards / Arduino Boards / Raspberry Pi / AVR
- Laser Valve
- LDR / Photodiode
- 10k Resistors
- 1 uf Capacitor
- 100 uf Capacitor
- Power Diode
- Trimmer / Potentiometer
- Solderless Breadboard / PCV Board
- Jumper Wires
- LED
- 220 Ohms Resistor
- Buzzer (Optional)
Wiring Diagram for Assembly
Components required for module
- ESP8266 Boards / Arduino Boards / Raspberry Pi / AVR
- Laser Valve Light Transmitter Module
- LDR / Photodiode Module
- Solderless Bread Board
- Jumper Wire / DuPont Wire
- LED
- 220 Ohms Resistor (For Pin 13 you dont need to place a resistor)
- Buzzer (Optional)
Wiring Diagram for Module
Source Code / Sketch Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
/* 14CORE Test Code for: Tripwire .:+osysso++:` `+yhs/-` `-+s+` `:/+++++++++` .:/++ooo++/-` .ooooooooooo+: :///////////- `odh/` `:y+` /ddhsooooooo+ /hddhsooooydddh sdddoooooosdddy` `////////////` -hds` `sy. +ddy` .ddd: sddy.dddo +ddd- .-----------` `hds :sssss/ -ossssso-yy` `hdd: oddy `ddd/oddd:......+dddo .++++++++++++ +dd` :sdddh` :ydddddddo +y/ .ddd+........ `hddy:.....:yddy.hdddddddddddy+. ```````````` ydy .hddd/+hdddhydddh/.+yo /hdddddddddd. :shddddddddhs/`+ddd:````-yddy- :ooooooooooo+ odh` sdddooyyyyyhddddyy.sy+ ` `......... ``.... ....` ```...` ` `` `` ` -dd+`::::` .:::- /yy. -oos+:-oos+--oos+: /o `+y o/: o:+/ h:`yos /+-`/+/+ s:y/y. /dd/ `+yy: +//+ +/:+ +/:+ -. `/ -:o.:/:`//+- + +:- :`-+:`://: +`o`+. -yds. `/yys- .`-.. .``` ```` .`` ` ` ``` ``-..` ` :ydy/.`````.-/oyhs: `+++oo+oo+:.+-++/-/ooo+o +:o/oo///:+/ .:oyhhhhhhhso:` `. ``` */ int LedOutput = 12;// Define as LED Output Pin 12 you can change this to 13 if you dont what pin 12 as output indictor int SensorPin = 2; // Define as Sensor Pin Input int Value;// Define as variable void setup() { pinMode(LedOutput,OUTPUT);//Set as LED output pinMode(SensorPin,INPUT);//Set as photo interrupter sensor output interface } void loop() { Value=digitalRead(SensorPin);// Set as sensor read SensorPin if(Value==HIGH) //If value is equal to HIGH estate then turn LED output = high { digitalWrite(LedOutput,HIGH); // Set ledoutput to HIGH or ON } else { digitalWrite(LedOutput,LOW); // Set landoutput to LOW or OFF } } |
Wiring The Laser Transmitter on Photocell with Microcontroller
Pingback:Wiring the 14CORE 37 Sensors for Arduino & Raspberry Pi | 14Core.com