IR Controlled Spinning Speed Cube Display

by ArihantNag in Circuits > Arduino

25 Views, 0 Favorites, 0 Comments

IR Controlled Spinning Speed Cube Display

IMG_20260111_124620.jpg

Imagine This: you walk to your living room just to see the great pacific garbage patch spread all over the floor, your mom says, "GET THIS MESS CLEANED UP NOW!" Even you think it's messy and it's time to clean up. But where do I put all this stuff, the legitimate garbage goes in the trash, but I soon realized I had no place for my cubes and under no circumstances would I disrespect them. So, I thought long and hard and I'm proud to present... An IR controlled spinning speed cube display!

Supplies

Parts (3d Printed)

PXL_20260111_151600107.jpg
PXL_20260111_152052400.jpg

here are the parts we will use (I used slightly different parts, but these look better)

Put Servo Wheel and Cube Stand on Base

IMG_20260111_124410.jpg
IMG_20260111_124452.jpg

hot glue or superglue the wheel (I used a different one than the file) in the absolute center of the base. hot glue the cube stand in the middle of the other side of the base. this will be the turn table for the display.

Put Electronics in the Undercarriage

IMG_20260111_124525.jpg

just jam the electronics inside the base and route the servo wire through any hole.

Here’s a clear, reliable wiring guide for your exact setup:

  1. HX1838 IR receiver
  2. Arduino UNO R4 WiFi
  3. Continuous‑rotation servo on pin 3
  4. IRremote library using pin 2

Everything below matches the code you’re using.

Wiring Overview

1. HX1838 IR Receiver → Arduino UNO R4

Most HX1838 modules use this pin order (left → right):


OUT GND VCC

Wire it like this:

HX1838 PinArduino Pin

OUT

D2

GND

GND

VCC

5V

Important: IRremote on the UNO R4 expects the receiver on pin 2. Using pin 8 causes decoding problems.

2. Continuous‑Rotation Servo (CR servo) → Arduino UNO R4

Your servo has three wires:

  1. Brown / Black → Ground
  2. Red → +5V
  3. Orange / Yellow / White → Signal

Wire it like this:

Servo WireArduino Pin

GND

GND

5V

5V

Signal

D3

Note: Servos draw more current than sensors. If your servo twitches or resets the board, you may eventually want a separate 5V supply — but for light loads, the UNO R4’s 5V pin is usually fine.


HX1838 IR Receiver:

VCC → 5V

GND → GND

OUT → D2


Continuous Rotation Servo:

Red (VCC) → 5V

Brown (GND) → GND

Orange (SIG) → D3

Everything shares common ground.


IR Receiver

IMG_20260111_124534.jpg

glue receiver on front hole and ad bracket to make things look cleaner (handle.stl)

Addition of CR Servo

IMG_20260111_124539.jpg

Glue on CR servo behinde handle.stl.

Final Step, Put Turntable

IMG_20260111_124604.jpg

you should just be able to press fit it on.

Code

Capture.PNG

It's always safe to check what signals your remote is sending. Here's the Hex reader code:

#include <IRremote.hpp>


const int RECV_PIN = 2;

void setup() {
Serial.begin(9600);
IrReceiver.begin(RECV_PIN, ENABLE_LED_FEEDBACK);
Serial.println("Ready to receive IR signals...");
}

void loop() {
if (IrReceiver.decode()) {
Serial.print("HEX: 0x");
Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX);
IrReceiver.resume();
}
}

if your receiver (on pin 2) is getting 0xBA45FF00 and 0xB946FF00 when button "1" and "2" are pressed, Awsome!

if not, thats fine, just replace the the default hex code with your hex code:

#include <IRremote.hpp>
#include <Servo.h>

const int IR_PIN = 2;
const int SERVO_PIN = 3;

Servo crServo;

void setup() {
Serial.begin(9600);
IrReceiver.begin(IR_PIN, ENABLE_LED_FEEDBACK);

crServo.attach(SERVO_PIN);
crServo.write(90); // stop
}

void loop() {
if (IrReceiver.decode()) {
uint32_t code = IrReceiver.decodedIRData.decodedRawData;

if (code == 0xBA45FF00) { //CHANGE IF NEEDED
crServo.write(80); // slow spin (adjust 70–89 if needed)
}

if (code == 0xB946FF00) { //CHANGE IF NEEDED
crServo.write(90); // stop
}

IrReceiver.resume();
}
}


TEST!

IMG_20260111_124620.jpg

I would love to show you a demo but unfortunately, phone cameras emit infrared light which makes the IR receiver go CRAZY and so the remote doesn't work because the phones IR overpowers the remote.

I hope you had as much fun as me when making this! BYEEEE!