XIM Community

Belkin N50 analogue & keyswitch mod  (Read 772 times)

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Belkin N50 analogue & keyswitch mod
« on: 06:24 AM - 02/02/21 »
Inspired by @tuffrabit's YouTube mod videos, I decided to try my hand at putting together an analogue-stick equipped keypad! Managed to get hold of a Belkin N50 with a non-functioning Dpad, so ideal for this purpose. I've seen any number of modded N52s, and the subsequent Razer versions, but not an N50, so I thought it might be worth documenting the process in case it's useful for anyone else!

For reference, I found the following instructable useful for disassembly info and to get an idea of what the internals look like: https://www.instructables.com/Belkin-Nostromo-N50-mod-left-handed/

I had originally planned on mounting the stick on the Dpad PCB, unfortunately there wasn't enough clearance, and there's no room to extend further into the body - the Dpad PCB is already flush with the base, if you can make it out from this shot:


The Dpad assembly is pretty easy to remove, looks like plenty of space inside:


It looks as though, if I dremel away some of the Dpad supports, I can wedge the stick in there against the backplate...


...yep, that fits a treat!


More to come later!
« Last Edit: 09:27 AM - 02/02/21 by Pistol451 »

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #1 on: 08:27 AM - 02/02/21 »
You'll note from the previous post that I've basically dremelled out the opening to be the same size as the circular gate on the analogue stick. It's not ideal, as there's basically nothing stopping dust and crap from getting into the innards of the stick; but, I can't really do much else at this point without coming up with a totally different mounting method. That's not impossible, but for now I may just accept that I'll likely have to change the stick every so often if it gets gummed up inside.

Here's what it looks like with a thumbstick on:


Most of the dust protection dome will have to be removed for it to actually rotate, so that won't help keep the guts clean. I did wonder about those weird "aim assist" rubber boots you can get but we'll see. Anyway, ergonomically it feels great so once it's all up and running I expect great things :D

The throttle wheel potentiometer does clash with the stick body, so that's had to come out; one of the wires was detached anyway, so I just snipped it off. I wasn't convinced that a throttle wheel would be much use on this device anyway, but I must admit once I got it in my hands, the position of it feels OK. I had considered putting some momentary switches in the hole vacated by the wheel, but I think that would look a bit shonky and they'd be hard to press in that location anyway. I ordered a 6mm shaft ALPS rotary encoder to replace the bulky pot, that will fit in place without clashing, and should be able to be wired up to the teensy as a scroll wheel; how PC games will deal with two scroll wheels I don't know, but anyway that's a nice to have for the future when I get the programming for it sorted out.

How much rewiring I do internally will be determined by whether I keep the N50 PCB in place or not. The main advantage of keeping it in play would be that it would minimise the amount of wiring I have to do (I am not skilled at soldering!), and I would be able to use the Belkin software for mapping the keys, including setting up shift states. The main advantage of ditching it would be that I can just have the Teensy LC doing everything and just one USB cable coming out of the thing, also the PC would just see one controller so it should minimise compatibility issues. So, I thought I'd assemble the device and see if the original PCB worked.

Connecting it to the PC seemed to go OK - the LEDs lit up briefly, it was recognized as a controller, and drivers seemed to get installed OK. Fired up notepad to see if the keys functioned as keys - nothing. So, I tried joy.cpl, which showed it as a 3 axis 10 button controller; but, in the test panel, nothing functioned. Bear in mind that right now the only thing connected to the PCB is the keypad, as the throttle and Dpad are cut away! So, now I have no idea whether the PCB is fritzed, or whether it's just the keypad membrane that is dodgy.

I wasn't planning on keeping the dead flesh rubber dome keypad anyway, so next on the agenda is fitting Cherry MX keyswitches (blues - I know, I know, but this is being done on a tight budget and they were cheap!!) and wiring them up in a matrix. I'm thinking that I should just copy the matrix from the existing membrane, so I can wire into the N50 PCB to test it again, without needing to add resistors and diodes (they're already built into the PCB). However, I'm struggling to trace all the lines on the membrane  ::) I might need a bit of help here!! I'll post some decent quality images of the membrane tonight, if anyone could help me trace it out and come up with the matrix wiring for the keyswitches, that'd be great.

