Head Mouse

Right Hand Loses Job As Head-Mouse Enters Mousing Arena

Moving the cursor around your computer screen is an everyday occurrence that we humans do not give much of a second thought to. But what if you didn’t have to move your hands from the keyboard anymore? Sure there are keyboards with Track Point or even track pads not to far from the keys, which isn’t too bad. What if you could just slightly point your face in the desired direction the mouse would move? The [Sci-Spot] folks wondered that same question and came up with a DIY Head Mouse.

The concept is pretty darn simple; a web cam is mounted to the user’s head and points at the computer screen. Mounted on top of the screen is one IR LED. Our eyes can not see the IR light so it is not annoying or distracting. The camera, however, is filtered to only see IR by placing a couple of layers of camera film negative over the lens. Before you go complaining about strapping a camera to your noggin just think of building it into a hat, which we’ve seen used for adaptive technologies like this PS3 controller.

Custom software was written to move the mouse cursor; see the black window in the above dialog box? That represents the webcam’s field of view and the white spot is the IR LED. When the user’s head moves, the IR LED moves in relation to the camera’s field of view, in turn telling the computer to move the cursor a certain amount. There are a couple of options available like ‘magnification’ which changes how much the cursor moves with a given amount of head movement and ‘deadzone’ that ignores extremely small movements that can result from breathing.

There is no mention of how button clicks are recorded but we think a couple of buttons right below the space bar would be great. The control software is available for download on the Sci-Spot page for those who want to make their own.

Walkman-esque Human Interface Device

Cheap keyboards never come with extra buttons, and for [Pengu MC] this was simply unacceptable. Rather than go out and buy a nice keyboard, a microcontroller was found in the parts drawer and put to work building this USB multimedia button human interface device that has the added bonus of looking like an old-school Walkman.

The functions that [Pengu MC] wants don’t require their own drivers. All of the buttons on this device are part of the USB standard for keyboards: reverse, forward, play/pause, and volume. This simplifies the software side quite a bit, but [Pengu MC] still wrote his own HID descriptors, tied all of the buttons to the microcontroller, and put it in a custom-printed enclosure.

If you’re looking to build your own similar device, the Arduino Leonardo, Micro, or Due have this functionality built in, since the USB controller is integrated on the chip with everything else. Some of the older Arduinos can be programmed to do the same thing as well! And, with any of these projects, you can emulate any keypress that is available, not just the multimedia buttons.

Serial USB For Any AVR Microcontroller

If you’re using an AVR microcontroller and you’d like to add USB to a project, there are a lot of options out there for you. Both LUFA and V-USB add some USB functionality to just about every AVR micro, but if you’d like a native serial port, your only options are to look towards the USB-compatible Atmel micros.

[Ray] looked at the options for adding a USB serial port and didn’t like what he saw; seemingly, this was an impossible task without a second, more capable microcontroller. Then he had an idea: if the goal is only to transfer data back and forth between a computer and a microcontroller, why not write an HID-class USB serial port?

[Ray] based his project on The V-USB library and created a new HID descriptor to transfer data between a micro and a computer. While it won’t work with a proper terminal such as Putty, [Ray] managed to whip up a serial monitor program in Processing that’s compatible with Windows, Linux and OS X.

In the video below, you can see [Ray] using an ATmega328p with a standard V-USB setup. He’s transferring analog values from a photoresistor as a proof of concept, but just about everything that would work with a normal serial port will work with [Ray]’s library.

Continue reading “Serial USB For Any AVR Microcontroller”

Building A Small Keypad For Strategy Games

A month ago [Andreas] started playing Starcraft 2 again. As he was not comfortable with the default hotkeys on a normal keyboard, [Andreas] decided to build his own.

He started by salvaging keys from an old keyboard he had lying around, then 3D printed the case you see in the picture above to fit them. The keyboard electrical design is a simple matrix and it appears that he etched the PCB himself. To provide the required USB connectivity, the Atmega8U2 was chosen. It comes with a pre-programmed USB bootloader that [Andreas] chose to activate when the left key is pressed at the system startup. The HID class was implemented using the LUFA-USB Framework and the final product is definitely good looking.

All the files required to duplicate his design can be found here. You can also checkout another starcraft keyboard and an ergonomic keyboard that we previously featured.

How To Use The Kenetis KL25Z Freedom Board As An HID Mouse

[Eric] is interested in turning this Freedom development board into an air mouse by using the onboard accelerometer. But he had to work through the particulars of the USB HID mouse class before he could get that done.

This Freescale FRDM-KL25Z is one of the awesome ARM boards we looked at a year ago. Can you believe you can get this thing for like thirteen bucks? We suppose the gotcha is that the CodeWarrior IDE meant for use with them is not entirely free. But there is a free trial, and [Eric] shows how much easier it is to tailor the USB stack for your needs with it.

Don’t worry though. If you’re like us and use Open Source For The Win he’s got you covered as well. When you’re done reading his HID mouse writeup head on over to his six-part tutorial for building a free toolchain for the Kenetis boards.

Drop-in Pcb Makes Nintendo Four Score A USB Joystick

The Nintendo Four Score was a controller attachment for the original Nintendo Entertainment System which allowed you to use four controllers at one time. [Simon Inns] wanted to use some original NES controllers on his computer so he developed a drop-in replacement board that converts the device to USB.

As we’ve seen with other NES controller hacks, the hardware uses a simple parallel to serial shift register to deliver key-presses to the console. This means that reading four controllers at a time is no different than shifting in data to a microcontroller from the four different sources. The remaining portion of the problem is providing a USB connection that enumerates the device as a joystick. We’ve seen a bunch of USB projects from [Simon] so it’s no surprise that he was able to pull it off.

He went with the ATmega16U2 which has built-in support for USB. [Simon] wrote the code so that although there is only one USB cable, each of the four controller ports will appear as a separate USB joystick on the computer. To button up the project he carefully measured the original board and laid out his own version so that it fits the footprint of all the original components as well as the mounting brackets on the case. Top notch [Simon]!

USB NeXT Keyboard

USB NeXT Keyboard

[Ladyada] and [pt] had an old keyboard from NeXT, but since it used a custom protocol it wasn’t usable with modern hardware. So they built a custom device to convert the NeXT protocol to USB.

The device uses a Arduino Micro to read data from the keyboard and communicate as a HID device over USB. It connects to the keyboard using the original mini-DIN connector, and is housed in the classic Altoids tin enclosure.

Since the protocol used by NeXT isn’t standard, they had to figure it out and write some code to interpret it. The keyboard communicates bidirectionally with the computer, so they needed to send the correct frames to key data back.

Fortunately, they hit on a Japanese keyboard enthusiast’s site, which had protocol specifications. They implemented this protocol on the Micro, and used the Keyboard library to create a HID device.

The final product is an adapter for NeXT to USB, which allows for the old keyboards to be used on any computer with USB. It’s a good way to bring back life to some otherwise unusable antique hardware.