Introduction: Starry Night by Vincent Van Gogh With Spinning Stars

The painting by Vincent Van Gogh is very beautiful to look at. However, in order to make it more interesting, we will be adding motors to each of the four stars in this intractable.

Step 1: Gathering the Required Materials and Tools

  • Poster of Starry Night by Vincent Van Gogh
  • Foam Poster Board
  • 4 DC Motors
  • Distance Sensor
  • PIR Sensor
  • 2/3 state Switch
  • Push Button
  • X-acto knife
  • Hot glue gun
  • Glue sticks
  • Tacky Spray
  • Jumper Wires
  • Arduino Uno Board
  • 2 Breadboards
  • H-Bridge
  • 2 AA Batteries
  • Battery Holder

Step 2: Preparing the Board

First, let us prepare the board.
  1. Cut the panels off of the poster board. Save this.
  2. Cut out the 4 stars out from the poster using the x-acto knife. Be carful to only cut out the stars. Take your time and be precise. Do not cut in the middle of the stars. Save this.
  3. Place the poster with the cut out stars on the poster board
  4. Use a pencil to outline the poster and the cut outs

Using these newly drawn outlines on the board, we now have to create places for the DC Motors to sit.

  1. Trace the outside of a DC Motor in the middle of the star. Try to get it as close to the middle as possible. This will help the star balance when it is spinning
  2. Cut this out. Do not cut out the outline you made for the star

Now that we have done this, it is time to stick the poster on the poster board.

  1. Using the tacky spray, stick down the poster onto the poster board. Make sure that you remove any air bubbles and use a ruler with a cloth on it to press down the poster as you apply the glue.

Step 3: Preparing the Stars

In order to allow the stars to spin, we need to glue them on something that is a bit more sturdy then paper.

  1. Using your cut out stars and the cut out panels from the poster board, outline the stars on the board
  2. Cut the outline out from the panels of the poster board
  3. Cut out a minuscule hole in the center of the foam you just cut out
  4. Using the tacky spray, glue the stars from the poster onto your newly cut out piece

Now that the stars are prepared, we have to glue the motors on the stars and fit them onto the painting

  1. Using the hot glue gun, place a drop of glue inside the cut out of the stars
  2. Before the glue dries, push the tip of the DC Motor into the cut out

This will ensure that the star stays on the motor while it is spinning. The glue will not ruin the motors.

Step 4: Add the Stars to the Board

  1. Insert the DC Motors in the cut outs you have made for the motors in the large poster board
  2. Using your hot glue gun, secure the DC Motor to the poster board
  3. Ensure that the stars are able to spin

Step 5: Connecting the Push Button and Switch

The push button is one of the easiest electronics to connect to the motors. Push Buttons are able to finish the circuit when pressed so the motor will only run when the button is pressed.

  1. Connect one leg of the button to one pole of the motor using a red jumper wire
  2. Using a red jumper cable, connect the other pole of the motor to the power end of the breadboard
  3. Connect the leg right next to the previously connected wire to a black jumper wire
  4. Insert the black wire into the ground area in the breadboard

The switch is similar to the push button in the way it is installed. If not simpler. A switch interrupts a circuit when it is off. When the switch is in its on position, it completes the circuit, providing electricity to the motor. When it is off, the circuit is interrupted. Thus, the motor will only run when the switch is in the on position.

If you are using a 2 state switch, follow the directions below.

  1. Connect one pin of the switch to one pole of the motor using a red jumper wire
  2. Using a red jumper cable, connect the other pole of the motor to the power end of the breadboard
  3. Connect the other pin of the switch to a black jumper wire
  4. Insert the black wire into the ground area in the breadboard

If you are using a 3 state switch, follow the directions below. In this type of switch, you can chose which side turns the motor on and which side turns the motor off.

  1. Connect one pin of the switch to one pole of the motor using a red jumper wire
  2. Using a red jumper cable, connect the other pole of the motor to the power end of the breadboard
  3. Connect the middle pin of the switch to a black jumper wire
  4. Insert the black wire into the ground area in the breadboard

