Project showcase
Cockroach Laser Killer

Cockroach Laser Killer © GPL3+

Kill this terrifying bug at any distance with a laser ray! (Or dream about it...)

  • 13,447 views
  • 4 comments
  • 15 respects

Components and supplies

Apps and online services

About this project

If you feel terrified about cockroaches...

You problem is now solved with " Cockroach Laser Killer!

No more embarrassing excuses to run off from them!

Or dream about it...

Video

Okay...this is a simple LDR and Servo interaction. Geta laser pen and "shoot" at the target. LDR activates a servo motor to drop your target down. 3 seconds later it goes up again for another shot.

The main issue is to set the correct threshold of the LDR sensor and avoid unwanted movements due to light conditions.

Code

Cockroach Laser KillerArduino
/*
Project - Interaction LDR x Servo
 */
#include <Servo.h>

Servo servo1;  // Servo object

int pinServo = 2;    // variable to store the servo position
int triggerPoint = 970; //trigger point to start servo
byte sensor = A0; 
int sensorValue;

void setup() {
  pinMode(pinServo, OUTPUT);
  servo1.attach(pinServo);  // attaches the servo pin  
  servo1.write(155);// tell servo to go to "up" position
  delay(200);
  pinMode(sensor, INPUT);
}

void loop() {
  sensorValue = analogRead(sensor);
    if (sensorValue > triggerPoint){
    servo1.write(75); // tell servo to go to "down" position
    delay(3000);
    servo1.write(155);
    delay(200);
    }
}//End loop

Schematics

Project Schematics
Bkscheme njfny7eg38

Comments

Similar projects you might like

U I O - The Ultrasonic Interactive Owl

Project showcase by NerdFatherRJ

  • 1,729 views
  • 4 comments
  • 17 respects

Laser guidance using Joystick

Project showcase by Shubhham Santosh

  • 1,412 views
  • 0 comments
  • 8 respects

RCar | Robots for All!

Project tutorial by Luís Rita

  • 8,047 views
  • 1 comment
  • 40 respects

Laser Measurements Controlled by Arduino Nano

Project in progress by Ingo Lohs

  • 5,044 views
  • 2 comments
  • 5 respects

Magnet Levitation with Arduino

Project tutorial by jsirgado

  • 71,667 views
  • 117 comments
  • 222 respects

Arduino Laser Tripwire

Project tutorial by Ian Cumming

  • 23,957 views
  • 13 comments
  • 56 respects
Add projectSign up / Login