Stupid Pet Trick. What is more stupid that a machine that is completely pointless? And what is more pointless than a Rube Goldberg machine designed solely to unplug itself?
The first step was to choose the components of the chain reaction and test them:
- Wind sensor: That little rectangle thing uses
magicphysics to measure the flow of wind around it. I decided to have a fan blow into the sensor at some point, so I tested the sensor to learn how to use it. The sensor needs three basic connections: power, ground and output. It doesn’t need resistors as it already has several built in. Just plug the output of the sensor into an analog input pin and voilà! I then added an ultra bright LED wuith a PWM output to test.
2. Photocell – I also chose to have light shone on to a photocell as a stem in the machine. I was considering covering up the photocell with a little box to block ambient light, but then I figured I might as well try calibrating the photocell taking ambient light into consideration. Turns out callibration is enough for the sensor to discern when an ultra-bright LED shines next to it, even with ambient light.
3. Capacitive sensor – Another new toy was the capacitive sensor. Using the example code, I tried my circuit to make sure it worked. Doing so I learned that the sensor area of the circuit should be between the fat resistor and the output pin. Due to the fat resistor gobbling up so much of the voltage, touching the circuit between the resistor and the sensor pin doesn’t really work. After that test, I connected a servo motor and wrote some code to control it with the capacitive sensor. It was great.
4. The final servo – Finally, I had to make sure I could actually unplug my creation with a servo. Turns out that the small servo included in our kits doesn’t have enough torque. Luckily, the bigger servos we have in the lab are powerful enough.
After testing, I just had to put everything together… and write aaaall the code, step by step. Just for fun, I used arrays to code some melodies to be played at different parts of the process (the switch() case statement helped out there). Most of the algorithm as handled by several while() loops. AND IT WORKED!
And then came part two of the project… actually building the thing. This time around, hradware was much more of a hassle than code. I brilliantly decided to build my Pointless Machine using 3D printed and laser cut pieces. Whuch was great. Except for the blood, sweat and tears that resulted from actually building the thing. And soldering. And then the capacitive sensor stopped working for no reason. And that was really infurating, which made me wish I had the
foresight time to do a proper physical debug to sort that out.
But thankfully it worked in the end. Somehow. I have no clue how I fixed it. c: