Rotating Display

This project intends to demonstrate the basics of robotics through the use of Arduino. I was really interested in the Geneva Drive mechanism, so I decided to base my project around it.

I designed a display stand that can rotate to show four different things. However, a constantly rotating display stand would make it hard to see each thing clearly. By using a Geneva drive, I can transform a constant turning motion into separate 90° turns with pauses in between. Additionally, I added LEDs to light up each display item with a different colour and set them up to match the rotations of the display.

I selected four Lego Ninjago Minifigures to put on the display as Lego Ninjago is one of my favourite tv show and an integral part of my childhood.

Video Demo

https://drive.google.com/file/d/1XJ2-KDv5k0xWASW0IL4BOMyf_LY_ffpl/view

Virtual Prototype

◈ Onshape Design

Geneva Drive Mechanism Demo


Geneva Drive Mechanism (Driven Wheel, Driving Wheel, and Wheel Guide)


Motor Adapter and Connector to Driving Wheel and Wheel Guide


Display Stand and Connector to Driven Wheel


Full Assembly


◈ Circuit Schematic

TinkerCAD Circuit


Auto-Generated TinkerCAD Circuit Schematic


The Motor is connected to a 3.3V and a different grounded resistor. I tested many different resistance values to find a suitable rotation speed and landed with a 10Ω resistor.

The 4 LEDs are each connected to a different Arduino Pin (D2 to D5) and then to the same grounded resistor (220Ω).


◈ Bill of Materials (BOM)

Auto-Generated TinkerCAD Bill of Materials

I also need many wires and a breadboard to connect these components.


Laser-cut pieces


Lego pieces


◈ Arduino Code

const int PINS[] = {2, 3, 4, 5};
const int RPM = 30;
const int DELAYMS = 60000 / RPM;
int idx = 3;

void setup() {
  for (int pin : PINS) {
    pinMode(pin, OUTPUT);
    digitalWrite(pin, LOW);
  }
  // Serial.begin(9600);
}

void loop() {
  digitalWrite(PINS[idx], LOW);
  idx = (idx + 1) % 4;
  digitalWrite(PINS[idx], HIGH);
  delay(DELAYMS);
}

I included 3 constants in my code:

  • “PINS” is an array that stores which pins are connected to the LEDs.
  • “RPM” is a constant that stores how many rotations per minute the motor spins.
  • “DELAYMS” is the number of milliseconds per revolution given the RPM.

The “setup” function runs on start, sets pins 2 through 5 to OUTPUT pin mode, and turns them off.

The “loop” function loops continuously and turns off the previous light and turns on the next light. “loop” will repeat once every revolution.

Physical Prototype

◈ From Virtual to Physical

My virtual prototype did not account for gravity. In the physical prototype, many of the axles were wobbling and leaning to the sides. To fix this issue, I added many support structures to stabilize the axles.

To keep the entire Arduino system within the physical base, I used a separate battery source to power the Arduino, rather than connecting to my computer.

My virtual prototype lacked a switch to control the motor. It was annoying to have to take out and put back the wires to control the motor, so I decided to connect a switch between the 3.3V source and motor.

◈ Photos

Rotating Display System From Four Sides


Close-up Inner Assembly (Breadboard, Arduino, Battery, Motor, Wiring)


Close-up Geneva Drive Mechanism

AI Usage

As I had some experience with robotics already, I did not need to use AI to learn robotics.


Revision

This is my revised design of circuit that allows the arduino to control the starting and stopping of the motor that rotates my display.

◈ Circuit Schematic

TinkerCAD Circuit


Auto-Generated TinkerCAD Circuit Schematic


I added an NPN transistor to control the motor, and a slideswitch to get user input.

The Motor is connected to the collector pin of the NPN transistor and a 5V power source through a resistor.

The NPN transistor’s emitter pin is connected to ground and its base pin is connected to Arduino Pin 7 through a 220Ω resistor. This allows the Arduino to control when the motor is “on” or “off” through Arduion Pin 7.

