Pencil sharpener

Description

I attached a pencil to the rotating end of my DC motor and held the other end of the pencil inside a pencil sharpener. When I turn this setup on, the pencil rotates rapidly inside the sharpener and subsequently sharpens the lead.

Components

Arduino Board
Bread board
DC motor
Wires
Batteries
Pencil
Sharpener

int potPin = 0; // select the input pin for the potentiometer
int motorPin = 9; // select the pin for the Motor
int val = 0; // variable to store the value coming from the sensor
void setup() {
Serial.begin(9600);
}
void loop() {
val = analogRead(potPin); // read the value from the sensor, between 0 - 1024
Serial.println(val);
analogWrite(motorPin, val/4); // analogWrite can be between 0-255
}

img_20161011_210850

Leave a Reply