famichu/MagLev_Switch_MX

Sample Numeric Keypad Components

markjhvonk opened this issue · 7 comments

Hi, I'm not sure if this is the right place but I'm running into some issues while trying to build the 'sample numeric keybooard'. I managed to source most of the required components however I'm still running into some issues.
After soldering all the components and uploading the script to the Seeeduino, the keypad starts outputting random letters and numbers continuously. When I tweak the #define ACTUATION_POINT 512 and set it to 1023 it stops continuously outputting numbers and letters but it still outputs a series of random numbers/letters when a key is pressed.
I believe it might be because I used the wrong components on some places as I had trouble figuring out which ones I need. These are the components I used (as per pcb labelling):

  • Q1-5: BC847B 1F SOT-23, 45 V, 100 mA, 250 mW
  • R1-15: 0603_1608 1k resistors
  • D1-18: 1N4148 Diode 200 mA 100 V
  • U1: SeeeduinoXIAO
  • U20: ATmega328-AU
  • BAR1: HDSP-4850 lighbar
  • RV1: RK097N 100k ohm

@markjhvonk
Firstly, thank you for building my keyboard. And I'm sorry about that code was not good and really complicated(even if this issue was not caused by my code).

Well, I think few causes shown as down below might cause that issue.

  • break of hall IC or circuit board in the switch
  • wrong direction of diodes

Anyway, I guess the random letters output from keyboard are consisted of specific characters of keys in same column.
If that, please check switches outputs on that column with multimeter(I recommend to change a program to keep supplying power to only specific row to check correctly). If output from a switch was always HIGH(even releasing a switch), that switch might be broken.

Also, if you used another hall IC, you should check the output direction or pole direction too.

Thank you😊

Thank you for the quick response!
The code itself seems to be fine, and is very clear.
I checked the direction of the diodes and they seem to be right. I am also not using the MagLev switches yet, just regular mechanical switches. I also applied some mill-max hot-swap sockets so I can swap/test the keys more easily.
I will try to attach some photos of how I soldered the diodes and other components. I also checked all the connections like you suggested and they seem to be fine as well. I also measured the voltage which also looks good.
pcb
(Don't mind the bad soldering I removed the diodes a few times to switch directions)
Like you mentioned the rows and columns keep alternating (I checked by add some extra Serial.println() ) this is what is looks like continuously:

...
row:0
col:2
row:0
col:3
row:1
col:0
row:1
col:1
row:1
col:2
row:1
col:3
row:2
col:0
row:2
col:1
row:2
col:2
row:2
col:3
row:3
col:0
row:3
col:1
row:3
col:2
row:3
col:3
row:4
col:0
row:4
col:1
row:4
col:2
row:4
col:3
row:0
...

I still believe the issue might be one of the components I used like the transistors but I am not sure since I am not a hardware expert.

I checked with a colleague of mine which knows a lot more about hardware/electronics than I do and he thinks I used the wrong transistors, would you happen to have an exact model number (or link) of the SOT-23 transistor you used for this pcb? I could only grab the following details from the KiCad files: SOT-23_Handsoldering Q_PMOS_GSD.
The ones I used are the BC847B 1F transisors which apparantly have a completely different functionality which explains the odd behaviour ;)

@markjhvonk

Oh. I'm sorry. I didn't notice that you had used the NPN bipolar transistor... You must use Pch MOSFET(especially when use this with high frequency).
I used IRLML6402 from Infineon Technologies though, I think you can use general Pch MOSFET from other manufacturer also.
Important values are Vdss and Vgs(threshold). In this schematic, you must use the MOSFET which has lower value of Vdss than -3.3V and higher value of Vgs than -3.3V. It means, needs to suit on 3.3V power supply, and able to switch with I/O pins of 3.3V.

Just in case, the MOSFET I used is this.
https://www.digikey.com/en/products/detail/infineon-technologies/IRLML6402TRPBF/811437

I hope this comment helps you.

Ah thanks! I also came to the conclusion (with my colleague) that indeed I used the wrong transistors. He suggested the DMP2100U, and he still had some laying around so I will try those this weekend. The specs seem similar:
https://www.digikey.com/en/products/detail/diodes-incorporated/DMP2045U-7/8275356

I will let you know if this fixes the issue!
Thanks again for the help, and explanation so far!

I tried the DMP2100U transistors but they did not seem to work as espected. They also resulted in a continuous output, but this time with all the numbers in order.
I ordered the transistors that you suggested, I will let you know if this fixes the issue.

I also have another question (just to make sure) I'm using 0603_1608 1k ohm resistors on the pcb are these the correct resistors or do I need different tolerances/resistance?

@markjhvonk

Uh... I checked a datasheet of the DMP2100U though, that seems to work on this keyboard too.
What do you mean that "all the numbers in order."?

Those resistors are just pull-up resistors for FET gate voltage. So actually, resistance are not so important(if that's between around 1k and 100k ohm at least).