If it turns out the PCB still doesn't work with the Cherries wired in, I'll have to bite the bullet and go full Teensy control - which is where I'll also need to figure out resistors and diodes. Again, any help gratefully appreciated  ;D

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #2 on: 10:40 AM - 02/03/21 »
Did some more testing and the N50 PCB appears to be fritzed. Can't get any button responses out of it, so it's out of the picture - going full Teensy LC. That means wiring up a keyswitch matrix with diodes - think I'm OK with that, we'll see anyway... have to cut the holes for the Cherry MX switches first anyway!

One thing I do need to figure out is the LEDs I'll be adding to the keyswitches. I know I need to add resistors to protect them, but what value?!? It seems unfathomably difficult to actually work it out... From what I've read, it is not a good idea to wire too many LEDs in series. As I will have pairs of red, yellow, green, blue, and purple LEDs (10 LEDs total) it seems wise to wire pairs of the same colour in parallel with the other colours, each pair with its own resistor. But what resistor values? The LEDs I've bought were quoted as 3V forward voltage, but I've read that different colours have different voltages - do I need to tailor the resistances to the LED colours to get consistent brightness? Am I just over-thinking this?!?

Offline antithesis

  • MVP
  • *
  • Posts: 11296
    • View Profile
    • Mod Squad
Re: Belkin N50 analogue & keyswitch mod
« Reply #3 on: 03:10 PM - 02/03/21 »
All that aim assist rings do is make the analog stick harder to move and create unpredictable input. I sold them as "stick drift removers" because they are terrible at their stated purpose. I recommend not using one in your project.

Official Australian distributor for XIM APEX, Titan One & Titan Two at Mod Squad
XIM APEX demos on Twitch and YouTube. Follow Twitter for live stream alerts

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #4 on: 05:29 AM - 02/05/21 »
All that aim assist rings do is make the analog stick harder to move and create unpredictable input. I sold them as "stick drift removers" because they are terrible at their stated purpose. I recommend not using one in your project.


I was thinking of the rubber boot type, cutting them up and just using the upper section, so it hopefully wouldn't affect the stick too much; but I don't think I'll bother, unless I find there is a problem.

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #5 on: 08:28 AM - 02/09/21 »
Progress! I've installed the Cherry keyswitches.



There's a bit of fettling still to do before I can wire everything up: one of the switches isn't quite straight, and a couple are too tight which is squeezing the body of the switch enough to make them stick a bit. It's going to be a bit tight in there with all the wiring for the keyboard matrix and the LEDs; hopefully my soldering won't be too messy  :-\


Keycaps wise, I had planned on re-using the original ones, to keep it looking as stock as possible; I then thought it would be easier just to use some cheap Cherry-compatible ones to save time and effort, however I was shocked at the price of keycaps! So decided to press on with recycling the existing ones. I was inspired by this mod which inserted the posts off salvaged keycaps into the original ones from an N52: https://www.youtube.com/watch?v=YGwiPFXg_e4 Since I don't have any salvaged keycaps, but I do know someone with a 3D printer, I designed some adapters to fit into the N50's keycaps once I'd cut their posts off level with the bottom of the key.



Have to wait until I get a test one printed to see if it works OK.


I did also come up against an issue with the Teensy, which I thought might be worth documenting here, since it wasn't something I had come across in my research beforehand. I had to invert my X and Y axes in the code (thanks for the assistance @tuffrabit!), and after I reflashed the Teensy, it stopped showing up as a controller in joy.cpl!!



Turns out, this is a known issue with Windows - due to some crummy way it manages HID interfaces, it will sometimes just mess up and assign the wrong drivers or something to a previously working Teensy! It can be fixed either by deleting the registry entries associated with the device, or changing the serial number of the Teensy in the sketch. Either way, Windows will then detect it as a new device again and it will work once more. This discussion topic details the method - also confirmed by tuffrabit via email! https://forum.pjrc.com/threads/23566-Teensyduino-USB-Joystick-no-data-driver-problem-workaround

I haven't done that yet, as the PC I'm using to program the Teensy isn't actually the one I need it to work with, so as long as I can continue to flash it there's no real issue for now. Connecting it up to another PC shows it is still working just fine!

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #6 on: 08:47 AM - 02/17/21 »
Bit more progress since the last post. I've now wired up my keyboard rows and columns!



