top of page

How Make Mouse Trap at your home


Arduino Programming:

#include <Servo.h>

int ir_sensor = A0;

Servo myservo;

int pos = 0;

void setup() {





void loop() {

  int sensor_value = analogRead(ir_sensor); //read the sensor value

  int distance_cm = pow(3027.4/sensor_value, 1.2134); //convert readings to distance(cm)

  if (distance_cm < 10) {










Demo Video:

146 views0 comments

Recent Posts

See All


bottom of page