Team: Billy & Sidra
Link to the app: http://192.168.50.184/~sm6450/speechapp/
We started off by creating the web app and laser cut monkey. The biggest issue in creating the app was positioning the various elements onto the page. Since this was being created for a phone and a desktop, we needed to make sure that the positioning of the various elements was just right for both screen sizes. After some trial and error, we figured out the final layout for the app.
After this, we worked on the jquery and Arduino codes for the app. In jquery, we created a function “onChange()” that would analyse the input text and figure out if it matched any of our preset dictionary words (like dance or jump). If it did, it would then carry out a command based on which word was matched. For each word, it would send out a command that would turn on and off specific pins (11, 12, 13, 5). The commands were sent through ajax in the form of a url (e.g. http://speechapp/arduino/digital/11/1). This url was then read by the Arduino Yun to turn on and off it’s specific pins. Based on these pins, the Arduino code had conditionals set with it to move the different servos to different positions. For example, the word “jump” would turn on pin 12 and turn off all the other pins on the Arduino. And based on this command, the Arduino would move the leg servos of the monkey up and down to imitate a jump.
After figuring out the code, we started to assemble our monkey with the servos. At this point, we had a lot of problems. Firstly, two of our servos were broken and so did not read any commands that we sent them. After replacing them, we hot glued all the monkey parts to each servo head and fixed them on top of the servos. We did not screw the servo heads into the servos and as a result, every time when the servos moved, the monkey’s limbs fell off. Here’s a sad video as an example:
After realising this problem, we used a heat gun to remove the hot glue and first screwed the servo heads on top of the servos before hot gluing the limbs back on. This was our finished monkey:
This was the back with the servos:
After assembling everything and tweaking the code with different commands, we tested our monkey. It took some trial and error to figure out the exact angles that we wanted to move the monkey based on the commands; however, eventually, we got it to move perfectly.
Here are videos of it waving and jumping:
This project was a lot of fun to make and taught me a lot about how to establish communication between a web application and an Arduino. I think my favourite part of the whole project was actually seeing the text commands transform into a physical output. Through this, we can introduce a new level of interaction in our web applications which I definitely want to explore more in the future.
Arduino Yun Code: