Project tutorial

Pranked! Moving Tissue Box | Circuito.io © GPL3+

When someone goes for a quick facial tissue, the box moves away unexpectedly!

  • 5,230 views
  • 1 comment
  • 21 respects

Components and supplies

Necessary tools and machines

Hy gluegun
Hot glue gun (generic)
Knife
For cutting the box

Apps and online services

About this project

*This is for the Circuito.io Prank Contest*

You can find this project on https://storage.circuito.io/index.html?solutionId=58d5647186a3e00012194c37

Circuito.io is a great platform for creating and sharing Arduino projects. It gives users easy to follow instructions and helps them to make the most out of their hardware. This is a simple guide to how to create a tissue box that moves whenever a person tries to grab a tissue from it.

Here is a simple video demonstrating the prank:

Part 1:

Go onto circuito.io and click the "Let's Go!" button. You'll be greeted by a very friendly interface where you just have to drag and drop in items you want. If you want to recreate this project, follow the rest of this guide.

This is what the beginning environment looks like. Feel free to explore and mess around in it. (Fig 1)

Next, find the items you want in the pane on the left. Drag the item onto the middle canvas to place it. I used a 9v battery, hc-sr04, and an l293d with two DC motors on it. (Fig 2)

Lastly, click "Generate" at the bottom to finish your new creation. You'll be taken to a new page that will look like this:

Now onto part two of this guide!

Part 2:

Now that you have successfully created a project in the canvas work space, it is time to wire it up and add some code in order to breathe life into your new design. To start, gather up the materials that were specified in the BoM, which is on the second page of the guide. (Fig 3)

Next, go onto the next section, which is where you will wire it up. Follow the step-by-step instructions to accurately connect each piece of hardware together. (Fig 4)

After you have finished wiring up your project, it is time to make it come alive with code! Download the "Firmware.zip" file and place it in your sketchbook location for your Arduino IDE. Open up the file called "firmware.ino" and upload it to your board. (Fig 5)

Now it's time to test your project. Open up the serial monitor and follow the instructions on it. If it works, you have just created a successful Circuito.io project! You can share the link by copying it and sending it to others. (Fig 6)

But wait! We're not done yet. We still have to make the actual prank! Here's how to make the tissue box move:

Step 1:

Grab a half empty tissue box (I used a full-sized Kleenex box for my prank bot) and cut along the bottom of it.

Step 2:

Then, add a piece of cardboard that is the same size as the length and width of the box, and glue or tape it inside, pushing the tissues up.

Step 3:

Next, get a mini breadboard and use it instead of the one pictured in the Circuito.io instructions (to save space).

Step 4:

