Introduction: Pencil and Eraser Dispenser


By: Adrian & Daniel

Hi, we are twin brothers who will be going to Grade 6 in the Fall.

We built this touch free pencil dispenser because of the Corona virus that has changed our lives in some way or the other.

This invention will help students to be safe in classrooms as we head back to school in the midst of this pandemic. This gadget is a great tool to have in a classroom as a lot of children who lose or break their pencils, or forget to bring them from home, will need to borrow pencils, and in that case this dispenser will help students and teachers obtain pencils with out having to touch anything.

Here are the step by step instructions on how we made this Pencil Dispenser.

Materials & Cardboard Measurements

· Cardboard Wooden sticks, Popsicle sticks, Sharpener, Erasers, Pencils, 1 pop bottle cap

· 21 x 21 cm = 1 piece

· 8 x 11 cm = 2 pieces

· 21 x 21 cm = 1 piece

· 20 x 7 cm = 3 pieces

· 20 x 7.3 cm = 1 piece

· 8 x 1 cm = 2 pieces

· 3 x 1 cm = 2 pieces

· 18 x 6 cm = 1 piece

· 21 x 21 cm = 1 piece

· 21 x 2 cm = 2 pieces

· 8 x 11 cm = 1 piece

· 5 x 6 cm = 1 piece

· 5 x 8 cm = 1 piece

· 5.5 x 7.5 cm =1 piece

· 21 x 2.5 cm = 1 piece

Step 1: STEP 1


  • Cut out the cardboard pieces and measure them

Step 2: Steps 2-5

  • hot glue the 21x8 cm piece to the 21x21 cm
  • glue the 2 8x11 cm also to the 21x21 cm
  • put 20x7 cm like a ramp against the 21x8 cm & glue it
  • add another 20x7 cm against the 2 8xll cm

Step 3: Steps 6-7


  • then make a pencil holder, you need a 20x7 cm, a 20x7.3 cm and you’ll need 2 8x1 cm then put it together
  • glue the pencil holder on top of the 20x7 cm

Step 4: Steps 8-13


  • put the 3x1 cm on the 20x7 cm against the 2 8x11 cm
  • poke holes in front of the 3x1 cm
  • · put small wooden sticks in the hole and then super glue it down
  • · put the 18x6 cm between the 3x1 cm
  • · poke holes in the 18x6 cm 2 cm across from the wooden sticks then put 2 wooden sticks in the holes and super glue it down
  • · take 2 rubber bands and fold them once and put the rubber bands around the 4 sticks

Step 5: Steps 14-21


  • get the other 21x21 cm and on the sides of it glue the 2 21x2 cm
  • · add that under the other 21x21 cm
  • · get the 8x11 cm and glue it to the side of the dispenser
  • · glue a sharpener to the 5x6 cm
  • · glue a 5x8 cm behind the 5x6 cm
  • · then glue a 5.5x7.5 cm to the right of the 5x6 cm
  • · make a box for the pencil shavings can go in
  • · then put some walls around the sharpener box and put some erasers

Step 6: Step 22

  • then decorate and your finished

Step 7: Change in the Upper Body of the Gadget

We had to modify the upper portion of the dispenser at the end as the earlier part was a bit bulky.

Step 8: Code for Sensor / Final Video

We have also done a short video to demonstrate the working of the gadget & to show how useful this could be in a classroom.

Here is the code for the sensor that is activated to dispense the pencils.

---------------------------------------------------------------- /

/ Arduino Ultrasoninc Sensor HC-SR04

// Pencil Dispenser project using Ultrasonic sensor HC-SR04

// ---------------------------------------------------------------- //


#define echoPin 2 // attach pin D2 Arduino to pin Echo of HC-SR04

#define trigPin 3 //attach pin D3 Arduino to pin Trig of HC-SR04

#define RedLed 4 // This pin will be set to HIGH to light the Red LED

#define GreenLed 5 // This pin will be set to HIGH to light the Green LED

Servo servo1;

// defines variables

long duration; // Variable to store measurement of how long the sound wave travels

int distance; // variable to store the calculated distance from sound wave duration above

void setup() {


pinMode(trigPin, OUTPUT); // Sets the trigPin as an output

pinMode(echoPin, INPUT); // Sets the echoPin as an input

pinMode(RedLed, OUTPUT);

pinMode(GreenLed, OUTPUT);


void loop()


//long duration; // - the variables can also be defined here instead of above - but right now commented out

//int distance;

digitalWrite(trigPin, HIGH);


digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH); // Measure the pulse input in echo pin

distance = (duration/2) / 29.1; // Distance is half the duration (duration is the sound traveling to object and then returning to the sensor as an echo) divided by 29.1 (from datasheet)

if (distance <= 10 && distance >= 0) // if distance less than 0.1 meter and more than 0 (0 or less means over range)


servo1.write(30); // The angle of the servo motor determines how much the platen is pushed into the dispenser. We had to trial and error this.

digitalWrite(RedLed, HIGH); // Once platen is pushed the Red Led is lit immediately and green one is off in the line below

digitalWrite(GreenLed, LOW);

delay(15000); // Here we put a delay of 15 seconds before the next pencil can be dispensed. This is to prevent kids from just playing with it and getting more pencils.

// This can be changed instead to a push button switch which must be pushed by the teacher to activate the machine again. It will still be touchless

//because the teacher is not touching the pencils once they are in the machine




servo1.write(0 );

digitalWrite(GreenLed, HIGH); // LEDs status are reversed once delay is over and machine is ready again

digitalWrite(RedLed, LOW);



"Can't Touch This" Family Contest

Participated in the
"Can't Touch This" Family Contest