[Solved] Looking for help with microcontroller project

I’m looking for someone I could work with on a project. It involves reading analog (hall) sensor values with an analog mux using an STM32F4 microcontroller, specifically an analog keyboard. I have a PCB designed and built, which I’m reasonably confident in. I did set up the IDE to program the microcontroller, but I had to realize that I’m out of my depth. FYI: I do have C/C++ programming experience plus some electronics work.

Is there someone available to talk to and maybe work with to review and finalize the design?

What are you using for Hall effect sensors? And which STM32 are you using?

I might be able to show you an easier to absorb path as far as the code goes.

When you say, “… specifically an analog keyboard …”, do you mean a whole PC keyboard full of analog hall effect switches, that are being mux’d to the STM32F4 to be detected & decoded? Are you replacing the stock keyboard control board?

Sounds like an interesting project.

Hardware-wise, it’s almost exactly this project, just moved the parts / pads around on the PCB to suit my needs (and to use Wooting Lekker switches instead of the 3D printed switches it originally uses): GitHub - riskable/void_switch_65_pct: A reference implementation of an analog hall effect keyboard (65%) that uses 3D printed Void Switches and a Black Pill (STM32F4x1CEU6) microcontroller board.
so in other words, these hall sensors: GH39FKSW GoChip Elec Tech (Shanghai) | C266230 - LCSC Electronics
and an STM32 blackpill board, which has an STM32F411CEU6 chip
I also threw in per-key RGB lighting with WS2812 LEDs and an SPI screen (ST7789), but I won’t lose sleep over not including those in the final build. Trying to focus on getting the “keyboard” part working for now.

1 Like

That’s exactly it, though I’m still debating whether I’ll replace the control board in my existing keyboard or if I’ll make/order a new housing for this one. Keeping a known working keyboard around sounds like a good idea in case my custom one runs into issues…

1 Like

The only time I’ve messed with muxing analog signals, was back in the late-70s/early-80s, when hooking up the outputs of a SN76488N complex sound generator IC to some CD4066 CMOS quad bilateral switches. But there was no computer control in that project, just manual switches.

Are you using a total of five 16-input mux chips?
Is your circuit going to scan rapidly through the 70 (out of 80) input channels on the 5 mux chips, detecting a voltage between 0V and ~3.3V, to determine which key is pressed, and how far?

I’ll be using either 5 or 6 muxes for the 70 or so keys (6th mux would be redundant if I want to add extra inputs later after the PCB is manufactured) but besides that, that’s the plan.
I have basic ADC scanning and debug printing mostly working on my test 1-mux board with 9 keys, but there’s something funky going on with the select pin timings currently that appears to be selecting the wrong pin on the mux occasionally, and I just don’t know enough about the firmware / hardware to fix it. It could be a hardware issue though. Current goal is to find someone I can talk to online or meet up with to take a look at it.

1 Like

That sounds like a troubleshooting task, where a multi-channel oscilloscope needs to be connected to the control and signal pins - looking for the timing or voltage glitch. Are there accessible test points?

Another question - If you slow down your scanning loop (add some wait states), do you still see the wrong mux pin selection occurring?

I’m slightly ashamed of myself, it was a bad solder joint this whole time… everything works beautifully now that I reflowed the joint, with or without slowing down the scanning loop. Mystery solved, I guess!

3 Likes

It’s always good to find a definite cause for intermittent failures.

If this project doesn’t need additional assistance, you might edit the title, adding [SOLVED].

1 Like

Being able to find and fix a problem is a sign of technical competence. No need to be ashamed…

3 Likes