Attach wheels to the motors such that the wheels barely come out of the box (you want it to be as discrete as possible so people won't notice).

Step 5:

Glue or tape the system in place inside of the tissue box and attach the battery- but don't plug it in yet!

Step 6:

Pull the HC-SR04 up the side of the box and point it upwards to detect when someone is reaching for a tissue.

Step 7:

Upload the code below to the Arduino Uno, and adjust the wiring according to the code, in order to make the wheels turn in the proper direction.

Here is a quick snippet of the code (Not the entire thing. Scroll to the bottom to get all of the code):

#define THRESH 4 //How many inches away their hand must be to activate it
const int FL = 2; //Pin numbers + corresponding directions
const int BL = 3; 
const int FR = 4; 
const int BR = 5; 
const int trig_pin = 6; //HC-SR04 pins
const int echo_pin = 7; 
bool dir_flag = false; //If going forwards or backwards (It alternates)
long duration = 0; 
void setup() { 
 // put your setup code here, to run once: 
pinMode(FL,OUTPUT); //Initialize pins
pinMode(BL,OUTPUT); 
pinMode(FR,OUTPUT); 
pinMode(BR,OUTPUT); 
pinMode(trig_pin,OUTPUT); 
pinMode(echo_pin,INPUT); 
digitalWrite(FL,LOW); 
digitalWrite(BL,LOW); 
digitalWrite(FR,LOW); 
digitalWrite(BR,LOW); 
forwards(250); //Give a "ready" signal
delay(3000); 
backwards(250); 
delay(3000); 
} 

Step 8:

Enjoy the April 1st fun! Put the robotic tissue box in an area where someone is going to grasp for a quick tissue, and record their reaction when they least expect it to move!

Code

Arduino CodeC/C++
Copy and paste it into the Arduino IDE and upload it.
#define THRESH 4 //How many inches away their hand must be to activate it
const int FL = 2; //Pin numbers + corresponding directions
const int BL = 3; 
const int FR = 4; 
const int BR = 5; 
const int trig_pin = 6; //HC-SR04 pins
const int echo_pin = 7; 
bool dir_flag = false; //If going forwards or backwards (It alternates)
long duration = 0; 
void setup() { 
 // put your setup code here, to run once: 
pinMode(FL,OUTPUT); //Initialize pins
pinMode(BL,OUTPUT); 
pinMode(FR,OUTPUT); 
pinMode(BR,OUTPUT); 
pinMode(trig_pin,OUTPUT); 
pinMode(echo_pin,INPUT); 
digitalWrite(FL,LOW); 
digitalWrite(BL,LOW); 
digitalWrite(FR,LOW); 
digitalWrite(BR,LOW); 
forwards(250); //Give a "ready" signal
delay(3000); 
backwards(250); 
delay(3000); 
} 
void loop() { 
 // put your main code here, to run repeatedly: 
long distance = Ping(); //Check distance
long lengths = microsecondstoinches(distance); //Convert from duration to inches
if(lengths < THRESH){ //Check if hand in range
 if(!dir_flag){ //If dir_flag is false, go forwards
   forwards(3000); 
   dir_flag = !dir_flag; //Set it to go backwards next
 } 
 else if(dir_flag){ //If dir_flag is true, go backwards
   backwards(3000); 
   dir_flag = !dir_flag; //Set it to go forwards next
 } 
 delay(2000); //Give it a 2 sec buffer time if triggered
 } 
 delay(10); //10 ms debounce
} 
void allOff(){ //Stop moving
 digitalWrite(FL,LOW); 
digitalWrite(BL,LOW); 
digitalWrite(FR,LOW); 
digitalWrite(BR,LOW); 
} 
void forwards(int duration){ //Go forwards
 digitalWrite(FL,HIGH); 
 digitalWrite(BL,LOW); 
 digitalWrite(FR,HIGH); 
 digitalWrite(BR,LOW); 
 delay(duration); 
 allOff(); 
} 
void backwards(int duration){ //Go backwards
 digitalWrite(FL,LOW); 
digitalWrite(BL,HIGH); 
digitalWrite(FR,LOW); 
digitalWrite(BR,HIGH); 
delay(duration); 
allOff(); 
} 
long Ping(){ //Send out a pulse and record the time it takes to come back
 digitalWrite(trig_pin,LOW); 
 delayMicroseconds(2); 
 digitalWrite(trig_pin,HIGH); 
 delayMicroseconds(5); 
 digitalWrite(trig_pin,LOW); 
 duration = pulseIn(echo_pin,HIGH); 
 return duration; 
} 
long microsecondstoinches(long microseconds){ //Convert duration to inches
 return microseconds / 74 / 2; 
} 

Schematics

Schematic
Just attach as-is. You could also use circuito.io's wiring walk-through as well.
Circuito io qsrenxurv7

Comments

Similar projects you might like

No Candy For YOU!

Project tutorial by Jonathan Tindal

  • 789 views
  • 5 comments
  • 6 respects

Arduino Darkness Activated Ghost

Project tutorial by Technovation

  • 1,974 views
  • 2 comments
  • 10 respects

The Troll Switch

Project tutorial by Aitor Gamarra

  • 1,002 views
  • 1 comment
  • 2 respects

Giftduino - The Perfect Arduino Gift Box

Project tutorial by circuito.io team

  • 13,086 views
  • 3 comments
  • 30 respects

Android controlled robot car

Project showcase by Isara Naranirattisai

  • 8,634 views
  • 2 comments
  • 13 respects
Add projectSign up / Login