Introduction: Automatic Touch-free Toilet Paper Dispenser.

About: Raspberry Pi & Arduino explorer

Hello everybody.

In this instructable we will built an automatic touch-free toilet paper dispenser that you see at coffee shops or hospitals. Our built:

  1. Is cheaper than the ready-to-buy dispensers
  2. That means can be used at home.
  3. Is based in materials that you can buy from the internet
  4. Has an open source brain, an arduino

Lets start building our dispenser.

Step 1: Hardware We Need

Our built is based at the Actobotics robotic parts . We will need:

  1. An arduino. ( I used my Arduino Yun )
  2. A couple of jumper cables male-to-male and 4 wires to connect the ultrasonic sensor.
  3. A breadboard
  4. A continuous standard servo motor ( I used my HS-625MG servo motor )
  5. A star screwdriver and a hex key
  6. An Ultrasonic Sensor HC-SR04 with a Mounting bracket
  7. 3 x different sizes Actobotics channel a 15", 9" and a 6"
  8. 2 x 90 degrees Quad hub mount C
  9. A 90 degrees Quad hub mount D
  10. A standard servo plate B
  11. 4 x Pan head machine screws, 4 x Flat head machine screws, 10 x socket head machine screws. Screws
  12. Glue or a zip tie

Ok we have all our parts, lets start building the dispenser.

Step 2: Ultrasonic Sensor

Lets start with the Ultrasonic sensor.

Find 2 little screws from your supplies and attach the sensor to the mounting bracket. You will not need more than 2 screws,tight them well and then take the zip tie and place it to the 2 holes at the base of the bracket. If the holes are small take a small screwdriver and opened them a bit.

Thats it. Lets continue with the main body of our structure.

Step 3: Build the Dispenser Main Body

This is the fun part.We will need:

  1. The 3 channels: 15", 9" and 6" (in the photo i forgot the 6")
  2. The 90 degrees quad hub mount C & D
  3. The hex key
  4. 8 x socket head machine screws

The main body of our dispenser is very very simple. Take the quad hub mount D and insert it to the 9" channel. Then take the 15" channel and with 2 screws connect the 2 channels. Now you have a "90 degree" structure.

Next we have to attach the quad hub mount C with 4 screws to the open side of the 15" channel. Attach the 6" channel to the quad hub mount with 2 screws.

And that's it. We have built the base and the main body. Next step we must attach the servo to the dispenser.

Step 4: Attach the Servo Motor

In this step we will need:

  1. The servo & a wheel horn from the servo accessories
  2. The standard servo plate B
  3. 4 x Pan head machine screws, 4 x Flat head machine screws & a screwdriver
  4. The dispenser main body

Place the servo plate B to the servo and keep it tight with the 4 pan head screws. Place then the wheel horn to the servo with the servo screw and last connect upside down the servo to the top of the 15" channel of the dispenser main body. The reason that the servo is connected upside down is because of the wires. They are better that way and they don't bend.

Our structure is almost finished. Next we will attach the sensor.

Step 5: Sensor - Final Adjusments

Now we are ready to add the sensor to the dispenser.We will need:

  1. The dispenser main body
  2. A quad hub mount C
  3. 2 x socket had machine screws and a hex key.

Place the quad hub mount C to the back of the 15" channel with the 2 screws and then place the sensor to the mount and tight it with the zip tie

We have now finished with the dispenser. We must now add some wires from the sensor to the Arduino.

Step 6: Connect the Sensor to Arduino - Expand Your Cables.

In this step we wil need:

  1. The arduino (Yun in my case)
  2. The jumper wires male-to-male
  3. Some old pc wires
  4. The breadboard

First we must add some old wires in order to connect the sensor with the arduino. I used some old pc wires, if you have jumper wires male-to-female will do the job. Connect the wires to the back of the sensor and drive them to breadboard. The HC-SR04 has 4 wires :

  1. Gnd for ground
  2. Echo
  3. Trig for trigger
  4. Vcc for 5V

In my case i used:

  1. A red cable for Vcc
  2. A black cable for Gnd
  3. A white cable for Echo
  4. A green cable for Trig

It is a good idea to have different colours so you can identify each cable. Drive your cables to a different hole to the breadboard. Then with jumper wires male-to-male you can connect them to the Yun. Again from the breadboard to the Yun i used:

  1. A red jumper wire for Vcc. to pin 5V to arduino
  2. A black jumper wire for Gnd to pin Gnd to arduino
  3. A yellow jumper wire for Echo to pin 12 to arduino
  4. A yellow jumper wire for Trig to pin 13 to arduino.

Expand your servo cables with 3 jumper wires male to male and drive them also to the breadboard. In my case:

  1. Red to 5V
  2. Black to Gnd
  3. Yellow to arduino pin 6

We are now ready to test our code.

Step 7: Arduino Code - Test It

The arduino code is controlling the servo to move every time the sensor senses an object closer than 5 cm.That means that as long as we keep our hands closer than 5cm to the sensor the paper will unfold.

I found the code from here Tree house projects and i made the adjustments, because i use a servo and not leds.

Upload the code from the arduino IDE to your arduino and you are ready to test it.

Step 8: Use a Battery Tray to Make It Portable - Video Demostration

It is a good idea to use a cheap 4 cell battery tray to make the dispenser portable. Just take 2 jumper wires male-to-male and connect:

  1. The black to Gnd pin of arduino
  2. The red to VIn pin of arduino

Once you upload your code from the pc to the arduino, disconnected it, connect the battery tray and if your batteries are fully charged the dispenser will work fine.You must add the toilet paper to the wheel horn with some glue.

This instructable is suitable for older people like my grandmother. It is very easy to learn how to operate it. Also you can take the dispenser to the camping during your holidays or you can teach early robotics to young people


Make it Move Contest 2016

Participated in the
Make it Move Contest 2016

Robotics Contest 2016

Participated in the
Robotics Contest 2016