This instructable was created in fulfillment of the project requirement of the Makecourse at the University of South Florida (www.makecourse.com)
Why create a Bluetooth And Touchless enabled toilet flusher?
1) Your relationship with your phone is something special.
2) You're a Germaphobe.
3) Pushing a handle down requires far too much effort and time.
4) Cause why not?
5) Some other _ _ _ _. (Insert synonym for poop here)
Step 1: Download the 3D Parts!
To build a completed B.A.T. Flusher, you will need to download and print these part files.
Here's a comprehensive list of what you need and how many of each file to print:
1 x Box
1 x Lid
1 x Lever 1 of 3
1 x Lever 2 of 3
1 x Lever 3 of 3
1 x Arm
1 x HandleSleeve
1 x ServoGear
1 x Screw Cap
2 x Pin
Step 2: Things You Will Need to Purchase
1 x Arduino UNO Board Buy Here
1 x Adafruit Bluefruit LE Shield Buy Here
1 x Tower Pro Micro Servo SG90 (w/Servo Horns) Buy Here
1 x Distance Sensor Buy Here
1 x On/Off Switch Buy Here
2 x AA Battery Holder Buy Here
4 x AA Batteries Buy Here
4 x Male to Female Jumper Wires Buy Here
6 x Male to Male Jumper Wires Buy Here
8 x M3 Screws Buy Here
1 x Roll of Double Sided Tape Buy Here
1 x Adafruit NeoPixel Ring (12 LED's) Buy Here
Step 3: Assembling the Circuit
The circuit that you must construct will need to appear exactly as the one below in order for the code that is listed in the following steps will work without any alterations. The only 2 differences between this diagram and the one in the B.A.T. Flusher Prototype are that there is a Bluefruit LE Shield atop the arduino and instead of using a breadboard, I soldered everything directly to the Bluefruit LE Shield.
Not seen in this diagram is the Bluefruit LE Shield. The Bluefruit LE Shield and the distance sensor both await input that falls within their parameters. Once met, the arduino sends a signal to the LED ring to indicate it has been activated and the servo motor will turn it's set distance.
Something to note about this circuit is that instead of powering the components via the USB or power cable, I am running 6v worth of AA batteries to the VIN port on the arduino. The VIN port runs through the voltage regulator on the arduino to step it down to 5v for it to become safe for the arduino to use with all of the components that are used.
Step 4: Assembling the Servo Gear
First, cut one of the servo horns that came with your servo at the lines shown in the first picture, you should then end up with something close to what is on the right.
Next, place the servo horn on the shallow side of the servo gear so that it fits between the notches.
Finally, place the screw through the middle with the head of the screw on the deep end of the servo gear.
Step 5: Assembling the Battery Holder
First, take 2 AA battery holders and use tape to connect them back to back.
Next, take a red and black lead wire and connect them. (This can be done by twisting them together and then covering the exposed wire with tape.
Install 4 AA Batteries.
Step 6: Assembly of the Electronic's Housing
1) Push the LED ring between the latches on the bottom of the box to hold it in place.
2) Place the assembled battery holder into it's cavity.
3) Solder the ground wire to the On/Off switch.
4) Place your assembled servo gear on the cylinder so that the head of the screw faces the front of the box.
5) Mount the Servo into the rectangle on the other side of the servo gear so that the servo and the servo horn fit together.
6) Use the small hole on the front of the box to screw the servo gear to the servo.
7) Place the shaft of the lever into the big hole on the front of the box so that the open end of the shaft face the front of the box. Push the shaft towards the back of the box until it cannot go any further.
8) Place the gear part of the lever between the large hole and the shaft so that the short end faces the front of the box.
9) Now push the base of the lever through the large hole in the front of the box so that it attaches to the other pieces of the lever.
10) Now place a screw through the top hole on the servo to fix it in place.
11) Place the screw cap over the small hole in the front of the box to give it a cleaner look.
12) Place double sided tape between the 2 hole on the lid.
13) Now slide the cylinders of the distance sensor through those holes so that the double sided tape adheres to the distance sensor.
14) Now use 4 screws to mount the Arduino. (Note: make sure you have sent the program to the arduino before performing this step, as you will be unable to reprogram it once it is mounted.)
15) Once the Arduino is mounted, place the Bluefruit LE Shield on top and make the connections discussed in the previous circuit assembly step.
Step 7: Assembling the Flusher Arm
To assemble to flusher arm, place the pivot hole from the handle cover and the arm so that they are aligned. Once aligned, place a pin from the side that will face the toilet. Once the arm and handle cover are attached, do the same for connecting the arm to the lever.
Step 8: The Arduino Code
1) Download the following files and extract SonicBlueLED.zip.
2) Install the remaining 3 ZIP files as Libraries within the Arduino IDE. To do so, click on Sketch, Include Library, and then click Add .ZIP Library...
3) Open the SonicBlueLED.ino file in the Arduino IDE. (If you have not done so already, download it from here.)
4) Connect your Arduino to the computer.
5) I the Arduino IDE, click on Tools and select Arduino/Genuino Uno for your board type and select your arduino from the Port selection.
6) Now click in the upper left corner of the Arduino IDE, click on the arrow pointing to the right to upload your code to the Arduino. The code will begin automatically once it has completed uploading.
Step 9: Understanding the Arduino Code
SonicBlueLED.ino - Contains the user facing functions. Allows for easy tweaking to work best with your toilet and its surroundings.
BluefruitConfig.h - Configures pins to be used with the Bluefruit LE shield.
packetParser.cpp - Functions that interpret incoming data from the Android Application.
Step 10: Setting Up Your Android Device
I have forked a version of Adafruit's Bluefruit App for Android from GitHub to work specifically with the B.A.T. Flusher.
To install the B.A.T. Flusher App on your Android device, please do the following:
1) Go to your Android device's System Settings.
2) Click on Security.
3) Enable Unknown Sources.
4) Now download the APK file from this webpage on your Android device and open the download once it has completed and click Install.
5) Once the app has installed, open it and click Connect next to Adafruit Bluefruit LE.
6) Now touch the feces emoji to activate the flushing mechanism.
NOTE: This app is not supported on Android 4.3 and below and does NOT yet work on ANY Android N Developer Preview Build.
Runner Up in the
Home Hacks Challenge