ECE412 Final – Automatic Toilet Paper Dispenser

Big Picture

In this project we used windows and Arduino and we started out with high hopes and big plans. We began brainstorming ideas for the project and originally planned to use a load sensor or another proximity sensor of some sort to be able to weigh, or ultimately tell when you were out of toilet paper. We decided that a load cell was too hard to incorporate mechanically and even if it was it wouldn’t be accurate enough to sense a few sheets of toilet paper. After we trashed that idea, we decided we would still have a sensor for when it was empty but we would use a interrupt sensor and a series of pullies tied in with the motor to show that the motor was turning but no more toilet paper was coming out. Well this plan also failed due to lack of time and mechanical availability. So we decided to try to perfect the simple action of automated toilet paper dispensing. 

Sample Demo


The hardware of this project was mostly recycled from other projects. The Styrofoam casing and motors came from a previous project that was about RC cars using DC motors. Our hardware was fed through the existing and new holes and the board and wiring was all implemented on the opposite side to what the user would see. The motor was wired through a transistor and diode to protect the DC motor in case of feedback. We originally had a 5V power source but the output was too low for the motor to turn with the toilet paper attached. The PWM ports on the Arduino were used to change the power used for the DC motor. The photo infrared sensor acts as a trigger to activate the toilet paper dispenser for 3 seconds.


The code for this project is a mixture of checking for interrupts in the PIR and if there are changes then the toilet paper dispensing is triggered and then resets after it is done. It is very similar code for paper towel dispensers that you would see in almost all public bathrooms. Our PIR was very sensitive so often the it would trigger multiple times in a row, but otherwise the code worked perfectly. There were plans to add a buzzer to the rig as shown in the code, but it never made it to the final product. Everything was coded in Arduino.

Timer and Stopwatch with LED’s – Schematic

The schematic used in this project was based off of the same general schematic used for the previous two labs. Some extraneous portions of these previous schematics were removed, but the basic circuit connecting the board to the LCD with a potentiometer for dimming was left untouched. The notable addition made by our group was the common cathode RGB LED connected to PC0, PC1, and PC2, along with three current limiting resistors connecting the three leads to the board. This LED, though admittedly not used to its full potential, was used to indicate pauses in the operations of functions as well as the completion of the timer function.

Carnival Arm Schematics Group 6

The concept of this project is a carnival arm that can set off a buzzer if a user can drop a ball into a cup. The project uses two Atmega328PB boards. One board has a servo motor that that works by connecting it to ground, 5v, and to PB1. The second board is connected to a passive buzzer at 5v, ground, and PD1 as well as a shock sensor at 5v, ground and PB2.

LED Candle Light Show – Schematic

We planned to use the I2C interface to serve as a means of communication for each candle. Two data lines are used: a clock line and and data line. These two line are shared with every device including the master and slave boards. The master board can request to write or read data to each slave board. The signal consists of multiple sets of two bytes of date. The first seven bits in the first byte is the address of the slave board that is being addressed. The last bit is signaling whether it is requesting for the following data to be written or read. The second byte is the data the master is trying send. If the slave successfully received the data bit then it will send an acknowledgment bit to the master board.

We ran in to difficulties trying to simultaneously interface with P and PB variant boards because they require different address name schemes.

Bike Odometer and Speedometer – Schematic

For the Hardware portion of the prototype, we used a variety of objects.The largest of these was a standard bicycle that we used as a base for the odometer and the speedometer to sit upon. Next we used two breadboards to start, however this was later slimed to one breadboard to hold the wiring and transistors for the project. We also used an ATMEGA328P Xplained mini board to process the inputs and outputs we needed for the project. Miscellaneous electrical components include some resistors, wires, potentiometer, an LED display and a capacitor. The most unique component used would be the Hall effect sensor, which is in layman’s term a magnet sensor. As a magnetic field gets in range of the sensor, the total output voltage of the Hall effect will be changed due to the strength of said field.




Optical Theremin – SCHEMATIC

As for the technical components, the hardware was very similar to previous lab work in which we modified to obtain our project. For instance, the corresponding lab (#4) had the output be delivered to an LCD, which ours was adjusted to go to an external speakers. In addition, the major component was a “Guwoops” light sensor which helped to make the conversion.

Catapult – Schematics


As you can see in the image above, the red arrow is pointing to our motor, which is being used to pull back the catapult’s arm. The yellow arrow is pointing to our Atmega328PB which is sending out our signals to the solenoid and the Big Easy Driver. The blue arrow is pointing to the Big Easy Driver which is controlling the motor. The green arrow is pointing to the solenoid which is acting as the release mechanism. Below is the schematic to make it all work.

Smart House – Schematic

This project utilized two different microcontrollers, an ATmega328pb and an Arduino Uno R3. Combining these two was a major component of this project. To connect them we utilized a digital output from the Arduino and connected that to a digital input on the ATmega328pb, essentially using the ATmega328pb as an output peripheral for the Arduino. The ATmega328pb still had the LCD connected as it had been in previous labs, thus no changes were made to how it was connected. The Arduino had multiple outputs along with the ATmega328pb, those being the lights for the house and the actuator for the door lock. The Arduino circuit also utilizes a Bluetooth receiver which communicates with an android app to send commands to  the house. During testing it was found that one digital output could not power the “locked” LEDs, the actuator, and the signal to the ATmega328pb, this presented a problem because the project needed all of those things to happen when the door was locked. To  overcome this problem, a second output pin was utilized that copied the signals sent to the original output pin so that the required power was met to activate everything needed.