geekhack

geekhack Projects => Making Stuff Together! => Topic started by: Blitzschnitzel on Thu, 09 May 2019, 06:17:44

Title: I call It the Mothership
Post by: Blitzschnitzel on Thu, 09 May 2019, 06:17:44
[attachimg=1]

[attachimg=2]

[attachimg=3]

Since my main project is becoming more and more complicated, I’ve worked the last two days on a side project to test some things out and learn more about PCB design.
I am currently typing on a xd75 with a three row numpad in the middle but I would like to have a full numpad. I quiet like having the extra space between my hands and I like hitting return with my right thumb. The trend to eve smaller Keyboards is not for me and I need extra space for my ÜÄÖs anyways. :D

Apart from the 18 by 5 key matrix one important feature will be an optical rotary encoder. I don’t like the sliding contact style encoders normally used in keyboards. They feel scratchy and don’t have a long lifespan. I think it is going to be this one:
https://www.mouser.de/ProductDetail/Bourns/EM14R1D-M20-L032S?qs=CrTVAl0CcnKeGe%252Br8S9yNQ==
[attach=4]

The back lighting of the fn keys to the left is independent from the other keys so that they can be used as layer indicators.

The steel plates are rimless and the spacers connecting the plates run through mounting holes in the PCB. This should minimize flex.

Right now, I am almost done with the PCB design but I still have to figure out how to make the HWB pin on the 32U4 usable. I don’t want to use a 4 times more expensive chip just because I am short one pin. :D
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Sat, 10 August 2019, 13:32:05
I am quite proud of the trace routing. :D The key matrix is actually square to save pins. So, I had to layout carefully.
[attachimg=1]
Title: Re: I call It the Mothership
Post by: ErgoMacros on Sat, 10 August 2019, 15:26:20
Hi,
I found this statement re: using the HWB pin, here. It may help:
  https://www.eevblog.com/forum/microcontrollers/atmega32u4-bootloaders-hwb-pin-usb-programming/

Quote
... it's usually best to leave this pin with just a pull up resistor so you can make use of it later. I tend to try to dual use the pin by connecting a front panel push button to it. This way if the button is held down during power up the bootloader runs, otherwise it's just a regular push button during normal operation

So, just use HWB as the encoder push switch?

PS: I'm no expert at this.
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Mon, 12 August 2019, 17:40:36
THX for the help!  ;)
The switch in the encoder is already part of the key matrix, so I can't save a pin there.
Right now this is my solution:
[attach=1]

What I am not sure about is if having a single pull up resistor on row 2 messes things up. But I think I need it to not accidentally get into bootloader mode. Would I need to put a pull up resistor on all key rows now? Or would I have to configure something differently in QMK?
Title: Re: I call It the Mothership
Post by: ErgoMacros on Wed, 14 August 2019, 00:28:09
Looks (to me) like what you have should work. Remembering, I'm no EE.

You could also throw some $0.35 shift registers at the problem:
   https://www.mouser.com/Semiconductors/Logic-ICs/Counter-Shift-Registers/_/N-55d4h?Keyword=hc164&FS=True&Ns=Pricing|0

I think QMK supports this mode.

Description here:
   http://www.openmusiclabs.com/learning/digital/input-scanning-matrix/shift-out-mux/index.html
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Wed, 14 August 2019, 13:23:12
Thank you very much. Starting your suggestion I found an even simpler solution closely related to shift registers: Decade counters. They just have one input pin and they count up the output pins in binary.
Right now, I don't know what I should do with the two extra pins I would gain. So, if someone comes around and says my solution from before will definitely work, then I'll go with that. How sure in % are you it will work? ;D Otherwise I'll use the decade counter and come up with two more features for the board. ;D
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Sat, 17 August 2019, 12:15:21
I've found a great solution. I'll take out the fn1 switch and replace it with a small 7 segment display. I'll use a display driver and a binary counter IC. Then I’ll get rid of the separate backlight LEDs for the layer keys. This way I don't have to mess with the HWB pin, I'll even have one pin to spare and there will be a cool digital layer display. Just need to make sure I don't blow past the 500mA current limit.
[attachimg=1]
Title: Re: I call It the Mothership
Post by: ErgoMacros on Sat, 17 August 2019, 13:25:28
Quote
How sure in % are you it will work?

I've done very little electronics of any kind. Some book learning, and a lot of youtubes. From what I understand
it seems like it should work, but I wouldn't risk a board design as large and complex as yours on my word.
I'd either breadboard it or do a small test PCB to confirm.

Another discussion possible solution based on an ATTiny85 use of reset as GPOI. Found in this youtube:
    https://www.youtube.com/watch?v=yAT_TdD6nL0 (https://www.youtube.com/watch?v=yAT_TdD6nL0)

But it sounds like you have 2 other, better solutions available to you.

All the best. I'm watching the "mothership" project with interest.
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Sat, 17 August 2019, 20:47:18
Does someone have one of these USB amp-meters? It would be super helpful to know how much current a 32U4 board draws with LEDs turned off. Maybe also testing if fast typing makes a difference. With 81 white backlight LEDs, a white seven segment LED and 330Ohm resistors I get to about 440mA. So, I am getting pretty close to the 500mA current limit of USB 2.0. I've already ordered an USB amp-meter from Aliexpress but that might take a few weeks. :D
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Wed, 28 August 2019, 15:03:31
So, I’ve decided to go with the IS31FL3731 chip and completely redesigned the PCB. The MCU is a bit cramped now but I have no more pin shortage and the 7-segment display is now just part of the LED matrix. As long as the display is the same colour as the backlight this shouldn’t be a problem. Although not needed for a keyboard, this design would probably achieve high speed USB2 on a two-layer PCB.

[attachimg=1]

[attachimg=2]

If someone should find a blatant error in my schematic a quick heads up would be much appreciated. ;)
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Sat, 07 September 2019, 14:27:35
[attachimg=1]

[attachimg=2]

I am contemplating what to do with the switch side silk screen.
Title: Re: I call It the Mothership
Post by: EMC Labs on Sat, 07 September 2019, 19:23:24
(Attachment Link)

(Attachment Link)

I am contemplating what to do with the switch side silk screen.

The bottom option is trippy as hell.
Title: Re: I call It the Mothership
Post by: _rubik on Sat, 07 September 2019, 19:43:53
(Attachment Link)

(Attachment Link)

I am contemplating what to do with the switch side silk screen.

I love that you're making this PCB a work of art. You've clearly put so much effort into it; why shouldn't it be the center of attention. Very intrigued to see the finished product -- keep it up!
Title: Re: I call It the Mothership
Post by: Blitzschnitzel on Mon, 09 September 2019, 07:00:51
Thanks. It’s called a reaction diffusion algorithm. I’m not actually drawing these by hand.^^
I have played around a bit with different parameters and I think it is going to be one of these two:

[attachimg=1]

[attachimg=2]

Which one do you like better?
Title: Re: I call It the Mothership
Post by: ErgoMacros on Mon, 09 September 2019, 11:56:58
I like the top one best. Less busy.
Title: Re: I call It the Mothership
Post by: popcap on Mon, 09 September 2019, 18:59:42
Yeah the top one seems to be less dense and is more appealing to the eye. Would love to see this on the final PCB.
Title: Re: I call It the Mothership
Post by: yui on Tue, 10 September 2019, 03:17:01
I do agree, number one seems more appealing to me