Shop OBEX P1 Docs P2 Docs Learn Events
Custom USB Human Interface Device — Parallax Forums

Custom USB Human Interface Device

Duane DegnDuane Degn Posts: 10,588
edited 2014-09-21 09:09 in Robotics
I've been considering making some sort of custom HID for a while. I was mainly thinking about making some sort of a mouse but it may be advantageous to include some common keyboard actions into the custom device.

I plan to use this thread to track my progress and to keep links to similar projects.

This first post will mainly be a table of contents to the rest of the thread.

#1 Table of Contents
#2 Latest state of the project
#3 More information (code etc) on project.
#4 Videos of device
#5 Another reserved post
#6 List of links to HID related material
#7+ Discussion about project

Please wait until I've made 7 posts before replying.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:10
    Reserved 2 of 7.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:10
    Reserved 3 of 7.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:10
    Reserved 4 of 7.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:11
    Reserved 5 of 7.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:11
    Links to HID related webpages.

    BradC's "California Dreaming" demo. I believe the latest code is attached to post #108.

    Discussion about USB HID in General Discussion forum.

    Post about using a webcam as a mouse. (Also mentioned by NWCCTV in my index thread.)

    DIY Sip n Puff mouse article at SparkFun. This project used a Teensy 2.0.

    AdaFruit's Trinket with bit banged USB 1.1.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:12
    Yesterday a new forum member asked about making a custom HID. The question was asked in my index but I though the topic desired a thread for discussion. Here's jayschoffstall's post:
    MOUSE AND KEYBOARD EMULATION


    duane, you seem like you know your stuff. i am in need of some assistance maybe you can help or point me in the right direction. i work for a tv station making commercials and i am always doing something on a computer. i have carpal tunnel and i believe arthritis is setting in on most of my fingers. i have been trying to mod mice, keyboards, gamepads, and old video editing control panels for some time now with varying levels of success. nothing has turned out like i wanted so i decided to get into the micro controller scene which is something i have always wanted to do anyway. i started with two trinkets from adafruit but they would never connect to my pc, the software would not install. a few days ago in radioshack i purchased two propeller p8x32a quickstart boards, two five position switches, and a few spdt-submini lever switches. i have also been disassembling any human interface device and collecting every button i could find for a year now. i am trying to emulate a mouse and keyboard so i can program hot keys for various applications. i would like to use the 8 touch buttons and the items listed but i have no idea where to start and i cannot find a tutorial that fits my needs please help.

    As I mentioned in my reply, my wife has carpal tunnel syndrome and I've been thinking about ways of making a custom mouse.

    I had originally intended to post a reply in this thread but decided I wanted to start a new thread to document my efforts.

    My first step in this project will be to list the various sites where information on this topic may be found. This list will be made in post #6.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 07:56
    After making the list of links in post #6, I think AdaFruit's Trinket may be the fastest way of making a custom HID. One thing I don't like about the Trinket is the lack of I/O pins. Some other Arduino capable of using the V-USB library may be a better option.

    It would be really nice if we could get the functionality of the V-USB library to run in a single cog on the Propeller and then the other cogs could be used to monitor sensors. I haven't looked closely at either the code for V-USB or BradC's USB code. BradC may have already done most of the work.

    If attempting to make a HID with an Arduino, I think the Arduino needs to be a 5V version so the clock speed is fast enough to generate the USB signals.
  • jayschoffstalljayschoffstall Posts: 2
    edited 2014-09-18 09:01
    i believe they have a pro version that has more I/O pins. i can't get the drivers to load on windows 8.1
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2014-09-18 09:26
    Duane Degn wrote: »

    As I mentioned in my reply, my wife has carpal tunnel syndrome and I've been thinking about ways of making a custom mouse.

    I used to have problems with my wrist when using the computer but I have used the Evoluent Vertical Mouse for many years - it took care of my wrist problems.

    http://www.evoluent.com/
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 09:38
    I used to have problems with my wrist when using the computer but I have used the Evoluent Vertical Mouse for many years - it took care of my wrist problems.

    http://www.evoluent.com/

    Thanks Ron. I'll probably have my wife try one.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-18 09:40
    i believe they have a pro version that has more I/O pins. i can't get the drivers to load on windows 8.1

    As I read more about the Trinket I see there's nothing special about it in particular other than it's low price. I think a board with a more powerful controller and more I/O pins would be a better match for this application.

    I thought the V-USB library didn't require one to load a driver onto the PC?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-09-19 18:13
    Duane, I'm really hoping for a Prop-based 3D mouse. We talked about it in another thread -- the need for a tilt-compensated 3-axis accelerometer, for instance. I'm not sure if Windows recognizes it as a superset of a standard mouse, or if the USB must be completely custom. I'm surprised there aren't more 3D mice projects out there, now with everyone using 3D modeling tools for their 3D printers. About the cheapest commercially made 3D mouse is about $100, with several in the $300-500 range. Yikes!
  • ercoerco Posts: 20,255
    edited 2014-09-19 19:31
    Another great and noble project, Duano. I haven't messed with HIDs, but I did get this $5 wireless PC remote, which has keyboard and mouse functions. Works well, you might be able to hack the remote for some cheap starter experiments.

    http://forums.parallax.com/showthread.php/152956-PC-IR-Remote-Best-5-Gadget-of-2014
  • kwinnkwinn Posts: 8,697
    edited 2014-09-20 20:57
    Duane Degn wrote: »
    I've been considering making some sort of custom HID for a while. I was mainly thinking about making some sort of a mouse but it may be advantageous to include some common keyboard actions into the custom device.

    I plan to use this thread to track my progress and to keep links to similar projects.

    This first post will mainly be a table of contents to the rest of the thread.

    #1 Table of Contents
    #2 Latest state of the project
    #3 More information (code etc) on project.
    #4 Videos of device
    #5 Another reserved post
    #6 List of links to HID related material
    #7+ Discussion about project

    Please wait until I've made 7 posts before replying.

    At one point I looked into the possibility of making a mouse/keyboard combination by having four push buttons for the fingers and a four position switch for the thumb on top of a standard mouse x/y position sensor. I built a simple prototype that permitted sending up to 64 codes in addition to the mouse position data to my protoboard. Not quite enough to send all the key codes a standard keyboard can produce, but two such devices could do that and more. I can provide a bit more info if you are interested.
  • abecedarianabecedarian Posts: 312
    edited 2014-09-21 07:52
    May I suggest something built with or around this MSP430F5529 board or it's MCU?
    At $13, it's roughly twice the price of the "Trinket", but runs up to 25MHz, 128KB Flash, 8KB RAM, 12 bit 16 channel ADC, 4 16 bit timers, USB MAC and PHY built in. Out of box firmware emulates a small file system and HID keyboard.

    ... or maybe the similarly priced TM4C123G: ARM M4F @ 80 MHz, 256K FLASH/ 32KB RAM, supports USB HOST/DEVICE/OTG.


    Either could serve as a bridge between a Prop and a PC, and provide some data acquisition and pre-processing capabilities, and with some creative trickery emulate the serial communications and EEPROM the Prop needs for programming and program storage space.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-09-21 09:09
    Thanks for the ideas everyone. I should point out this is kind of a "back burner" project right now. I do plan to purchase a Vertical Mouse (thanks Ron) and see how that works.

    @Gordon, I am interested in the 3D mouse Idea. As we've discussed a bit before, I think a combination of IMU and magnetometer would work. Hopefully I can make enough sense of BradC's USB Toys to adapt it for the project.

    @Kwinn, You input device sounds like an uber cording keyboard. I've often wondered if something similar would allow one to make a very portable keyboard.

    @abecedarian, I agree something more powerful than the "Trinket" would be a good idea. I'm pretty sure I have a TI Tiva board. I may try using it if I can't get this to work in the Prop by itself.

    @erco, Those IR keyboard/pads are interesting. I'll probably get a couple to hack (curse you).

    I started the project thread a bit prematurely. I'm not ready to work on this project much just now but I wanted a place to put some of the information I had found. I thought listing these resources in a project thread made more sense than replying in test forum index thread.

    If there are prospects for fame and fortune by completing this project soon, I'll move this project to a front burner. For now I need to get my robot ready for Halloween. I'll save the world later.
Sign In or Register to comment.