Arduino controlled Toilet using wiper motors and wave shield, range finder. Eyes made out of ping pong balls with green LEDs
Update after the Fair. The Fair was 9 days at least 10 hours a day. The Captain Underpants toilet ran for the entire fair. Some parts worked a lot better than other parts. The toilet bowl lid worked fantastic, it was rock solid. The Eyes worked very well, had a problem with the hot glue I mounted them with. The toilet was outside and it got very hot, the hot glue did not hold the entire time. I had to reattach the eyes at least twice. Their where two main problems, the worst was the tank lid mechanism, it basically did not work. After the first day I turned off the Tank Lid and had it in the open position so you could see the eyes.
I also had problems with the speakers. The speakers ran off 4 AAA batteries and they would only last for use under 2 hours. Around the third day I converted the speakers to run off the 5v system. It was very hard to work on anything at the fair, the heat and trying to solder anything. While this solution worked it still had issues, lot of distortion ( was meant to run off 6v not 5v) and the regulator would over heat.
I have totally redesigned the tank lid mechanism to use a CAM. I will upload all the stl files, I 3D printed all the parts. There where several versions as I tweaked the design. I'm including a video where you can see the design and how smooth the movement is now. I'm very happy with this design it will be reliable.
I'm going to upgrade the Eyes to RGB Leds. Also I'm going to drive the sound arduino off a new switch that I added instead of controlling it from the master arduino. The motors produce a lot of noise, and I have intermittent problems with the sound not being kicked off.
I'm going to put it out for halloween with all the updates and enhancements. I will upload video from that. Looking forward to being able to have the Eyes change from Green to Red then Purple.
The toilet will be on display for 8 days, outside under a tent. I'm not satisfied with the lift mechanism for the Tank lid. It is not reliable, very touchy. I'm going to change that to a CAM, machine it out of aluminum. That will limit the lift arm to a straight up and down motion. I will have to pull everything out and reposition the wiper motor. The bowl lid mechanism is rock solid.
I hot glued the 12v to 5v and my Ground and 5v rail board to the bottom motor mount board. I screwed in the motor controllers to some spare wood I glued to the bottom. There are only 6 wires that need to be dealt with if I need to remove the motor mount board. Two wires go to the motor, these just unscrew from the motor controller, the other 4 wires are from the microswitches. I used #18 gauge wire connectors, these are easy to put on and take off. The biggest problem with removing the motors is I have the on/off switch hot glued to the toilet. It comes of with careful use of a flathead screw driver. I used stranded wire for the 12v wiring harness, this is flexible and easy to deal with.
I have major problems with not being able to trigger the Arduino Wave Shield from the master Arduino. In the end the problem was noise coming from the motors, the solution was to have a dedicated ground between the two arduino's and 5v.
Here are two video's of the Toilet in actions. The first is the full routine (multiple openings of the Lid), the second video the Lid only opens once and stays open for the entire routine then closes. This is going to sit under a tent during the Fair and that runs for 8 days. I will be close by most of the time. I've run it through two 3 hour test cycles, running every 4 min. There where not any problems but there where a couple of close calls, the lid arm bracket can catch on the Lid, this has the possibility of moving it so that it does not close and then could knock it off.
This project used Adafruit wave shield, Sonic range sensor, two motor controllers (IBT-2 and IMS-2 more on this later), LEDs, two micro switches. My plan was to test each of these separately, I've worked with all of them in the past (except the IMS-2 motor controller), but wanted to refresh my memory.
The plan was to have a master Arduino then have it control the Arduino with the Wave shield. Their are limited pin's available with the Wave Shield.
I build a Wave Shied in the past and planned on using it. I couldn't get the Wave shield working again. I suspect the problem was acidic solder flux, next time I will clean the flux off after finishing a project. I ordered a new one and with the speaker.
Then I purchased the Captain Underpants theme song to the movie, I also found the audio of a toilet flushing. I converted these so they would run on the Arduino. I also soldered wires for the speaker to the shield. When I tested this arrangement I was not happy with the speaker it was not very loud. I had a cheap portable speaker that I tested and the sound was much better, louder.
I then wanted to test being able to trigger the Wave Shield from the master Arduino. My plan was to simple set a Pin high. First I connected a micro switch to the wave shield arduino to use that to trigger it. I connected the switch to pin 12. Immediately had problems when the wave shield started up. After posting a question on the Adafruit forum, I got a quick answer. Pin 12 is a reserved pin used to read the memory card. I then read the spec sheet (like I should have from the start), I then used 8 to trigger. This test worked after this change. Then I went to trigger it from the master arduino. I spent an Saturday afternoon trying to get this to work unsuccessfully. I took a break came back and looked at it Sunday and released that I had not setup up a common ground between the two arduino's. Once I setup common ground the test worked.
Testing the IBT-2 motor controller was very easy and worked first time. The IMS-2 (I have the C version) was a different story. I could find very little documentation on this, everything I found was for the IMS-1. I followed the documentation for the IMS-1 setup, the test didn't work. It was right after this I released the Arduino was bricked. What I discovered is that the IMS-2 gets power from the high side automatically, when you put power to the high side you will see a LED light up on the motor controller. The IMS-1 (and IBT-2) both get power from the low side. The solution was simple do NOT connect the power to the VIN pin on the IMS-2 from the arduino. From now on I'm going to use the IBT-2 motor controller, it is very well documented.
Lastly I need to work out the details of my power. I planned on run two 12v motor cycle batteries connected in Parallel. I also needed 5v power. I used a LM-7805-CT Linear Regulator and two micro capacitors on either side. This worked about extremely well, so well that I built a second one to use for another project.
I am going to break up the project into three parts. Physical build, Arduino work bench sensors, and lastly integration of all the systems. For the Physical build I first needed to find a toilet to work with. I went to eBay, I found several around the $60 - 80 range but they where at least an hour away (probably longer). I looked on eBay for three days. Then I saw what I was looking for, one that was only about 15min away, and only cost $20. I brought that home and did a very good cleaning of it, I took the tank off the back and cleaned that area. Next I needed to work out how to attach the wiper motors. One of my design rules was I did not want to drill the toilet. I did this once on an earlier project and it is not easy drilling into porcelain.
I had recently purchased a bench grinder. This came in very handy with this project. To mount the motors I purchased some 90 degree three whole brackets. I then had to drill holes to align correctly with the motor. This was a slow process, I cut off the excess bracket and used the grinder to round the edges. I used a oscillating belt sander to form the plywood mount for the bowl. This takes some time I wanted it too fit well all around so it wound not move. The mount for the bowl can easily be removed if needed. I later painted the bowl wiper motor and mount white to blend in better. I made one mistake I cut the bolt that holds the motor mount too short. I can get the nut started but it a delicate process, if it was an inch longer it would be easier to work with.
Attaching the wiper motor to the bowl lid was not that hard. I cut a piece of 1" flat bar about 9" long ( this is too long on purpose). I then drilled a 1/2 hole into one end. I went to auto zone and purchased
I had to use an x-acto knife to cut off excess from the bushing, this held the flat steel bracket on very securely. I then cut 10" of Punched Angle zinc plate. This was perfect is had holes every inch. I spent about an hour walking up and down home depot trying to find items that I could use for my project that they where not intended for :D I attached the Angle bracket to the back side of the bowl lid with short screws making sure they did not go through to the other side. Then I noticed that the alignment was not correct the wiper motor was correct. I should have mounted the angle bracket differently than I did. I was able to put a Z bend in the bracket, I was very happy that I had a vise. I had to use hammer and care that the bend was where I needed it. Once this was done, I could test out how long the flat bar needed to be, I would hold the bowl lid up to the highest point. I then would take small cuts off the flat bar and then test fit again. Important to make sure the bowl wiper motor arm is up at the highest point while doing this. I then used the grinder to round and smooth all the edges. After drilling a 1/2" hole into the other end of the flat bar, I was able to attach the bowl wiper arm.
I also mounted a micro switch in the bowl seat, only the lid would move up and down. I needed the switch to let me know when the bowl lid was closed. This meant that I would have four wires that needed to be routed to the tank. I tried to route them trough the toilet, the passages are very small. In the end I went for 1 1/2 white heat shrink that I got from MicroCenter. I cut a notch in the back of the toilet seat for the microswitch. It took a bit of trail and error to get the switch into the correct position. Then I realized I can take the toilet seat off the toilet and get to the bottom of it, this made getting the correct location for the microswitch easy. Here is the...Read more »