User Tools

Site Tools


jansonntag:attempt4

Analog Cherry Keyboard Attempt 4

As I wrote in attempt number 3 at the end, this is the plan for attempt number 4:

There I will test out the bigger brother of the LDC1314: The LDC1614. It has the same pinout and overall package, so it will be an in-place replacement. The big advantage is the 28-bit resolution. Hopefully, there is no gain needed then.

I´ve got the needed parts some weeks ago (thanks Ferdi for ordering them!), but didn't have time to solder or even start programming because of my bachelor thesis. After finishing most of the thesis I had a day off and at least desoldered the LDC1314 and soldered on the LDC1614 as a replacement. I made a short video about it as you can see below, which also contains a little overview of the gear that I´m using. Not gonna lie but I´m still not very good at soldering with hot air, but I hope that the circuit will work nonetheless. Here are a bit more details about the LDC1614. First of all, you can find the documentation here: Documentation LDC1614. The main advantage is of course the higher resolution of 28-bit. It´s even advertised as a high-resolution option: Otherwise it is pretty much the same, but because of the bigger registers the library has to be rewritten or even a completely new one has to be made. Another option would be to find an already existing library. So in the next couple of weeks, I will work on that.

My thesis is nearly finished so I had some spare time to read some of the documentation. To my surprise (and luck) the LDC1314 and LDC1614 have nearly identical register maps. There are only two differences:

  1. There is no gain option (Compare Chapters LDC1314: 7.6.26 and LDC1614: 7.6.30)
  2. The measured data is split into an MSB and LSB part (32-bit in total, 4-bit error flags, 28-bit measurement data)

And I thought I would have to rewrite the whole library. So I quickly (30 minutes max) modified the old library to account for the above-mentioned differences. You can find it here: LDC1614-Arduino Even the parameters you have to set are identical between them too. I then modified the script from attempt 3 to use the new library:

ldc1614.ino
#include <ldc1614_lib.h>
#include <Wire.h>
 
LDC161X ldc1614(false);
 
void setup() {
  Wire.begin();
  Serial.begin(9600);
  ldc1614.LDC_resetLDC();
  delay(500);
  ldc1614.LDC_setConversionTime(0, 0x2000);
  ldc1614.LDC_setSettleTime(0, 0x000F);
  ldc1614.LDC_setClockDividers(0, 0x1002);
  ldc1614.LDC_setErrorConfig(0x0000);
  ldc1614.LDC_setDriveCurrent(0, 0xE800);
  ldc1614.LDC_setMUXConfig(0x20D);
  ldc1614.LDC_setOffset(0, 0x4FFF);
  ldc1614.LDC_setConfig(0x0801);
}
 
void loop() {
  Serial.println(ldc1614.LDC_readData(0)/1000);
  delay(100);
}

I removed the process of making an average just for testing right now. With the new LDC, I also ordered four Cherry MX Blacks (MX1A-11NN) and soldered these onto the test board. I then tested the board. As it seems to me there is a difference if the board lays flat on my table or if I hold it mid-air. But see for yourself:

This one is mid-air This one is on my table

Yes, there are still a lot of interferences, but nonetheless, I think the result of this first test is really promising. Because of the different behavior when in mid-air or with a surface under it, I will 3d-print a little (and first of all simplistic) case and make some experiments with that. I even think about adding some aluminum foil into that case maybe this will reduce interference as well. Furthermore, I will have to work on the software as well. Right now it's very rough but I also want to implement some kind of smoothing (possibly after I build the case) and I have to work on reading out all four keys at the same time. Therefore I will have to dig deeper into the documentation. My understanding right now is that I need to change some of the MUX settings.

As a little bonus I tried what happens when I touch the coil with my finger: Maybe this has a function for someone as well. Could be useful in some situations, but I don't know. (Free real estate ;-))

I designed (a bit over an hour) and printed (2:38 h) the case for my test board. It screws together with M4 bolts and threads itself into the plastic. Because I made the holes for the jumper wires a bit too small on the outer edges, so I decided to solder some wires in place. I didn´t do a great job but I works for now and it looks a bit neater on the outside. Fortunately, even the keys fit perfectly the first time. I found this document where everything about the position of holes for the switches and distances between the PCB and the switch itself is described (in inches but fusion converted them perfectly): MX Series - Desktop Profile 0.60 Inch Keyswitches I then soldered and assembled everything and this is what came out: I didn't put in any metallic foil right now. In the first test, it seems the noise/interference is a bit reduced, but the plastic housing really didn't help a lot. When I hold it midair there is still a difference in the readout when I put my finger on the back of the case. Next, I will try to put aluminum foil on the bottom of the case.

jansonntag/attempt4.txt · Last modified: 2021/03/25 17:56 by jan