Monday, December 12, 2022

Sing-Pong (Arduino/Unity project)

 


From the start, my goal was to create a voice-controlled game, of course within the limits of Arduino and its microphone component. Sing-Pong is mostly just like Pong, except the paddle is controlled by voice. Players are to vocalize into a microphone (made of a wooden spoon), with the height of the pitch being analogous to the altitude of the paddle.

The aesthetic of the Unity application and the paper casing for the Arduino board are specifically inspired by the very early home consoles of that era (mid-late 70's, early 80's), with the orange casing, button panel, and logo design being a mixture of specifically (pictured left to right) the Atari console and Nintendo's Color TV-Game 15.



While the application and casing design were relatively simple to put into practice, the actual gameplay has (and still does) face some issues. Through either the wiring being too loose, the microphone component itself being internally damaged, or some other likely physical factor, the readings of the microphone (or at least the resulting Fast Fourier Transform) often seem to act unpredictably. Admittedly, traces of this can even be seen in the video demo. As a slight workaround to this, adjustable parameters for min/max frequency and min amplitude are available in the Unity editor.

Tuesday, November 29, 2022

Tactile Interaction Challenge: Invisible Water - Felix Warner

This physical computing "game" incorporates a mug and a sponge. The mug has a gyroscope in it, such that it can detect when it is being tipped over, and the sponge is affixed to a surface such that it hides a small hose feeding into its underside. When the (empty) mug is registered as being tipped over, water will flow through the hose and the sponge will visibly dampen and expand. This gives the illusion that invisible, intangible water is being poured from the mug, and being made visible and tangible as soon as it is absorbed by the sponge. To "reset" the experience, the sponge can be wrung out by pressing down on it and emptying out the "now-visible" water into an adjacent drain, to be reused by the hose.



Sunday, October 30, 2022

The All-Nighter (Arduino/Unity project)


This experience follows a little green man who just can't seem to stop working hard (or hardly working) and leave his room. Even what he perceives as sunrise or sunset only faze him slightly, prompting him to disgruntledly get up and switch the lights to compensate for the exterior light level. The state of the indoor lights can be seen as emissions from the windows of his tangible house, as well as through the on-screen live feed of him in his room.

The experience can be seen as amusing, tampering with the man's rut, even if slightly, and watching him clamber to do the bare minimum in adapting to his surroundings. Even so, his refusal to sleep, or even take care of himself at all, in favor of whatever it is he is doing on his computer can act as a depressing yet cautionary reflection of some obsession-prone viewers' lives.

Thursday, September 29, 2022

Tactile Interaction Challenge: Portal Pin Art - Felix Warner, Lars Puglise, Preston Gilmore



Pin art boards allow users to press objects or parts of the body on one end and see a depth image of it emerge on the other side, and the computer game Portal allows players to seamlessly move objects or themselves between a pair of wormholes. Put these interactive concepts together, and you can create the illusion of a real working pair of portals, albeit with a pin art board halfway through them. On one end is a pin art board halfway submerged through one "portal" with push potentiometers behind each pin. On the other end is the "other half" of that pin art board, with linear actuators behind each pin to mirror the extent to which the corresponding pin on the other end is pushed out. This gives the illusion that it is the same pin art board, and that the portals are working just the way they do in the iconic computer game.



Sunday, September 25, 2022

Arduino Distance Guessing Game

Goal 

For this project, my goal was to make a simple game with the ultrasonic distance sensor. Specifically, one wherein players guess how far they need to place an object in front of the sensor, submitting their guess with a button and being told which side of the target they were on via a pair of LED's. When the player guesses correctly, the target changes and another round starts.

Setup

The physical components, starting from the Arduino 33 IoT on one end, goes in the order of button, colored LED's, and sensor. This is arranged with the vision of the left hand pressing the button and the right hand moving the object left or right, with the Arduino side towards the player. If the object needs to be moved right, away from the sensor, the red LED on the right will blink. If the object needs to be moved left, towards the sensor, the green LED on the left will blink. If the object is in the right spot, both LED's will blink in unison, starting the next round afterwards.
On the programming side of the equation, the program starts by randomizing an answer within a certain centimeter range. In the main loop, button presses are tracked by comparing the states of the button at the last update and the current one. If the button was LOW at the last update and is HIGH now, the button has just been pressed, and it is time for the sensor to measure the distance of the object. The sensor measures pulses to the object several times, converting pulse duration to centimeters, and averages the results out. The measured guess is compared with the actual answer, determining which LED should blink. Since this function is not asynchronous and uses delay(), button presses are not registered and the user cannot guess again while the LED is blinking, as should be the case.

Fritzing Schematic



Code

Photos

Video Demo



Issues

The biggest problem I faced was the sensor. Even with smoothing, its readings had major spikes at near and far distances. This was to be expected as I tested it with my hand, which is not an entirely flat surface. However, the problem seemed to persist even with objects like the box seen in the video, potentially breaking the fundamental mechanic of the game. I'm not sure if my sensor is faulty or this is a general problem.
Even as I dabbled with the distance sensor before we learned about it in class, I couldn't seem to get it to work at all. I researched the issue extensively online and concluded that I wasn't getting power from the right pin, but none of the solutions I found pointed to what my wiring should look like.

Citations

Ultrasonic+Interrupt Timing demo from class

Friday, September 9, 2022

Arduino Green/Red Blinker

Video

About

This Arduino setup has two LED's (one green on the left, one red on the right), a switch, and a button. The switch controls which LED is active (respective to left and right on the switch), and the button can be held down to make the active button blink.

I wanted to take what was done in class and build upon it. At first I wondered how I could get creative with just two inputs and two binary LED's, considering either LED basing their state on some discrete math operator of the two inputs (XOR, imply, etc.). I then recalled our previous exercise in blinking, and wondered if I could combine the two exercises.

Making blinking toggleable alongside switching the active LED would make the code need to be synchronous (unlike the delay() method in the Blink example) because the state of the switch would have to be read every update. Sure enough I was able to find a tutorial on writing such code, checking the time every update with mills() and keeping track of the last blink's timestamp.

Link to Code

Tutorials and Resources

How to Wire and Program a Button - Arduino Documentation

Thursday, August 25, 2022

FaceCake Swivel

 Hello everyone, and welcome to my new blog! In this first post, we will look at the FaceCake Swivel.


Right off the bat, I should mention that this is not quite a work of art, rather, it is a marketing tool (though it is indeed interactive with an alternative interface). FaceCake is a company that specializes in making AR experiences for other brands. Specifically, they make experiences for clothing and beauty brands that allow customers to sample their products.

This particular set of hardware and software has store shoppers (or even pedestrians passing by a storefront window) stand in front of a screen that displays a camera feed of them like a mirror. They can select articles of clothing and accessories by moving their hands over an on-screen menu, and then see these items superimposed on their bodies. This gives the impression of the potential customer actually trying them on and looking in a mirror.

It is my understanding that this is achieved by implementing technology similar to that of the Microsoft Kinect, if not simply using that exact product. The "mirror" feed is fairly obviously the work of a camera, though the installation's understanding of the user's body position is likely inferred from an infrared projector and camera. This sensor creates a voxel-like "depth map" of the space in front of it. The installation's software then extrapolates a humanoid "skeleton" from this 3D scene. With the knowledge of where the user's hands, head, and torso are, the installation can tell what the user wants to select with their hands, and where to display the clothes and accessories on-screen.

More info about this installation and others like it can be found on FaceCake's official website.

Sing-Pong (Arduino/Unity project)

  From the start, my goal was to create a voice-controlled game, of course within the limits of Arduino and its microphone component. Sing-P...