1st Mac Projector

by yoyo2333 in Circuits > Arduino

177 Views, 0 Favorites, 0 Comments

1st Mac Projector

IMG_5356.JPG

I want to make a project roller. Once people go closer, the roller will rotate and generate paper roll. The shape of the box is inspired by 1st MacBook.

acrylic board

wood stick

2 powerful servo motors

1 circuit board

Arduino uno

1 ultrasonic distance sensor

Make the File in Illustrator(AI)

屏幕快照 2019-12-13 下午2.44.13.png

I make my each side of my box in illustrator with careful measurement. Each line of board outline need to be default blue and 0.001 pt wide since I am going to laser cut them.

Laser Cut

IMG_5325.JPG

I used my school machine to laser cut my file in each piece and compose them with hot glue gun.

Make Circuit and Code

屏幕快照 2019-12-13 下午3.00.23.png

I start to make circuit. This is the tinkercard version.

the code is like this:

const int trigPin = 9;
const int echoPin = 8; // defines variables long duration; int distance;

#include

Servo myservo1; // create servo object to control a servo Servo myservo2;

void setup() { myservo1.attach(11); myservo2.attach(10);

pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output pinMode(echoPin, INPUT); // Sets the echoPin as an Input Serial.begin(9600);

// myservo1.write(0);

}

void loop() {

// Clears the trigPin digitalWrite(trigPin, LOW); delayMicroseconds(2); // Sets the trigPin on HIGH state for 10 micro seconds digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); // Reads the echoPin, returns the sound wave travel time in microseconds duration = pulseIn(echoPin, HIGH); // Calculating the distance distance= duration*0.034/2; // Prints the distance on the Serial Monitor Serial.print("Distance: "); Serial.println(distance);

if(distance<20){ myservo1.write(180); myservo2.write(180); }else if(distance>20){ myservo1.write(0); myservo2.write(0); } delay(15);

}

Test and Set Up the Circuit

IMG_5352.JPG

I was testing if my code would work. It could! That's nice

Put the Gear on the Servo

servo motor and gear

I glue the gear on the servo motors so that it can rotate the wood stick with large gear.

Load Other Everything

two servo motor and gears

Put the paper roll I printed on the wood stick. And when you get close to the machine, you the screen will move by the rotating wood stick!