Introduction: Off-task Machine

People often get caught of being off-task at home by parents or school by the teachers because you do not react fast enough to close the window or app you are using and be punished for being off-task, but with this machine, there will be no more this kind of issue. This off-task machine uses an Ultrasonic sensor to detect there is a person close to you within 30 centimeters, and if it detects that there is a person there, it will automatically press Alt+Space+C to close the window or the app you are using.

Supplies

Arduino Leonardo

Ultrasonic Sensor

5 Wire (1 Dupont wire with male to male and 4 Dupont wire with male to female)

Step 1: Build Up Your Off-task Machine

First, you connect the D4 to GND with the male to male Dupont wire so that your Arduino can control your computer's keyboard and mouse.

Second, you connect the Ultrasonic sensor with the 4 male to female Dupont wire to your Arduino board. You connect Vcc to 5V, Trig to D8, Echo to D7, and GND to GND.

Then, you get your model of Off-task Machine, what you should do next is to import the code.

Step 2: Import the Code

Step 3: Video