Spaceship Water Dispenser

I always carry my water bottle around and filling it up with water is super boring, so I decided to add some LEDs to the water dispenser in the IM Lab. Everything is still there, except for the Arduino, so if you want to see it working or make it stay there forever download the code below to an Arduino and fill up your bottle.

 

The idea:

I wanted to have a line of LEDs replicate the idea of water flowing by creating a pattern of LEDs turning on and off. Then I thought of having and LED that would be on whenever the switch was opened.

 

Screen Shot 2015-10-12 at 1.29.16 PM

Continue reading “Spaceship Water Dispenser”

PEEEWWWWWWW –> The Illusion of Interactivity

I’m really bad at keeping up with my journal but today I got a super friendly reminder from Scott and I decided to add all the posts I was missing 🙂 YAAAYYYY! Thanks Scott!

Screen Shot 2015-10-12 at 1.16.10 PM

So here we go:

Earlier on the semester I took an invention from the junk shelf, a cardboard tube attached to a horn, and added some LEDs that would only turn on when the user blew the horn. The aim of the exercise was to create a switch that could turn on LEDs without being pressed by the user’s fingers. In my case, I took a normal switch and attached it to the horn so that the user would press it with his/her lips.

thumb

Here’s what the circuit looked like:

Screen Shot 2015-10-12 at 1.24.22 PM

The interesting part about the user experience was the illusion that what turned on the LEDs was the air blowing through the horn and not the lips pressing a switch. This is important in thinking not only how systems work but also how the user perceives they work to focus not only on creating an objects that work in a certain way but experiences that are imagined in a certain way.

Randomly blinking lights

As always, the video of my project working can be found here. My project works as follows. A user is asked to put a pulse sensor on her finger. In her other hand, she presses a button, which turns on a minimum of one light, and a maximum of four lights. Above the lights on the panel are four switches. The user is not prompted to interact with these switches, but I’ve found, at least anecdotally, that he or she almost always will. These switches load on to a master probability distribution which determines how many lights will turn on. Each switch is associated with a function that takes some parameter and the user’s current pulse rate as arguments. The master probability function is the logistic function. The switches influence the logistic functions ‘k’ parameter, changing the shape of the function. Note that as pulse increases, the chance of turning on all four lights gets increasingly close to zero. Each of the lights is turned on once a preset threshold is met. For example, if the logistic function, evaluated at some randomly chosen point was above 0.47, then the first light would turn on. The thresholds are on a bit of a log scale, such that the 1st threshold is around 0.5, the second is around 0.75, the third is around 0.9, and the fourth is around 0.99.

Upon using my project, it seems clear that at least some of the switches influence how the lights turn on, but its unclear how the switches are related. Instead of directly adding terms to the master probability distribution, the switches influence the parameter that controls the shape of the master probability distribution. This means that the effect of the switches isn’t felt as strongly as directly adding terms. Luckily for me, the logistic function and the functions associated with each switch are relatively stable. This means that a small change in input results in a correspondingly small change in output.

Troubleshooting Arduino code is a little annoying for me because it’s more difficult to see what’s going on incrementally compared to Python. As such, I prototyped my master probability function, along with all the functions that load onto it with an iPython notebook (I guess it’s called Jupyter now). I found that the best way to select appropriate parameters for the loading functions was by using iPython’s interactive plotting ability. Once I had a good idea what these were, I hard coded them in my Arduino code.

The Pointless Machine!

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:

  1. Wind sensor: That little rectangle thing uses magic physics 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.
Testing the wind sensor...
Testing the wind sensor…
Wind sensor!
Wind sensor!

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.

Testing the LED-triggered photocell...
Testing the LED-triggered photocell…

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!

The finished prototype!
The finished prototype!

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:

AWESOME VIDEO OF AWESOME

Listening to butterflies’ sound

I combined Arduino and paper arts together in this project. You can see four paper butterflies connected to four different -length wires are fixed by nails. When you use your finger to touch the heads of the nails on butterflies, the speaker connected to the work will make sound. When you touch different butterflies, the different sound you will get. You can also play on these different sounds to make your own butterfly song.

You can see the video here:Butterflies’ sound

Continue reading “Listening to butterflies’ sound”