张三叔

The most beggar 61+3 key mechanical keyboard (with principle explanation)

 
Overview

Key settings:

Fn not pressed:

61 keys default.png

Hold down Fn (multimedia functionality added in version 0.5):

Press FN.png

Design requirements:

Although it is the challenge of the lowest cost and simplest circuit, there is still a lower limit:

1. No rollover for all keys

2. Bring lights (I can do without welding, but you can’t do without)

3. And it is a two-color LED light

4. With HUB, it is convenient to plug in a wireless mouse (the distance is close, the signal is stronger and more stable), and a USB flash drive. However, it has been discontinued because EDA is not optimized enough for equal lengths.

(It has been implemented in another version, please stay tuned)

Design ideas:

You can see Baidu’s “least io scans the most buttons” (here are just a few representative ones)

Traditional matrix:

u=1470209489,3692830599fm=173app=49f=JPEG.jpg

Diode coding:

u=1405912506,2491446644fm=173app=49f=JPEG.jpg

Variants of row and column keyboards:

u=3603759020,178093515fm=173app=49f=JPEG.jpg

Of course, all of the above have key collisions, and the most commonly used keyboards on the market are conflict-free keyboards based on the first modification. And I want to find another way and use the third transformation.

Capture.PNG

This is a partial screenshot of the schematic diagram (ignore the LED pins and only look at the buttons). Here, the three io drivers K1, K2, and K3 scan six buttons. Careful viewers may notice that this is different from the third one above. The scheme is similar. They are all paired with IO, one button on the front and one on the back. The operation process will not be explained here.

Technical Difficulties:

Assume that S1 and S9 are pressed at the same time, but when K1 is set to low level, what are the levels of K2 and K3? ? ?

In order to answer this question, we open the technical documentation:

This is the volt-ampere characteristic diagram of 4148:

capture1.PNG

This is the trigger level voltage of CH551:

When the power supply is 5V:

capture2.PNG

When the power supply is 3.3V:

capture3.PNG

Assume that the current flowing through the 4148 is 1mA, then the voltage drop is 0.5V.

In this case, if the microcontroller is powered by 5V, both K2 and K3 are low. Obviously this goes against the original intention of full-key rollover.

But under 3.3V power supply, 2*0.5V>0.8V, then K2 is low and K3 is high. It’s done.

( The actual measured 551 is not considered a low level at 0.9V, so a pull-up resistor is needed to provide bias current to the diode and increase the voltage drop, otherwise it will be the same as under 5V power supply )

But I was not satisfied with this. I also wanted to add more buttons. After reading the technical documentation carefully, I found that the RST pin can be used as an input pin, but the technical documentation did not indicate its trigger level. To be on the safe side, I connected an external PNP tube for inversion. device. In this way, with only one CH551 and 16 legs, excluding 3 power supplies and 2 USBs, the remaining 10 IOs plus an RST pin can achieve 100 keys without conflict without considering the lights. You say it's powerful or not. However, the size of the 3D printer is limited and it needs to drive LEDs. It just so happens that it comes with two PWM channels for driving two-color LEDs. The rest can also be used for 64-key rollover. There are 61 keys arranged, and there are 3 more buttons that can be used as side keys. Squeeze this microcontroller dry in all aspects.

Production process:

PCB front and back:

IMG_20200328_130046.jpg Solder the typeC port first:

IMG_20200328_132522.jpg Input filtering:

IMG_20200328_133410.jpg Power supply voltage stabilizing block:

IMG_20200328_134236.jpg Microcontroller:

IMG_20200328_134645.jpg Exclusion resistor and transistor: (I forgot to order the SMD 8550, plug it directly into the top)

IMG_20200328_185249.jpg Start welding 4148:

IMG_20200328_213207.jpg Weld one side first to fix it:

IMG_20200328_213611.jpg All welded:

IMG_20200328_215628.jpg Close-up: (later I found a 4148 with no tin on one side, just in the picture)

IMG_20200328_215635.jpg Side buttons:

IMG_20200328_220143.jpg Start welding shaft 25%

IMG_20200328_230713.jpg 50%

IMG_20200328_231133.jpg 75%

IMG_20200328_231643.jpg 100%

IMG_20200328_232450.jpg Close-up of solder joints: (4148 without tin is on camera again)

IMG_20200328_232458.jpg Upper balance bar:

IMG_20200328_233345.jpg Add keycaps:

IMG_20200328_234815.jpg Close-up of the sponsor’s logo:

IMG_20200328_234944.jpg

VID_20200410_194329 [640i].gif

Program update log:

