My final project for the New Textiles class was inspired by the idea of telepresence, a word coined by the great Malvin Minsky. According to him, technologies are evolving to perfect the idea of telepresence, making it fit naturally in daily life. The premise for my project is simple, my loved one is moving away, across the nation, and I would still like to have a close relationship with him, not only through words but also through small actions. An easy way for someone to know you love of them is through a simple touch. Combining that idea with the fact that stuffed animals are naturally used by children to show care and love, I wanted to create a pair of stuffed animals that can communicate across the nation, using wifi.
The materials I used for the project are the following :
yarn, circular knitting needles, double pointed needles, tapestry needles, buttons, stuffing
2 WiFly shields, 2 Arduino Unos (R2), 2 A-B usb cables, regular wires, square LEDs, hot glue gun
I will continue the story from the previous update post about the final project.
The sensors I made for the bunnies are pressure sensors for the body and the ears, and a stroke sensor for the head. I did not run into many problems with making the sensor. However, they took a while to make.
The part that turned out to be harder than I expected is the assembling process. I do not want to solder directly onto the wifly or the arduino because they are expensive, and I want to be able to use them again for different projects. It took several tries to come up with the correct solution. Leah suggested that I solder female headers perpendicular to the top of the wifly. This turned out to be a wonderful idea! I can remove the wires from the wifly and plug them for testing in to the arduino freely.
Next, I soldered wires to all of the sensors and pulled them through the bottom hole of the stuffed animals. Because the inside is virtually a space that can be used to hide everything, it was easy to fit the sensors inside the bunnies. The only sensor that I did not solder wires to is the stroke sensor. For that, I used conductive wire and weaved that to the bottom of the bunny, being careful not to make any accidental shorts in the circuit. For added security, I used the hot glue gun to put glue on parts of the wirings that may have a chance to short out the circuit. This helped save a lot of headaches, but it is not very pretty.
The bigest monster of the project is the wifly. The coding of the interaction itself is not difficult. For example, if one bunny is hugged, then the body of the other bunny will light up with the LED. The other bunny must be hugged to shut off the LED. Now, if this bunny is hugged only once, his LED will simply shut off, but if hugged twice, he will “return the hug.” There is also a simple need for keeping time in the system, otherwise the wifly will be commanded to check webpages several times a second. In my code I’ve written to check for new signals every 10 seconds and to not send the same signal again until after 2 seconds has passed.
It was hard getting the wifly configured, and it is also hard to get it to pull webpages at a set interval and then parse them.
1. The connection that the wifly makes is very inconsistant. Sometimes, it will connect and sometimes it doesn’t. This also changes with the network that it is trying to connect to. For example, it is harder for the wifly to connect to a open MIT network than a protected WPA1 or WPA2 network. The wifly also does not like to connect to webpages that are hosted by scripts.mit.edu. For some reason that I have not investigated, it sometimes takes the wifly over 20 tries to connect once. Because of this, I had to get my own server (using Amazon’s virtual machine) and host my .php files there. (The setup for the server is not trivial, and I had to ask a friend who had experience to help me.)
2. Parsing the output of the wifly is a daunting task. In the following video, you will see what I mean. It shows what happens on my computer as I simulate a “conversation” between the two stuffed animals.
Not only do I have to find the words that I want, I have to find a way to disregard all of the symbols that are printed out by the WiFly. I don’t really understand why the print outs look like so, but I came up with a semi-workable way to go around the problem. Instead of using the web stuff (http) I decided to use the more low-level TCP protocol to retrieve “pushes” from either bunny. Here, I assign each “action” to a number. So instead of reading a whole slew of letters, it only needs to recognize and parse 1 char.
Here is a short video of the bunnies communicating! (After the scare over the weekend because it stopped working, I took it to a friend’s house and tested using their network. After some small tweaks, everything was fine.)
I will be presenting this to my loved one who is moving away in the next couple of days!
Here is a PDF of my in-class presentation .