How to Turn a Mouse Into an Optical Pen (OPTIPEN)




About: An Electrical and Electronic student.I enjoy making things from scratch and sharing with others. Blender noob ,Ms paint expert, Electronics geek.

Have you ever wanted to have your very own handwriting in a document, wanted free hand sketches,etc.Well, for me I have always wanted to.And as a DIY guy I wanted to build such a device for myself but days of internet search yielded no results. I later had an idea on it, I applied it to the optical mouse and it worked!!! I will like to share it with you guys.And PLEEEEASE do not forget to vote for me. Teach it contest and Tech contest.

Things needed

  • An optical mouse
  • A small piece of sheet Aluminum

The casing of an old laptop CD-ROM will be just fine.

  • Epoxy glue
  • Some flexible wires

Any maker has a bunch of this already but in case u don’t, you can fine them in any gadget lying around cell phones exclusive.


  • Screw driver
  • Kitchen knife
  • Hacksaw
  • Pair of scissors

Step 1: Preparing the Mouse

Open up the mouse, making sure that no parts fall out.
It is should be completely disassembled.

The next thing we need to do is to remove the black plastic that covers the red LED. This directs the beam of light from the LED through the lens then onto the sensor. We won’t need this plastic in this project but do well to save it because you never know when you will require his services. I must say that we want to achieve a pen-like shape so much effort will be on trying to make the tip as pointed as possible. How pointed the tip is will depend largely on the PID you are using.PID type 1 (from the image) is the best. The lesser the PID legs/pins the better since less wires are required, less soldering and it also results in a more pointed Optipen tip.

Step 2 Removing the PID

Desolder the PID sensor from the mouse’s PCB. The PID sensor is very fragile so care must be taken with the amount of head applied to it. It can easily be damaged with excessive heat from your soldering iron.

Step 2: Cutting PCB

With the PID removed, the next thing to do is to cut the
mouse’s PCB into two parts. I recommend cutting with a regular kitchen knife starting from the side of the PCB with the copper routes. First mark a straight line that divides the PCB into two equal parts and then start cutting with gentle strokes of the knife. This will prevent pealing of the copper routes white cutting. After cutting please take note of all the routes that were affected (Usually just a few of them). Track every one of them to the nearest node and connect corresponding ones using wires. Once again your wires should be long enough. You may need a magnifying glass just to be sure of the routing. Some components such as the scrolling wheel will not be needed in this project so they must be removed.

Step 3: Preparing the PID for Optipen.

We then need to reduce the length of all the pins/legs of the PID. Wires are then soldered to every pin with the wires facing away from the sensitive side of the PID. Every wire needs to be soldered to its corresponding point on the PCB. Please note that here the wires are in two parts; those that go the left side of the PCB and those that go to the right side. All wires that go to the same side of the mouse’s PCB should be of the same length too. Those that go to the left side must be about the length of the mouse’s PCB and those that go to the right should be about twice the size of the PCB.

When you are sure of all soldering, please cover the pins and soldering with Hot glue or epoxy for a more permanent protection.

Step 4: Preparing the Lens

The optical mouse is made up of very few components but very
complex to deal with. The slightest wrong modification of the optics and the mouse will stop working. The lens is the transparent piece of plastic that is found right under the PCB. It focuses light that has bounces from the surface into the PID sensor. It usually has a rectangular base, we need to trim it leaving the most important part as marked out in the picture. To achieve even smaller tip, we need to get rid of the part of the lens structure (Please refer to the images for the part) that bends the beam from the LED and focus it on a surface at an angle. We will focus the beam right from the LED onto the surface at an angle. So we cut that part too off. We then drill a hole at that side at about 30 degrees to horizontal such that the LED can enter.

The lower case of the optical mouse has a hole in it, thus where bounced beam of light passes to the sensor. This is also the where the original lens used to be. We need to cut out this part from the lower case and glue it to the base of the modified lens structure. Excess plastic must be trimmed making sure that it is uniform with the base of the lens structure.

Step 5: Testing the The Electronics

We need to check whether our electronics so far is working. With
the sensor fitted to the lens structure,

Rub the lens structure on a mouse pad to check whether the cursor moves on your computer.


1. Red light is on but the cursor wont move;

First please check and verify all your connections to the PID and the rerouting made with the wires.

2. If all soldering are ok but cursor still does not respond;

Hover the lens structure some few millimeters from the mouse pad. Vary this distance until the cursor responds. And when it responds please take note of the distance between the base of the lens structure and the mouse pad. We need to catch up with this distance with some more plastic shaped like the shape of the base of the modified lens structure (With the whole in it).

Step 6: Preparing the Aluminium Casing

The sheet of aluminum should be
marked and cut ot basically as shown in the image but with actual dimensions according to your PCB size. We then need to fold the sheet of metal as shown.

Cover the open side with the plastic as indicated and apply some epoxy glue to bind the plastic to the aluminum case.

Your PCBs (Left and right ) should be able to slide into the case now. Desolder and remove all the us USB wires, pass it from outside into the case and solder them back onto to PCB. Then Insulate the PCBs with cello tape before sliding it into the aluminum case.

Finally attach the lens structure with the sensor as shown in the picture above.Now screw it to the aluminum case.That's it! We are done!

2 People Made This Project!


  • Trash to Treasure

    Trash to Treasure
  • Tape Contest

    Tape Contest
  • Arduino Contest 2019

    Arduino Contest 2019

11 Discussions


2 years ago

could you make an instuction video about this

Muhammed AnazP

3 years ago


Can we make this wirelessly.?


3 years ago

I have an idea... put a freely-moving ball in front of the sensor. Thisi should pick up any rolling around on the table and also feel more like a real pen.



4 years ago on Introduction

you did great.its inspiring for the people who like to modify something to their idea.

you made a pen from 2 $ mouse . if i want to buy a pen for writing on my pc its around 100$ minimum. i tried to do thisin 2012 but with my friend who had an electrical background told me its not possible. so i quit the idea. but about a month ago i had the urge to do it again so i opened a mouse and started brain storming and finnally did it just in 3 days , eventhough yours is better than mine.than i was searching for same on net and found yours.i was so happy. keep thinking awesome and keep inventing.


4 years ago

Hi Schorhr
If u want to interface a mouse with arduino then you can go for any PS/2 mouse.It wll work just fine with the arduino PS/2 library


4 years ago on Introduction


a slightly off-topic question:

What sensor is it, I can't quite read the numbers on the picture?

I was going to pick up this type of mouse from ebay to interface with arduino, but it would be nice to know what sensor they typically have :-)



4 years ago

Thank you JackANDJude and evoken.Nice idea!! The left click in the aluminum case will be very great.Thats a starting point for version 2.


4 years ago on Introduction

Brilliant idea and good execution, voted for your instructable! :) It would be even better with the left click microswitch sticking out of the aluminium case. Looking forward to the click version. Thanks for sharing and good luck in the contest! :)


4 years ago on Introduction

This looks like a great idea, and it is so well documented! I sent you a 3 month pro membership in a patch.