Delayed Flush Week 1
This is an update of progress for week one, Hanna since you weren’t here this is a more detailed account than the summary I gave you in class.
Arduino:
Motor-
I’ve made great progress on the Arduino program. I’ve programmed the servo to rotate 180 degrees back and forth. I initially wanted the servo to turn more than 180 degrees because I was worried that the shaft couldn’t displace the lever enough to flush the toilet. I had two options, one is I could use a continuous servo, second is I could make whatever the string is going to wind up on have a larger radius, therefore, larger circumference, and since half of the circumference will be the displacement of the lever(servo programmed to turn 180), a larger circumference would solve the problem.
After spending a good amount of time trying to reprogram the Arduino for a continuous servo, I thought that perhaps I could physically manipulate the servo and take out the part that is preventing it from turning more than 180 degrees. I found the part and managed to cut it off but I suspect that the servo couldn’t recognize an angle more than 180 degrees, so that didn’t work. So, in the end, I decided that altering the physical size of the spool would be a simpler solution.
A separate problem is whether the servo has enough torque to pull up the plug. I measured the force required and that turned out to be less than 5 newtons. Torque is given by rxF so the radius of the spool also plays a role but since where the force is applied will always be perpendicular to radius it is simply rF. Since torque on these servos are measured in cm kg, 5 N—>.5kg and I estimated the radius to be 3 cm. required torque is 1.5 cm kg. A standard servo has around 5 cm kg of torque. So our servo is more than capable.
LED-
I spent a lot of time putting in the program for the bomb like flashing for the LED. I found that decreasing the delay time for both high and low of the LED simultaneously mimics the bomb like flashing the best. The only problem is that currently looks messy and long since I wrote out all the HIGH and LOW commands. I expect us to replace it with a more concise loop in the future, but as for now, it works just fine.
Button-
I’ve found examples online regarding how to program a button. I used a while loop to say: While the button is on high(pressed) run the rest of this loop(flash lights–>turn servo) It is important to have the button that does not remain on when pressed, and that’s something I paid attention to when ordering parts.
Setup:
I have found a spool and a proper attachment to the servo but I have yet to connect them. Below I have attached how each part is connected to the Arduino.

Ignore the middle two prongs of the button, the button has 4 prongs, not 6
That’s all, let me know if anyone has any questions.
I love the attention to detail you have put into your project! It’s great to see your code. Your comments on each line make it easy to read and help conceptualize the device in action. Great work!
For future iterations, there may be a better way to write your code, so not everything has to be manually put in. Perhaps create a loop where the flash time equals a function of the time elapsed since the button was pressed?
Then again, your method works, and you put a lot of time into it – good job 😀
Yeah! I think I mentioned how ugly it is. I was working on a loop but couldn’t get it to work how I wanted to in time for the final presentation.
Yeah that’s real ^^’ but hey, it works.
Also super impressed that you managed to pull this off with a 180 degree Servo o-o