Haven't wired them up to the teensy just yet, and the LEDs are giving me some cause for concern - there's not a lot of space left, so wiring them all up is going to be tricky. I've left that for another day for now!

Another issue I found was that the keyswitch in the top right of the pic clashes slightly with the curved section of the base; not by a lot, but enough to put pressure on it if you try to close the case up tight. There are tiny bumps on each corner of the keyswitches, so I cut that off, and filed it down a tiny bit; that was enough to alleviate the pressure.

When wiring up the keyboard matrix, solid core wire really helps! You can form a little loop in the wire and pop it over the pins, makes soldering them a doddle. Same goes for the diode legs. I had forgotten how hard it is to solder more than two things together, if you're working with stranded wire, twist them together prior to soldering. I used this method to daisy chain as many ground connections together as possible to save on excess wiring.

I've also dry-fitted the encoder wheel, not soldered it yet but with a few modifications it's a good fit, and saves so much space inside!



To make it fit, I had to dremel a small recess in the wheel, and file a bit off the end of the encoder shaft, and a little off the shoulder:


Also needed to shorten the vertical plate on the base that it sits on by a bit. Take this easy, a bit at a time, as you can always take more off but you can't put it back on if you go too far!!



I also decided that the N50 just doesn't have enough keys, so I added a few long shaft tactile switches near the joystick module for some extra buttons:



I think they're a bit too long, but I haven't shortened them yet as I want to see what they're like in use (again, easy to shorten, impossible to lengthen). There's also another button and a status LED in front of the scroll wheel but I haven't wired those up or photographed them yet.

Still a way to go yet, I need to finish connecting everything up and test it all works before I hot glue all the components in place. I think I've figured out the encoder wheel code, so getting that wired up will be a big step forward!

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #7 on: 07:25 AM - 03/04/21 »
Haven't posted an update for a while as I've been a bit busy, but this is now basically complete, so thought I'd better put some words down!


First off, the keycap adapters were a failure. My friend's 3D printer just didn't have the precision to print something that small. Bit disappointing, but I realised that rather than try to find a few keycaps for a sensible price, I could just buy an entire set of cheap ones  ::) so I did that!


I got the LEDs wired up; haven't got any photos of that, which to be frank is something of a mercy as it's a right bodge job  :-[ still, it works, which is the main thing!! I have them connected up to the Teensy's Vin pin, so they're getting the full 5V straight from the USB input; I used 120 ohm 1/8 W resistors to protect them (only fried one when I somehow managed to connect a resistor leg without the actual resistor!). The drawback of doing it this way is that the LEDs are always on whenever the pad is plugged in - even when the PC's not on. So I have to unplug it after use, unless I want a rainbow nightlight all the time  ;D


The encoder works, thanks to the code I got from this page: https://www.best-microcontroller-projects.com/rotary-encoder.html

Tuff taught me how to change the serial number of the Teensy in name.c to get it recognized by Windows again, the info is here: https://medium.com/@j0hnm4r5/changing-teensy-serial-name-and-port-name-2ca76552d26d (it's only the SERIAL_NUMBER bit you have to update).

I also had some major issues with my keypad. I was sure I'd wired it up correctly, but it just wouldn't work. @TuFFrabit to the rescue again, he gave me some code that scanned the matrix and the output showed that I'd managed to wire the rows as columns, and columns as rows!!  :-[ So once that was factored in to the keymap array, it all worked! I would NEVER have gotten to the bottom of that without TuFF's help, I can't overstate how important his assistance has been in getting this mod built, so if you read this TuFFrabit, thanks again man!  ;D


I keep forgetting to take pics of the bloomin' thing, for now this is the best I have - so, ladeez and gennelmun, I give you... the Nostromo N50+!




First impressions in use are that this whole keypad thing is AMAZING. I use this as a controller for Fortnite; aiming with the mouse is spectacular, I get what all the fuss is about regarding KBM being the best way to play. I have some way to go yet - there are still plenty of things I can pull off better on a controller - but I can tell it's mainly just re-training my tired old man's brain  :P With movement under my thumb, I'll get the hang of the rest in time.


There are a few things I'd do differently next time - and yes, there's going to be a next time... I managed to pick up another N50, this one fully working!

For starters, I discovered late that games like Fortnite only support Xinput controllers; and by default, the Teensy joystick implementation is DirectInput. So, it doesn't work as an analog stick in Fortnite. It does work in digital mode, so I still have 8-way movement under my thumb, and that's good enough for now. You can program the TeensyLC to be an Xinput device; but, it emulates an Xbox 360 controller in that mode, and cannot also be a keyboard. That means you're limited to the number of buttons a 360 pad has - 10 (plus the guide button, but that's not much use in a game). For the N50, that's not a massive disadvantage - it doesn't have all that many more buttons than that anyway (my N50+ has 16 available). But it would be a major compromise for anything else, like the N52's or the Razer keypads.

