Using an Arduino - we are using a Nano V3.0 compatible board - we want to demonstrate on how an alert system could be build, where an alert is triggered if an object interrupts the path of light.
Think of a customer entering a shop, an intruder entering an area.
You could reverse the example and trigger an alarm when the light path is restored - for example to detect if an object has been removed.
NoteThis tip uses a laser as a directed and focus light source. While we are only using a 650nm 5mW laser, please be always careful not to point the laser at persons, animals.
Our code can run in two modes
1) It will continuously sound alarm once it has been triggered. Only way to stop alert is reset the Arduino
2) It will sound alert when light path is lost and will stop sounding alert once light path is restored.
Requirements- Arduino (compatible) development board - we used the Arduino Nano compatible board (see here)
- Laser Transmitter Module - KY-008 (see here)
- Passive Buzzer Module - KY-006 (see here)
- Photo-resistor Module - KY-018 (see here)
- Arduino IDE (download here)
- This tip is focused on using the Arduino IDE
KY-006 | Arduino
PIN S | D4
PIN (middle) | NOT USEDF
PIN - | GND
KY-018 | Arduino
PIN S | A0
PIN + | VCC
PIN - | GND
Comments