Problem-Solving Toilet Paper Holder

by InstructablesUofT in Circuits > Arduino

2307 Views, 9 Favorites, 0 Comments

Problem-Solving Toilet Paper Holder

Problem Solving Toilet Paper Holder
photo1678888363 (1).jpeg

We know how annoying it can be to find out in the most exciting moments that things are not working the way we want. So, probably everyone has once experience a situation when he or she is reaching for toilet paper but instead of a getting a feeling of release gets very annoyed. Because who could come up with an idea to hang toilet paper in this direction!? Or, otherwise, some of us can be confused by “a great debate” taking a new roll of toilet paper: should I hang it over or under? what kind of person am I? does this decision define me somehow?

Forget these worries! Our team created a device that solves this debate. Under our toilet paper holder you’ll find a box that contains a motor and an ultrasonic sensor. Whenever your hand gets closer to the sensor, it turns on the motor which rotates the holder. Thus the position of toilet paper can be changed. So now, to get rid of the useless toilet paper discussion, just follow the steps below!

Supplies

1)Electronics

  • Ultrasonic sensor: 45 mm x 20 mm x 15 mm
  •  3-6 V DC Gear Motor
  •  9V battery with Snap-on Connector Clip
  •  Arduino Uno Board
  •  USB Cable Type B to Type A Male for Arduino Uno
  •  10 x Breadboard Jumper Wires
  •  4 x Female-to-Male Dupont Wires
  •  LED (optional)
  •  Resistor 220Ω (optional)

 

2) Materials

  •  ABS-M30™ plastic for 3d-printers
  • 3,2mm (1/8”) Plywood Sheet (Laser Bed Size 18" x 32")
  •  Wood glue
  •  Glue suitable for ABS-M30
  •  Spray paint (optional=

 

3) Equipment

  •  Computer
  •  3d-printer (FDM)
  •  Laser cutter

 

Code

Assignment 3 .png

Arduino Code Logic:


This code sets up an ultrasonic distance sensor using an Arduino board. The ultrasonic sensor has a transmitter and receiver. The transmitter sends an ultrasonic pulse which travels through the air until it hits something. The pulse then reflects to the receiver and calculates the time it took for the pulse to travel. By using the time taken and the speed of sound, the distance between the sensor and the object can be calculated.

The code begins by declaring variables. The trigPin and echoPin represent the digital pins used to send and receive the signals. The ledPin and motorPin represent the digital pins used to control an LED and a DC motor. The distanceThreshold and motorDuration represent the maximum distance in centimeters and the duration for which the motor should be turned on.

In the setup() function, the serial communication is initialized, and the pinMode is set for each of the pins used. The loop() function is where the main logic is. It begins with triggering the ultrasonic sensor by sending a low-high-low pulse to the trigPin. After a short delay, the echoPin is read, and the duration of the sound wave is calculated using the pulseIn() function. The duration is converted into distance in centimeters using the formula distance = duration / 58.

The code then checks whether the calculated distance is less than or equal to the threshold distance set by the distanceThreshold variable. If the distance is within the threshold, the LED is turned on using the digitalWrite() function, and the DC motor is turned on for the duration specified by the motorDuration variable using the delay() function. Once the motor has run for the duration, it is turned off using digitalWrite(), and the LED is turned off as well.

In summary, this arduino code uses an ultrasonic sensor to detect an object within a certain distance. If an object is detected, it turns on an LED and a DC motor for a specified duration.

*If you want, you can forgo an LED. It’s just an extra option that shows visually whether the circuit is working correctly. 


TinkerCAD link https://www.tinkercad.com/things/0vgcJNtvIC2-glorious-albar/editel?sharecode=hzo8jaSXWFoLb8Sv2zKB6uYO7OQuyfpgVKstP_Fxy6g

Box for Electronic Components

Rhino model.jpg
photo1678888103 (2).jpeg

2.1. Laser Cut

To help you orientate we attached a picture of 3d-model of our device. 

To begin with, fabricate a box that will contain a motor and electronics. We suggest to create it using a laser cutter on 3,2 mm Baltic Birch Plywood, a pdf-file for that you can find in the attachments. Laser Bed Size is 18" x 32".

Set the laser cutter to a power of 50% and speed 5% to achieve a clean result.


2.2. Assemble the Box

When all the parts are cut, put all of them except for the lid together using wood glue or superglue. The lid will be attached after the electronics is put in.

To achieve the best optic, we suggest you spray paint the box (including the lid) in a color similar to your material for 3d-printing. We used black.

Toilet Paper Holder

