← home portfolio
HI, I'M UNDER CONSTRUCTION, PLEASE EXCUSE THE ROUGH EXTERIOR—I PROMISE MY CONTENT IS (MOSTLY) GOOD <3

ITP Spring '22 → Intangible Interaction → Curious Cube

Project partner: Luhan Rong

Project requirements here

Initial project idea

This used to be part of week 2 documentation and has been migrated to this page.

Some initial ideas I had (after a conversation with husband):

After talking to Luhan, we both ended up liking the idea of a cube with a cat like personality. In particular, I couldn't get this phrase out of my mind: "cats are a lesson in consent".

Components (tentative)

Prototyping on breadboard

This used to be part of week 3 documentation and has been migrated to this page.

The idea for our Curious Cube is to mimick a cat, and to do that we decided on four components:

*We're still trying to decide between PIR and time-of-flight sensor.

(More idea details in previous week write-up)

To start, we experimented with the PIR sensor. We wanted to use the PIR sensor since it detects motion via the long IR waves that our bodies emmit, we thought perhaps we'd be able to get away with putting the sensor in our cube without drilling a hole in the walls.

PIR hooked up to Arduino Nano (left), and placed in a temporary box to see if it would detect our hand motion through a white acrylic sheet.

Unfortunately, it seemed that the acrylic we had was too thick so our body's IR waves wouldn't transmit through the acrylic and the PIR sensor wouldn't detect any motion. Because of that, we decided to switch to a time-of-flight sensor (but are now uncertain again since the time-of-flight sensor has such a short sensor distance).

Luhan put in the order for our components, and while waiting for them we decided to get started on the code. We simplified our interaction to the following (essentially a finite state machine):

Attempt at mapping the interaction as a finite state machine (ish).

Our final interactions are as follows:

And if person doesn't interact, the cube will reevaluate its state every 5 seconds:

Finally, if the cube isn't interacted with for a minute, it will go back to ASLEEP mode.

To make our coding easier, we started with a pushbutton and a capacitive sensor (from my Homemade Hardware homework haha) and logged to Serial to see if we were entering the correct modes with the correct probabilities:

Arduino wired with just the inputs so that we could concentrate on coding the interaction and state logic.

Here is the code until this point.

When we were certain our code was behaving correctly, our next step was to add in the LEDs. Here are the different LED patterns (and eventually vibration pattern) depending on mode, drawn by Luhan:

We decided that ASLEEP mode wouldn't have any light or vibration, and all the other states would be a white light except for HAPPY—which would be yellow to reward the person for entering the "success" state.

Here it is going from PEACE to SENSITIVE (left video below), entering ANGRY mode (middle video), and HAPPY mode (right video):

Our corresponding code.

And here is the final wiring with the vibration motor and PIR sensor swapped in:

And our final code.

A note: the haptic motor driver (DRV2605) I borrowed from Tom is from Sparkfun, which has an extra pin that the Adafruit version doesn't have. So make sure to follow the Sparkfun wiring guide instead of Adafruit's, even though we're using Adafruit's library.

Fabrication

We decided not to make a cube from scratch and instead bought an acrylic box that Luhan did a beautiful job of wrapping in copper and sanding the lid to make it translucent. Because the copper tape we got was narrower than the cube, Luhan also soldered the strips together so that they'd all be continuous when we soldered the wires for CapSense to them:

Because we wanted our cube to be stand-alone, we planned out in Fritzing what the schematic would look like using a battery instead of connecting to our laptop via USB (it was also just easier to refer to the Fritzing schematic instead of photos of our wiring):

And because I'm kind of extra and dislike wires falling out while people are handling the cube (especially if any wires fell out and accidentally touched the conductive copper tape), I suggested to Luhan that we use a protoboard and she was thankfully on board.

Here is the planning of where each component should go relative to the protoboard and the protoboard after it's been soldered—with header pins for the expensive pieces (Arduino, haptic driver, PIR) so that we could still take them out to use elsewhere!

But when we plugged all the components in, it didn't work. A small moment of panic later, we realized that we had forgotten to wire the Arduino's VIN and GRD 😅

With that taken care of, everything was working exactly as expected while the Arduino was plugged into the computer.

But the oddest thing happened: the CapSense stopped working when we plugged in the battery. No matter where on the copper we touched, it wouldn't respond. After much trial and error, Luhan noticed that the touch sensor would work when someone was holding the battery (it didn't even have to be the same person touching the copper).

We learned from Tom that when a circuit with CapSense moves to a battery source, we need to touch both copper connected to Arduino as well as copper connected to ground. Andy (Homemade Hardware) expanded on this further by explaining that the battery is a very noisy power source which effects how the CapSense library detects touch, and that it should work once we put capacitors by the power (VIN?) pin.

Here is the final cube: