← Back on the shelf
Dimmy the Cube
WILLIAM YAO

Tape 5 of 9 · Kinetic object · 2026

Dimmy the Cube

A cube that dislikes bright light. It senses the darkest direction and flips itself over to get there.

Built by William Yao and Cody Frost · ESP32, gimbal motor, flywheel, six light sensors · Intangible Interaction, NYU ITP

Scroll for how it was made
Liner notesTape 5 of 9 · WY-005

How it was made

Dimmy the Cube

The cube's frame, wired with its sensor boards, next to its assembly in CAD (March 10, 2026)

The cube's frame, wired with its sensor boards, next to its assembly in CAD (March 10, 2026)

A self-flipping cube that dislikes bright light. Six light sensors tell it which face it is resting on and which direction is darkest; a flywheel throws it onto a new face, and a gimbal motor picks which edge it tips over.

Kinetic object · 2026 · ESP32 · Six APDS9960 light sensors · Gimbal motor with SimpleFOC · Flywheel on a bidirectional ESC

Created by William Yao and Cody FrostMade for Intangible Interaction, NYU ITP

WY Home Video · WY-005 · 2026
Kinetic object · Not rated

Overview

0:00:00

Overview

The cube's frame, wired with its sensor boards, next to its assembly in CAD (March 10, 2026)

Dimmy the Cube is a Cubli derivative, co-created by William Yao and Cody Frost for Intangible Interaction at NYU ITP. The Cubli, built at ETH Zurich, is a cube that jumps up and balances on its corner: reaction wheels on three of its faces spin fast, then brake suddenly. Dimmy borrows the spin-and-brake idea, with one flywheel that is meant to tip the cube over onto a darker face.

Work began in February 2026 with light-sensor tests. The wired frame and motor tests followed in March, power saving for the spring show in April, and a wireless console in September.

The idea

0:00:31

A cube that runs away from light

This week, Cody and I came up with the idea to build a cube that runs away from light. We are currently testing the APDS9960 sensor which we saw in class.

How it should behave

My notes on how the cube should behave, from a commit on February 23, 2026:

  1. Check all non-floor sides. If the average is below 18 (need to check how much lumen), it stops moving and lights up.
  2. If not, check every non-floor and non-ceiling side. If proximity is below 12, disregard that side for a possible next move.
  3. Out of all the possible next moves, fire a signal to move to the dimmest side every 3 seconds.
  4. If a light of 3000 (again, need to check how much lumen) is read, fire step 3 right away. This “freak out” state has a 1.5 second cool down.

Sensing light

0:01:07

Testing the APDS9960

Our main concern is how sensitive it can be to detect light differences in a dim room. The APDS9960 library has a function that amplifies the gain on the sensitivity of light detection, apds.setADCGain(), so I took the sensor to 4 different spots of the house using the different amplifiers.

apds.setADCGain(APDS9960_AGAIN_1X) (Default)

Dark (1X)
Dim (1X)
Mid (1X)
Bright (1X)

apds.setADCGain(APDS9960_AGAIN_4X)

Dark (4X)
Dim (4X)
Mid (4X)
Bright (4X)

apds.setADCGain(APDS9960_AGAIN_16X)

Dark (16X)
Dim (16X)
Mid (16X)
Bright (16X)

apds.setADCGain(APDS9960_AGAIN_64X)

Dark (64X)
Dim (64X)
Mid (64X)
Bright (64X)

If we were to use this sensor we should most definitely turn on the 64X (or at least 16X) because otherwise we wouldn’t really be able to detect the small changes in brightness too well. However, this is something we can always calibrate while building.

Yeseul suggested looking at the Adafruit GA1A12S202 log-scale analog light sensor and speaking to Tom about the sensor. Maybe develop a convex lens.

Six faces

Each face has its own APDS9960. All six share one I2C bus through a PCA9548 multiplexer, and the face with the highest proximity reading is taken to be the floor.

The firmware knows the sides only as numbers 0 to 5. Which physical face is which is decided entirely by which sensor is plugged into which multiplexer channel, so the wiring has to follow a fixed convention; wired any other way, the cube would move confidently and land on the wrong face.

While the cube was taken apart, its faces lay flat on a board (“butterflied”) with all six sensors reporting. In that flat-board test, covering a sensor made the rig aim and fire.

Making it move

0:03:29

Two motors

The main motor is a brushless outrunner spinning a flywheel, driven by a bidirectional ESC. Spinning it up and then dropping back to neutral dumps angular momentum into the cube body and tips it over one edge.