Peel the back of the breadboard and stick it on the back of the poster board. Connect a battery to it and make sure that the motors spin. Make any necessary adjustments to your circuit to allow it to work.

Step 6: Connecting the Distance Sensor and PIR Sensor

A distance sensor is able to judge the distance of any object in front of it and either start of stop the motor based on your code. However, in order to properly connect the motor to the distance sensor as well as the PIR Sensor, we need to use an H-Bridge.

Using a separate breadboard, connect both sides of the H-Bride using the method below

  1. Connect the enable pin to Pin 10 on the Arduino for the Distance Sensor and Pin 9 for the PIR Sensor
  2. Connect the Input Pins to Pins 2 and 3 on the Arduino for the Distance Sensor and Pins 6 and 7 for the PIR Sensor
  3. Connect the output pins to the pins on the motor. It does not matter which side of the motor you attach to which pin on the H-Bridge
  4. Connect the ground and VS Pins to the ground and power strips on the breadboard

Connecting the Distance Sensor

  1. Connect the VCC and GND pins of the distance sensor to the ground and power pins on the breadboard respectably
  2. Connect the Trig Pin to Pin 5 on the Arduino
  3. Connect the Echo Pin to Pin 8 on the Arduino

Connecting the PIR Sensor

  1. Connect the VCC and GND pins of the PIR Sensor to the ground and power pins of the breadboard respectably
  2. Connect the middle pin of the PIR Sensor to Pin A0 on the arduino

Step 7: The Code

Add the following code to Arduino and run it

const int trig = 5;
const int echo = 8;

const int controlPin3 = 2;

const int controlPin4 = 3;

const int enablePin = 10;

int duration = 0;

int distance = 0;

//PIR Sensor tester code

int inputPin = A0; // choose the input pin (for PIR sensor)

const int enablePin2 = 9;

int val = 0;

int controlPin1 = 6;

int controlPin2 = 7;

void setup() { // put your setup code here, to run once:

Serial.begin(9600);

pinMode(enablePin,OUTPUT);

pinMode(trig,OUTPUT);

pinMode(echo,INPUT);

pinMode(controlPin3, OUTPUT);

pinMode(controlPin4, OUTPUT);

//code for PIR sensor

pinMode (enablePin, OUTPUT);

Serial.begin(9600);

pinMode(controlPin1, OUTPUT);

pinMode(controlPin2, OUTPUT); }

void loop() { // code for the distance sensor:

digitalWrite(controlPin3, HIGH);

digitalWrite(controlPin4, LOW);

digitalWrite(trig, LOW);

delayMicroseconds(2);

digitalWrite(trig, HIGH);

delayMicroseconds(10);

digitalWrite(trig, LOW);

delayMicroseconds(2);

duration = pulseIn(echo, HIGH);

distance = (duration/2) / 20;

Serial.println(distance);

delay(300); if (distance >= 30) {

analogWrite(enablePin, 177);

}

else {

analogWrite(enablePin, LOW);

}

//PIR Sensor code

val = analogRead(inputPin);

Serial.println(val);

digitalWrite(controlPin1, HIGH);

digitalWrite(controlPin2, LOW);

if (val>550) { // check if the input is HIGH

// we have just turned on

Serial.println("Motion detected!");

analogWrite(enablePin2, 177); // We only want to print on the output change, not state

}

else { // we have just turned of

Serial.println("Motion ended!");

digitalWrite(enablePin2, LOW); // We only want to print on the output change, not state

}

}

Step 8: The Board

  1. Cut out holes in the Poster Board in the dimensions of the Distance Sensor, PIR Sensor, Push Button and Switch
  2. Push the electronics through that hole and secure it with tape
  3. Test out the product to see if it works
    1. Be sure to give the Arduino power through either your laptop or a wall outlet.
    2. Be sure to connect the batteries to the breadboard
  4. If it works, be sure to attach this breadboard to the back of the poster board as well.

Congratulations! You Have Finished the Project! Have Fun and Show it Off To All of Your Friends!

Step 9: Resources

Some of the images in this intractable have been taken from online. Below is linked those websites.

Distance Sensor

PIR Sensor

Push Button