photo1678888103 (3).jpeg

3.1. Printing

These parts we suggest fabricating with a 3d-printer (FDM). Put the stl-files below in a program you use for 3d-printing (f. ex. GrabCAD). Set the filling grade to 30-50%.

Please, pay attention that the dimensions are in cm.


3.2. Drill Press

In case your 3D-printing didn’t turn out properly and the hole in the dowel isn’t suitable for the motor, you can use the drill press machine. Because the motor must be attached at exactly 90 degrees’ angle, we suggest doing the hole with a machine and not manually. The diameter you need is 7/32 inches  (0,55 cm).

 

3.3. Glue the dowel to the holder

Once you’re sure the motor can be attached to the dowel, put the latter in the hole in the toilet paper holder and, if necessary, glue it.

If you notice that because of the 3D-printer tolerances the dowel is too wide, you can simply handle it with sandpaper to reduce the diameter.

Electronic Components and Wiring

photo1678888103 (4).jpeg

Looking at the fritzing diagram from the step1, start to assemble the circuit on your physical breadboard. Use the following pins on Arduino Uno:

pin 13 for LED;

pin 4 for the motor;

pin 3 for ultrasonic echo;

pin 2 for ultrasonic echo.

Once you’re ready, connect the Arduino Uno to the computer and upload the code. After the code is uploaded, the USB-connection is no more required, the power will be supplied by the 9V battery connected to the Arduino Board.

Put All the Parts Together

photo1678888103 (1).jpeg
photo1678888103.jpeg

Whenever you have all the parts in front of you, gather them together.

Start by attaching the holder with the dowel in it to the lid of your wood box. Place the holder in the middle of the round opening in the lid and glue it.

After that put the motor and your electronics in the box. The openings for the ultrasonic sensor are on the side of the wood box, just put it in. The motor should be placed on the bottom of the lid, right under the holder. Pay attention that you attach the motor to the holder at exactly 90 degrees! Otherwise the device may not work properly as the rotation may be disturbed. You can fix the position of the motor using tape. Finally put the lid with all the attachments on the top of the box. We don’t recommend to superglue it, so that the electronics can be easily accessed and replaced.

Once you’ve done the steps above, put a roll of toilet paper at the top of the whole composition and enjoy your smart user experience! 

Results and Reflection

Problem-SolvingToilet Paper Holder Circuit
photo1678891891.jpeg
photo1678891965.jpeg

First of all, we were happy that our code functioned as we expected it to. After we had our physical device done, we had to adjust the time during which the motor keeps on working once activated, so that the toilet paper holder is rotated 180 degrees. Otherwise there was no long battle at this phase.

Instead, most of the challenges were related to the prototyping of the physical object.

For each member of our group it was the first time working with the 3d-printing, so a lot of mistakes we made at this step could have been expected. Firstly, we hadn’t though properly about 3d-printing tolerances before we got the parts done and found out that they can’t be put one into the other. In terms of that we learned that objects printed in plastic can be sanded and put under drill press. (Dear reader, don’t worry, for you we uploaded updated files, so you should not experience the same problem.)

Secondly, the 3d-printed objects turned out to be really heavy. This is the reason we had to redesign the functional principal of our device. Initially we wanted to use a system of two gears, where one would be attached to the motor and the other one to the toilet paper holder. Whenever the motor would be turned on, it would set the smaller gear in motion and the latter would than rotate the bigger gear together with the holder. Sounds good, yet demands a motor that is much stronger or a gear that is much lighter! When we began to test the system, we were at first happy to see how quickly and smoothly the motor rotates the smaller gear. However, once we tried to connect it to the bigger gear, there was no reason for a smile left. The gear we planned for the toilet paper holder was about 20 cm in diameter and, printed in plastic, was too heavy to be moved by the motor we had. Without pronouncing any bad words aloud, we decided to forgo the gears and instead connect the motor directly to the holder. Although this connection allows our device to work and fulfill its purpose, it is not stable enough. For this reason, the holder doesn’t always rotate exactly 180 degrees.

And yet, despite all the challenges, we can still offer users an exciting experience that solves “a great debate”!

P.s. If you can also be interested in having a 20 cm black plastic gear to use it, for example, as a photo frame for your engineer friend, please don’t hesitate to contact us! You’ll be charged only shipping costs!




References and Credits

This project was created as part of the course ARC385 Physical Computing at the Daniels Faculty of Architecture, Landscape and Design at the University of Toronto, Canada.

‏‏‎ ‎

Team Members

  • Brian Lee
  • JunHyun Jung
  • Mariia Kulabukhova