Control Your Computer Using a Laser or IR Pen.





Introduction: Control Your Computer Using a Laser or IR Pen.

This is a different way to control your computer using a laser. Unlike [!/ icinnamon's] way, this uses a webcam and a laser to control the cursor on your computer. You can even click by simply turning the laser off for a split second.

~Robert Collier

Step 1: Download the Software and Get a Laser or IR Pen.

First you must download Microsoft Visual C#. After you have Microsoft Visual C# downloaded, download Laser Interaction. The file name will probably be really weird, so rename it Laser Interaction. Now you will need a laser or IR pen to use it. The first picture is a schematic I made of a simple IR pen you can make. I am using a 100 ohm resistor because I am using 5 volts from a USB cable. You need to have a momentary pushbutton switch on it. I used a normally opened switch so when I press the button, it will click. I also bought a cheap $5 dollar laser from radioshack. I'm sure you can find one cheaper, but I love radioshack stuff.

Step 2: Deciding What to Use and How.

You can use either an IR pen or laser, but they require different setups of the webcam. If you are using a laser, you must put your webcam somewhere so it is pointed at the wall. If you are using an IR pen, your webcam has to be pointing towards you when you use it. If you use an IR pen, you also have to go into the webcam settings and make it so the image is mirrored horizontally. I am using a logitec quickcam for this project, but you can use others as well.

Step 3: Running and Ajusting the Program.

First, open the Laser Interaction folder and there is an icon named motion that opens Microsoft Visual C#. After it opens, click the run button. After that, a window will pop up. Click file and then click open local device. This will pull up a list with the name of your camera. Click ok and it will show the image on the box. Them, you will have to adjust the brightness threshold until the only thing the software "sees" is the IR pen or laser. You will know when you have achieved the right threshold when the program only puts a circle around the IR pen light or laser dot. Try to make the threshold as low as possible though for optimum performance.

Step 4: Final Adjustment

After you adjust everything, go into control panel, and folder options, and make it so you can open things with only one click, because the program only currently clicks once. After that, check the boxes control cursor and enable click. Now, your laser or IR pen will control the cursor and click. Just make sure if you are using a laser, the webcam is pointing at the wall and for an IR pen, you have it pointing towards you and the image mirrored. Move the IR pen around away from the screen and the cursor will move. Move the laser around on the wall where the camera can see it and the cursor will move around.Now there is no need for a mouse. Please vote for me, as I put a lot of work into this instructable. It's not as accurate as others like the ones using wiimotes, but it works.



    • Planter Challenge

      Planter Challenge
    • Clocks Contest

      Clocks Contest
    • Make it Move Contest

      Make it Move Contest

    We have a be nice policy.
    Please be positive and constructive.





    my IR pen doesnt show up on the mini screen

    please help me

    Hmm, I got really exited about this project, it's really cool, but the motion gave an error when I tried to install it. Any idea?

    I downloaded the file but could not get it to work. Could you upload a standalone application. eg an .exe

    cant you just upload the compiled application?

    cant you just upload the binnary file?

    how do you make the program more effecint

    this is a amazing project but i wanted to know if you can rewrite the program to track the ir led / laser faster

    will this mess up my laptop screen?

    This is interesting. So how good would you say it works on a scale of 1-20?

    after a long hour or so of downloading in the last minute it just says that the program needs to close and then it undoes EVERYTHING I tried it 5 times and it just does that as if it is supposed to do it! what gives!?

    Could your project work on full screen games?

    Are you using win95/98/2000? or just using the "windows classic theme?

    1 reply

    I was just using the classic theme. It's XP

    You're the best... Really

    Fascinating! I have a question, though. I teach with an interactive whiteboard. Normal interface is by touch or with a wireless mouse. The wireless mouse only lets me work 4 or 5 metres from the board (because of where the PC is fixed). Could your project work on the whiteboard? That is, would the programme be able to tell laser-dot from the generally bright background? If so, you would have a lot of interested users in schools, as well as speakers doing talks with slides and presentations.

    4 replies

    I believe the way simple laser tracking works is finding the brightest pixel in the camera's field of vision. If the projection is relatively uniform with a light-coloured background, then the laser should stand out as the brightest point, but if much of the projection is dark with a small bright blob the software may get confused. One of my computer science contemporaries did a dissertation on exactly what you intend to do (controlling a computer via a laser pointer on the projection screen) and I think his verdict was "buy a bright laser pointer" :) although his program did calibrate to the projection so may have done some clever trickery with subtracting the projected image from what the camera can see, or something like that. Perhaps I should email and ask for a copy of his dissertation? :P

    Like I said.............please read the instructable if you haven't. Don't just read the comments. I have stated it wouldn't be as accurate, but thanks for shooting me down anyways.

    I'm sorry... I didn't mean to shoot you down, but in hindsight, I suppose it did sound a bit like that. My main point was that other people have gotten it to work with the wiimote, and until you figure it out, I thought those would help. Sorry. P.S. -- I do like the instructable a lot...