The control motor is a 2804 gimbal motor on a SimpleFOCmini, running closed-loop angle control against an AS5600 magnetic encoder. It rotates the flywheel assembly to either 0° or 90°, choosing which edge the flip happens over. It is disabled between flips so it does not burn battery holding torque.

Parts

  • Board: ESP32-WROOM
  • Multiplexer: PCA9548A
  • Light and proximity sensors: six APDS9960, one per face
  • Control motor: 2804 brushless outrunner hollow-shaft motor kit with AS5600 magnetic encoder and SimpleFOCmini driver board
  • Main motor: a brushless outrunner and flywheel on a bidirectional ESC
  • Battery: a 3S LiPo

Test log

The serial monitor during a motor test, from our Notion post. The cube reads its faces, picks a side to flip to, aims the control motor, spins the flywheel up and brakes, then goes back to sensing.

Log · 20 lines
AHH, side 2 is TOO BRIGHT!
I'm standing on side 0, and I want to flip to side 2
[MOVE] Floor:0 -> Target:2 | ControlAngle:0 deg | ESC:2000us
[DATA] Floor:0 | Dimmest:2 (4097) | Brightest:2 (4097) | Avg:4097
[LIGHT] S0:FLOOR S1:65535 S2:4097(DIMMEST) S3:4097 S4:4097 S5:TOP:4097
[PROX] S1:0 S2:2 S3:4 S4:3
[STATE] POSITIONING
[STATE] Spinning main motor
[DATA] Floor:0 | Dimmest:2 (4097) | Brightest:2 (4097) | Avg:4097
[LIGHT] S0:FLOOR S1:65535 S2:4097(DIMMEST) S3:4097 S4:4097 S5:TOP:4097
[STATE] Braking
[DATA] Floor:0 | Dimmest:3 (830) | Brightest:1 (4097) | Avg:3346
[LIGHT] S0:FLOOR S1:4097 S2:4097 S3:830(DIMMEST) S4:3610 S5:TOP:4097
[PROX] S1:4 S2:4 S3:176(BLOCKED) S4:154(BLOCKED)
[STATE] BRAKING
[STATE] Returning control motor to 0
[STATE] Back to sensing
AHH, side 2 is TOO BRIGHT!
I'm standing on side 0, and I want to flip to side 3
[MOVE] Floor:0 -> Target:3 | ControlAngle:90 deg | ESC:2000us

Preparing for the show

0:04:17

Power

On April 15 we were concerned with how much our 500mAh Ovonic battery could provide for the spring show that we were preparing this cube for, so we started thinking about power preservation.

We wanted to test whether the BLDC can release the “hold” that it has when it is idle, and only engage when we need to spin the ESC-attached motor (maybe a little before and a little after), because we think this will save the energy the BLDC uses when it is idle.

I coded two more commands so that we can disable the motor and re-enable it to see it snap to the last position. And if the motor is off and it receives an angle, it will re-enable and turn to the angle.

The gimbal motor’s holding torque is the biggest idle power draw. So the control motor is disabled at boot and while the cube is sensing, re-enabled just before it positions for a flip, and disabled again after braking.

Going wireless

Once the cube is closed up there is no USB port to reach, so WiFi is the only console: it carries telemetry out and takes the same commands back in. Cody moved the firmware into a PlatformIO project and added a wireless console in September 2026.

After reassembly the cube boots disarmed and in step mode: WiFi up, both motors initialised, and nothing moving until told. Each step of the bring-up is a superset of the one before, so you stop at any point that misbehaves.

#SendWhat it proves
1wIt is alive, on the network, and knows which face it is on
2dThe decision is right. Moves nothing: carry the cube around and watch the plan track its orientation
3g, then t, t, tThe sequence is right. g commits to one flip and parks at each phase; t advances it
4j, then gThe timing is right. Step mode off, so one flip runs at full speed
5m and a sideThe move tables are right. Command flips to specific faces and confirm it lands where the table says
6aLet it loose. The first flip comes one interval later, then every interval after

k stops everything at any point and disarms.

The credits · back of the box

Dimmy the Cube

Created by
William Yao and Cody Frost
Made for
Intangible Interaction, NYU ITP

Kinetic object · 2026 · ESP32 · Six APDS9960 light sensors · Gimbal motor with SimpleFOC · Flywheel on a bidirectional ESC

WY Home Video · WY-005 · 2026
Tape 5 of 9 · Not rated · Reading time 6 min