The slideswitch is connected to power, ground, and Arduino Pin 2, which is in “input_pullup” mode to read the user’s slideswitch input.


◈ Bill of Materials (BOM)

Auto-Generated TinkerCAD Bill of Materials

I also need many wires and a breadboard to connect these components.


◈ Arduino Code

const int PINS[] = {3, 4, 5, 6};
const int PIN_M = 7;
const int PIN_S = 2;
const int RPM = 30;
const int eps = 53;
const int DELAYMS = 60000 / RPM - eps;
int idx = 0;

void setup() {
  for (int pin : PINS) {
    pinMode(pin, OUTPUT);
    digitalWrite(pin, LOW);
  }
  pinMode(PIN_M, OUTPUT);
  digitalWrite(PIN_M, LOW);
  pinMode(PIN_S, INPUT_PULLUP);
}

void loop() {
  if (digitalRead(PIN_S) != 1) {
    digitalWrite(PINS[idx], HIGH);
    digitalWrite(PIN_M, HIGH);
    delay(DELAYMS);
    digitalWrite(PINS[idx], LOW);
    digitalWrite(PIN_M, LOW);
    idx = (idx + 1) % 4;
    delay(1000); 
  } else {
    delay(100);
  }
}

I added 3 new constants in my code to control the motor:

  • “PIN_M” is a constant that stores which pin controls the motor.
  • “PIN_S” is a constant that stores which pin reads the slideswitch input.
  • “eps” is a constant that adjusts for rotation error. The motor spins at RPM rotations per minute but turning it off after DELAYMS milliseconds isn’t perfect, so we use “eps” to fix it.

I changed the “setup” function accordingly with the 2 new pins.

I also added slideswitch input handling (if statement) and motor on/off control (digitalWrite(PIN_M)) to the “loop” function.

Additionally, I added a short 1 second delay to increase the pause between each rotation. In turn, this makes each side of the display stop for a longer time.

Comments

5 Responses to “Rotating Display”

  1. mcrompton Avatar
    mcrompton

    This is a fun project, Aston! I love the work that you’ve done to include some CAD design and connected it to a physical mechanism that you are curious about. My big question for you is, how is the arduino driving the motion? As far as I can see, the arduino controls the sequence of LEDs, but I don’t see where the motion is controlled outside of setting a variable for RPM. Please answer this question as the requirement is to use and arduino to move something.

    1. astonw Avatar
      astonw

      Thanks for the feedback.
      I have revised the design to make the arduino control the motor. The revision is at the bottom of this blog post.

      1. mcrompton Avatar
        mcrompton

        Sorry, Aston. I’m confused as to how you’ve changed your device. Did you simply add an explanation of the changes you made at the end of your post? If so, that would be clearer if you’d put that information in a reply to my comment to see the context of that information. Did you edit your code that is embedded on your post? I think that you did, but it is not clearly communicated.

        1. astonw Avatar
          astonw

          Hello Mr. Crompton,

          I did make changes to the Arduino design and code to address your first comment.

          My original design only connected the motor to the power, rather than allowing the Arduino to control it. In the revision, I redesigned the circuit so the Arduino can switch the motor on and off to better rotate the display. The code was also updated accordingly.

          I created a separate revision section to show all of these changes, including the revised video, revised circuit, revised BOM, and revised code.

          In the video, you can see the added wires and components connecting to the motor, as well as a slideswitch used to “control” the motor. The slideswitch moves left and right, and the motor rotates and stops correspondingly, although the components may be too small to see clearly in the video.

          In the explanation of the circuit and code, I did not repeat the original design. Instead, I focused on what I added and how those additions enable the Arduino to control the motor. In particular, I highlighted the idea of adding a short one-second delay in the code to increase the pause between rotations.

          I hope this explanation address your questions.

          Thanks, Aston.

          1. mcrompton Avatar
            mcrompton

            Thanks, Aston.

Leave a Reply to astonw Cancel reply

Your email address will not be published. Required fields are marked *