So, my plan is to get the Xinput code working with this one, and then to dual-mod the next one. I'll install an analog stick, and an encoder, and the Teensy will handle that in Xinput mode; but the N50's own PCB will remain in place to handle  everything else. That will have the advantage that I can use the Belkin software to map all the buttons, and have the full range of KBM functionality but with analog movement!

I have also found that the 24-detent encoder I fitted to the Mark I device is a little too... skittish I guess you could say. I currently have it set up to cycle through my inventory slots, but I've found it's way too easy to skip too far - if you just want the next slot, all too often you scroll two detents by mistake, as they're so close together. I could fix this in code, either by requiring two detents before it sends a keypress, or introducing a timing function so it will only send a keypress every so many milliseconds. Either would work, but I think they would feel a bit kludgy. So for Mark II I'm going to try a 12-detent encoder, hopefully having to turn the wheel a bit more between detents will help avoid over-scrolling.

I'm also undecided as to whether I'm going to replace the keypad with keyswitches. I'd like to, it's just quite a bit of work, with all the cutting required, and lots of soldering. Plus I'd have to decipher the matrix, and connect it to the N50 PCB, and I'd be worried I'd mess something up... I could use TuFFrabit's matrix scanning code to help, if I temporarily connect the N50's points to the Teensy I guess. And If I do it, I can add diodes to prevent ghosting (the N50 suffers from this out the box). Plus, I did get some cheap Gateron keyswitches already... I'm probably going to do it, aren't I  ::)

Assuming I do fit keyswitches, I might not add LEDs. That was definitely the hardest soldering job, and I didn't do it well. But then again... I have been looking at RGB LEDs... I must be a glutton for punishment  ???
« Last Edit: 07:41 AM - 03/15/21 by Pistol451 »

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #8 on: 07:46 AM - 03/15/21 »
Just an update - I got XInput working, analogue control with mouse aim is fantastic! The keyboard mode on the thumbstick was good, but this is much smoother. It does mean I'm limited in terms of keys, but to be honest I'm used to using an Xbox controller anyway, so I don't think it'll be a big issue to me (I actually prefer the way some things work with controller buttons in any case).


For the Mark II, I've decided to use a tiny USB hub inside the body of the pad rather than have two cables; I'll have to be a lot more efficient with my wiring this time, as I'll have the original PCB, the Teensy LC, and the USB hub PCB all to fit in there!! There should be less wires to the Teensy this time around though, so hopefully I can squeeze it all in.

Offline Pistol451

  • Member
  • *
  • Posts: 12
    • View Profile
  • Gamertag: Pistol451
Re: Belkin N50 analogue & keyswitch mod
« Reply #9 on: 10:24 AM - 03/16/21 »
I meant to post an image of my rat's nest of wiring - don't have nightmares folks...



There's a program button in there, below right of the encoder wheel - necessary for reprogramming in XInput mode, without having to open the thing up to press the button on the Teensy itself every time you want to change the code! I'm quietly pleased with the location, with the palmrest in place it is completely hidden and inaccessible, so can't be pressed accidentally.


For the Mark II, I've had a go at deciphering the N50's standard key matrix, but I'm still confused by it. It doesn't look as though it's organised into rows and columns to me, unless I'm missing something! I can always just copy the wiring as it is, but I wanted to add diodes to prevent ghosting, and I'm not sure where to put them if it's not a standard layout. Some trial and error before final assembly may be required...



Admin