Ver0.1:

  1. no lights,
  2. Improve some FN key combinations,
  3. Software debounces,
  4. When multiple keys are pressed, the one with the lowest number will be output first.
  5. Side key functions: FN not pressed: screenshot, PGUP, PGDN FN pressed: INS, HOME, END

Ver0.2:

  1. Add lighting driver (cannot be adjusted by pressing buttons)
  2. Configure all ios as open-drain outputs to reduce operating power consumption (a little)

Ver0.3:

  1. Optimize anti-shake, and the double-click phenomenon on cheap switches will be improved. The rising edge of the key has no effect, but the falling edge will be delayed by 10ms.
  2. Optimized power consumption (the number of keyboard scans has been reduced, and it has been replaced by scheduled scans, which naturally reduces power consumption)

Ver0.4:

  1. Rewrite the USB bottom layer and modify the debugging endpoint in the code to the mouse endpoint.
  2. Modify the trigger under the FN key, change it to be pressed during FN, and the function under FN will remain until the corresponding key is released.
  3. 1Hz breathing light in upper case, 0.5Hz breathing light in lower case
  4. The debounce time is changed to 10ms

Ver0.41:

  1. Fixed the bug where ctrl may be accidentally triggered when powering on

Ver0.5:

  1. Add multimedia operation buttons, see the key map for details
  2. The debounce time is changed to 12ms

Ver0.51:

  1. Enable watchdog
  2. Fix the BUG of crash after USB bus reset

Ver0.52:

  1. The brightness and color change process is modified from linear change to logarithmic change (starts slowly and ends quickly)
  2. Reduce the packet return rate from 1000Hz to 500Hz

Ver0.6:

  1. Improved anti-bounce algorithm, press and release events are instant actions
  2. Due to the increase in calculation amount, the scan cycle is changed to 2ms.

Ver0.7

  1. Added direction lock, FN+" to activate or deactivate, the default logic of the corresponding keys up, down, left and right will be reversed
  2. FN+《Adjust brightness
  3. FN+M adjust light effect
  4. The direction lock and lighting effects will be saved into EEPROM after 20 seconds without modification, and the settings will remain the next time you turn on the computer.
  5. EEPROM wear leveling algorithm
  6. The reported name was changed to "The Most Beggar 61+3 Keyboard"

Lighting effect:

image.png

The program has been updated for more than a year, and I think its functions are now very complete.

Therefore, the software version should not have any major functional updates in the future. Of course, if you have good ideas, you can put them forward in the comment area.

IMG_20200626_204146.jpg

Known hardware BUG:

  1. The voltage regulator block in the picture above is packaged upside down, so it is soldered upside down (the PCB has now been corrected)
  2. The left and right LED channels of the S40 are reversed, please pay attention (the PCB has been corrected now)
  3. The light control pin will still light up slightly even if it is not pulled down. I ignored the clamping diode of the microcontroller io. However, the impact is not big, so the light cannot be completely turned off.
  4. TYPE C is only connected to one side, so only one direction can be recognized.
  5. The CC pin of TYPE C is left floating, so dual TYPE C lines cannot be used to trigger OTG.

Kit sales link: http://aliurl.cn/299o2p

[DIY mechanical keyboard kit (51 microcontroller)]

110 yuan without free shipping:

Positioning board + circuit board + bottom plate + foot pad + balance rod + green axis + electronic components

You can calculate the cost a little bit. If you make one or two sets of the remaining salted fish and resell them, you might as well buy my kits, because you will definitely not be able to sell them to me.

It’s a different matter if you make 5 sets to give to friends or if the finished product is resold. It is recommended that you tell them about this website after resale so that they can update the program.

The program update tutorial refers to another open source project on the site (remember not to check the reset pin enable): https://oshwhub.com/TheLight/zi-ding-yi-jian-pan

Appearance: https://oshwhub.com/yANgZEN/zui-gai-jian-pan-de-wai-qiao

[Due to the long format, the finished products sold to users are placed in the appearance section]

QQ screenshot 20200815180450.png

Related words: charlieplexing

I saw this name recently. The principle is very similar, so I put the name here. If you are interested, you can search it on Baidu.

Other versions:

By reducing one channel of PWM output, there are 9981 keys. The light under the caps lock key can also be used as a capital indicator and maintain the same brightness as other LEDs. IMG_20200627_175011.jpg

Add HUB to modify the layout to make way for the USB interface WeChat picture_20210125210145.jpg

Principle description picture reference link : https://baijiahao.baidu.com/s?id=1621173179116478690&wfr=spider&for=pc # Title #italic

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 20:39:33

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号