Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Project - Building a 3-button keyboard emulator with Arduino/similar - Tips please

  • 17-10-2013 10:28am
    #1
    Registered Users, Registered Users 2 Posts: 841 ✭✭✭


    Hi All,

    I'm looking to make a simple USB keyboard emulator device with the following properties:
    • I need to connect 3 switches/keys which act like normal keyboard keys (simple press & release events and press-repeating)
    • The device needs to be plug-&-play on Windows XP, Vista, 7 & 8 (like any normal keyboard/HID)
    • I need to be able to pre-program these 3 switches' key codes onto the device so that a user can just plug it in and emulate these key presses (e.g. switch1='space', switch2='enter') - i.e. No software installation or key-programming required by the user.
    • USB connection (of course!)
    • As cheap as possible!
    • As small as possible (the main board that is) - Although cost is a more important consideration than size.

    I've already done all of the above successfully using iPac and mini-pac boards but those boards cost me €30-40 each which seems like far too much for such a relatively simple application.

    I've also purchased an Arduino Uno board but some reading online tells me that it will not really do all of the above.

    Can anybody give me some tips on this please? Recommend a suitable & cheap board and a good place to buy it.. I'm not really concerned about the other hardware for the moment (switches, case, etc) - just the main board. Is there an existing USB device I can buy for this (that's affordable)?

    Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    For anyone who's interested, I want to give some more background on why I'm asking this...

    [Sorry it's such a long story - brevity is not one of my strong points!]

    I'm currently working on computer-access software for people with physical disabilities. It's Windows-based. The main component of this software is an on-screen keyboard but there are lots of other features to make getting around the computer as easy and efficient as possible (e.g. mouse emulation).

    The whole application can be controlled using just a single button/switch which can take many forms depending on the abilities of the person using it. Using that very limited input, the user will be able to do everything that can be done with a full keyboard and mouse. If he/she has the capabilities, additional switches can be added to improve efficiency.

    There are USB switch adapters available already but they cost a fortune (for what they are!). Here are some examples. When you add tax, convert to Euros and pay exorbitant shipping fees, you're looking at about €80 for the most basic model (for something that does nothing more complicated than a €5 mouse/keyboard). On top of that, the 3 or 4 that I've tested don't even work all that well - For some reason, they don't send proper press & release signals at the right times - They send press AND release signals at the SAME time - as soon as you press the button (without releasing it if you know what I mean).

    Anyway, I am looking to provide a good software application and some of the hardware required to use it for a fraction of the normal cost - And I'm nearly there!

    Finally, before people think I'm just here trying to get people to do this work for me so that I can make millions out of it, I assure you, I'm not! I will be very happy if I can make a modest living and improve other peoples' lives. I have a family member with a severe disability - That's a big part of the reason I started working on all of this.


  • Registered Users, Registered Users 2 Posts: 7,035 ✭✭✭zg3409


    Google gave me this:
    http://mitchtech.net/arduino-usb-hid-keyboard/
    It may require a different arduino to the model you have and possibly some soldering. There is a comment that mentions long key presses are not possible with the standard code.

    Regarding costs there are lower cost basic boards
    http://arduino.cc/en/Main/ArduinoBoardNano
    (Note this may not be compatable with the model above)

    If going to medium to large scale, you could possibly make a compatable board for less just using the same chips, and getting it made yourself. There are also Arduino compatable knock off's from china, some that claim to be genuine and othes that are compatable but admit that. These are usually lower cost, but sometimes compomise on quality or features.

    One of the issues you my have, is customising which button does which key. Would this be done by the user themselves, before it is shipped customised to each user, or have some sort of switch or button to change to common modes. This could be done uing the existing buttons and a mode option, where they possibly enter the Ascii code for the key they need with some sort of LED or on screen feedback.

    For example within 10 seconds of powerup, if all 3 buttons are pressed together, then it would type on screen, using standard typing, "Entering config mode", then using the 3 buttons you go up or down through options, and each time it types what it is doing as a keystroke.

    In this way the user could change modes, options, what buttons do, without needing a seperate screen, nor special drivers on the computer itself.

    One of TOGs members worked with screen readers in the past so he might be more up to date with the needs of users. He can also program arduino.

    I could assist on the electronics/arduino board selection once a working prototype is found.


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Hi zg3409,

    Thanks very much for that.

    I'll have a go at that HID keyboard tutorial over the weekend and report back here with my progress (or lack of!).

    Regarding customising the buttons, I will most likely be providing the unit pre-programmed with 3 fixed key codes (F3, F6 and F9). There is no need to set up modes to switch to other key codes.

    I hope to supply a unit similar to this (complete with small case, USB cable, 3 x 3.5mm mono sockets - these are the standard switch connections used in the disability sector). I don't want the user to have to do anything more complicated than plug in his/her switch(es) and plug the device into a USB port.

    Talk to you soon.
    Cheers,
    Brian


  • Registered Users, Registered Users 2 Posts: 7,035 ✭✭✭zg3409


    Before you start make sure the board you have is compatable. It may need an extra resistor added.


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Thanks. The board I have is called the Uno R3. I just looked up my email and the description of the board I bought from dealextreme was "Arduino Compatible UNO Rev3 Development Board" (the page is now a 404). I'm guessing the word 'compatible' there means that it's a knock-off? It does appear to have the arduino logo, website address, etc printed on the board so I assumed it was the real thing..?? The bottom of the board is white with navy text logos (the inverse of most of the ones I see on the Arduino website).

    Anyway, it doesn't look like mine's an 'SMD' so I will probably need to attach a resistor as per instructions. I might be able to pick one up tomorrow.. My soldering skills leave a lot to be desired unfortunately!

    Arg! I just checked and my board doesn't appear to have contacts/pins where the resistor is soldered in this picture. I'm starting to think that maybe I should just buy a board that's a closer fit to what I'm trying to do than hack one that isn't. I'll take a look at the Nano you linked to and see if that can be set up as a HID. Anybody got any other board recommendations?

    Cheers,
    Brian


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Any bricks & mortar shops around Dublin that sell Arduinos?


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Ah ha, found this and this!


  • Registered Users, Registered Users 2 Posts: 7,035 ✭✭✭zg3409


    I will be in TOG tomorrow/today Saturday from possibly 6pm until late. There is a social night on. We have soldering irons and resistors. Dealxtreme is really cheap so possibly not genuine.

    If you are around the city Saturday night we might be able to help. Maplin, Farnell and Radionics are options. Mapin is open Sat but you would want to ring them first to check stock.


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Hi again,

    Thanks very much for that offer. Unfortunately, I can't make it in this evening because I'm going to a friend's birthday. I'd love to drop in some other time - Monday nights seem to be the best bet.

    I've been looking at this stuff again all day and I've changed direction somewhat. I took a notion to take apart an old keyboard (not expecting much) but I found that it contains a small board that could be perfect for my purposes. I can get similar keyboard for €5-6 each so it looks promising. I've already been able to emulate lots of key presses just by shorting 2 pins on the board (and I haven't destroyed my PC - bonus!). I can't seem to emulate all keyboard keys using 2 pin combinations so there must be a bit more to it. I only need F3, F6 and F9 but I've only gotten F3 so far and I've tried pretty much all combinations. If anybody has any suggestions for this, let me know.

    Enjoy the night!

    Cheers,
    Brian


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Hello,

    Well, it's official, I am an idiot! The pin numbers I was using were the wrong way around because... ahem... cough... the board was upside down when I was tracing the circuit back to the 3 keys I wanted :o I've got all 3 keys (F3,F6,F9) working now by shorting the pins shown in the attached image :D

    My problem now is trying to attach 3 switches to these pins. I had a quick try at soldering a wire to one of the contacts and all I achieved was to liquefy the plastic of the PCB underneath. The contacts seems to be made of a dark grey material that looks a bit like the 'lead' in a pencil.

    Has anybody tried this wire glue?
    Would super glue do the job? - Not conductive I know but it might hold a wire on the contact.

    An even better solution would be to find a similar board with pins instead of contacts like this. I can't find anything online about how/where to buy a board like this (even though it must be one of the most abundant PCBs in the world!). Does anybody know where to buy such things? Perhaps some keyboards have a different type of contact that would be more suitable for connecting to?? I've taken apart a Microsoft keyboard here which seems to have practically the same architecture.

    Would there be somebody in TOG this evening that could help me put this unit together? I have a suitably sized case, 3.5mm mono sockets, wires, etc. I can have most of it ready beforehand but there are a few aspects that I could do with some help with (like the above and also mounting the board inside the case - without drilling holes). I've attached a picture of my current working prototype built using an Ultimarc mini-pac.

    The next big task in all of this is to look at certification & other legal issues. Am I allowed to take a board out of a keyboard, put it in something else and sell it as a new device? Roughly what cost/process is involved in getting an electronic device certified for use in Ireland/UK? I will of course need to do a lot of research on this, and most likely hire somebody but if anybody has any experience with this, please advise.

    Thanks very much,
    Brian


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 7,035 ✭✭✭zg3409


    Dr Pepper wrote: »
    The contacts seems to be made of a dark grey material that looks a bit like the 'lead' in a pencil.

    The dark green parts of the board should be copper tracks covered in protective green varnish. You should be able to scrape the green parts off (try on tracks you do not need) and then you should get clean brownish copper. You could use a stanley knife or similar and just scratch off the enamel covering.

    If that does not work you could look at using a connector. Those connections look like possibly 0.1" pitch, so there may be off the shelf computer like ISA or PCI connectors that have the same pitch.

    If attaching long cables you may pickup noise, as the circuit is probably not designed for long cables. There are ways to try minimise it, but it means more components.

    I am not sure on the regulations but it is normally "CE" compliance you are looking for.


  • Registered Users, Registered Users 2 Posts: 841 ✭✭✭Dr Pepper


    Thanks for those tips.

    Great news - I found a couple of devices that do exactly what I'm looking for. This is a 14-switch keyboard emulator board (comes with all required connectors and cables) - much cheaper and simpler than Arduino (if keyboard/mouse emulation is all you need). This is even better for my needs. It means that I no longer need a box/case at all. I can attach mono 3.5mm connectors straight onto the cable. It comes with CE certification so there may not be much involved in getting certification for the simple modifications I will be making.

    Thanks again for all the advice.


Advertisement