I designed a keyboard but I need help! - Page 1
Forum section: electronics / general

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 03:43:08 pm
content: Hi guys I'm not electronic engineer but this is my hobby and I would like to build projects mostly from github.Recently I designed a keyboard with kicad but there is an issue with LEDs.Here is the schematicEveryhig looks good the keys are working just fine but the lights are not correct, or some led's have different colors, I'm using SK6812mini-e LEDsThe MCU is R-pi pico, and the firmware is KMK FirmwareDo I need aditional component for LEDs? Like capacitors, controller, Resistors or somethig else ?I saw a lot of other keyboards with the same design with less keys and LEDs without issueAlso Is added 104c for each led and a boost buck convertor from 5v to 5v and boost the current for feed the LEDs voltage but nothing happenedWhat is the problem?Regards

author: Kim Christensen
author_rank: Super Contributor
timestamp: October 14, 2023, 04:07:55 pm
content: I don't see any power supply decoupling capacitors on those "LEDs".Quote from Chinese datasheet:QuoteThen they show a schematic of each LED chip having a bypass capacitor across it's supply rail. So without any supply bypass capacitors in your circuit at all, some of them are probably glitching out.On a PCB with well sized traces you may be able to get away with using fewer bypass capacitors, but you won't get away with using none at all.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 14, 2023, 04:09:55 pm
content: Same here. Start with adding a bunch of decoupling capacitors, and a buffer capacitor.

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 04:12:45 pm
content: OP mentioned that Cs were added.What is the power source for the LEDs? This many LEDs would need a substantial power supply.An easy test would be to set the number of LEDs to 1-10 in the code and pay attention to the colors of the first LEDs, ignoring the rest. This would confirm that at least source control signal timing is correct. Then go from there.Ideally you would want to disconnect DIN from DOUT as well to reduce dynamic power consumption, but I would try without that first.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:21:27 pm
content: the caps for each led were added but problem still there

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:23:35 pm
content: the power source is usb but between VCC and LEDs I added a boost buck converter, (5v to 5v) with or without that problem is there.I set the LED numbers to 5 but 7 glowing up with wrong color

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 05:27:05 pm
content: 84 LEDs at 12 mA per LED would consume 1 A. There is no booster that would make this not violate USB 500 mA limit.So, depending on the design of the board, I would disconnect majority of the LED chain from the power supply and see if that improves things.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:28:29 pm
content: I set the LED numbers to 5 but 7 glowing up with wrong color

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 05:33:21 pm
content: It would be hard to tell what may be wrong without a scope or at least a logic analyzer. Extra LEDs lighting up may indicate noise on the data lines, or just incorrect timing of the data.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:39:00 pm
content: I fixed thaaaaat Lets gooooooooooooooooooooooooooooooo,,,,,,,,,,,,,,,,,,,, I added a 10uf cap for the first LEDThats it

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 05:40:37 pm
content: It is highly likely that the whole design is still going to be unstable.At least get the USB current meter and measure the current consumption.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:42:49 pm
content: I fixed that brother the problem was from the first cap, then I increase that to 10uf, thank you so much

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 05:44:44 pm
content: If a random 10 uF capacitor "solves" the problem, the design is still marginal. If it works for you, it is fine. But there is a good chance that it may stop working with a different USB host, for example.And if you are going to draw 1A from the USB port for a long time, there is areal chance to cause damage to the motherboard.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:48:25 pm
content: No I checked different design from others, And I found a 10uf on power decoupling, also I attached the usb to other source it works with no issue.https://geekhack.org/index.php?topic=116183.0

author: ataradov
author_rank: Super Contributor
timestamp: October 14, 2023, 05:55:20 pm
content: From the EE point of view, this design process is really bad. But keyboard community does this kind of stuff all the time, so it is fine, I guess.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 05:56:47 pm
content: We are mostly NOT electronic engineer, this is my hobby. I'm IT engineer.

author: mk_
author_rank: Regular Contributor
timestamp: October 14, 2023, 06:19:52 pm
content: Quote from: Pooya on October 14, 2023, 05:56:47 pmWithout reliable hardware your IT-stuff is?exactly:Non existent.so.. be friendly to yourself and listen carefully to the guys who know how hardare like this should be done so that IT-people can work with.

author: wraper
author_rank: Unknown
timestamp: October 14, 2023, 06:19:58 pm
content: I strongly suggest adding pull-up resistors to columns so current through pressed key is at least 1mA. Commercial keyboards and mice often don't have them too for some stupid reason. However after some time (months to a few years) key chattering appears because wetting current from internal MCU pull-up is not enough to ensure reliable contact in switches.

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 06:24:41 pm
content: How can I add that? can you show me by a schematic please ?

author: wraper
author_rank: Unknown
timestamp: October 14, 2023, 06:29:49 pm
content: Resistor from each column to +3.3V. 1k to 2.4k resistors should be about fine (lower resistance gives higher current).

author: Pooya
author_rank: Contributor
timestamp: October 14, 2023, 06:34:48 pm
content: Tnx, I will add for the next pcb order

author: Kim Christensen
author_rank: Super Contributor
timestamp: October 14, 2023, 07:07:46 pm
content: You could lower the keyboard power consumption by putting an upper limit of 0x7F for each of the RGB values in your PY code. (or whatever keeps the total current under 0.5A)You probably don't want 1A worth of LED light shining in your face anyways.