Author Topic: Hall Effect switch electrical characterization.  (Read 6509 times)

0 Members and 1 Guest are viewing this topic.

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Hall Effect switch electrical characterization.
« on: Sat, 04 February 2017, 16:27:47 »
I decided to finally get unlazy and start working on hall effect again, starting with characterizing the hall effect sensors. Official documentation supports a scanrate of 100KHz so it should be pretty quick. I'm running this from a 5V precision power supply and I'm using a pull up resistor that "should" be 10K but it's measuring 14K for some reason. These are the new "single magnet" switches. The board I got these from was made in 1992. Switches are labelled 11B1A and are the infamous "clicky" hall effect switches which are terrible to type on or actually use so I don't feel bad about sacrificing them. You can see the board they came out of here: http://imgur.com/a/Ai5fo

DS1Z_QuickPrint3 by dork_vader_exe, on Flickr
Here is the "press event, it initially shoots up to about 2.0V, then falls a bit, then finally goes up to the final value of 4.8V in about 2.2 us (Microsecond). That's pretty quick! Keep in mind that most contact switches settle on the order of milliseconds. This turned out to be extremely repeatable. The first 20 or so presses looked exactly the same. If it falls this fast, then we get a total cycle time of about 5 us, which should support 500kHz scanrate. woot! You can see there is a tiny overshoot, and other than the little jitter at the beginning, there is no bouncing or ringing that you get with contact based switches. Since it's so repeatable, you could easily trigger on that first spike.



DS1Z_QuickPrint1 by dork_vader_exe, on Flickr
This is the "release" event. it is very smooth and falls from 4.8V to 0 in about 6 us (microsecond) since it's so "slow" the totally cycle time is about 8 us which is just fast enough for 100KHz




DS1Z_QuickPrint2 by dork_vader_exe, on Flickr
This is the same "press" event as before, but it's on the same horizontal scale as the release event so you can compare them head to head




DS1Z_QuickPrint4 by dork_vader_exe, on Flickr
Finally, if we don't count that miniscule overshoot, the "press" event time is even shorter:; onle 1.4 us to 4.8v! awesome.

What about power consumption: Well I didn't measure it with the DMM, but the PSU readback system is 4 digits with high accuracy anyway, so it's close enough for our purposes. (update, just checked and the readback accuratcy for an HP 66332A is 0.01%+0.6 microAmps, plenty good for us here.) Unpressed the system draws 0.0013A (1.3 mA) and pressed it's 0.0040A (40 mA). With 500 mA on USB to play with, I can easily power a whole board. Note: I think this will also depend on the value of pull up resistor used. I have pictures of this but I need to get them from my phone.

I also tried this at 4.5V, 4.0V and 5.0V. In all cases the actual time was the same, and the curve was just a little more steep or less steep, but otherwise almost identical. This makes sense because there's basically an amplifier in there. I accidentally applied reverse voltage to a switch and other than chewing up like 500 mA and starting to heat up a lot, it still worked when I put it back.

Unfortunately I was not able to get one of the older dual magnet switches to work at all in this system, so I'll have to get a different board out to test this. The one I was using was made in the early 1970's and might be broken. I have better boards that I know work, I just need to cut some traces to isolate a switch and then go for it.

In short: it looks like I can support a 100 kHz scanrate on hall effect pretty easily. This is easily three orders of magnitude better than contact switching, and the sensors are quite robust as well. This will be my new "gaming" keyboard when I'm done.

OK I'll be working on this slowly and posting updates here. next steps are to
1. see how fast I can turn the switch "on"
2. order a bunch of pull up resistor networks and a teensy.
3. re-wire the board I have. I'll be using a keyboard from a broken TI Silent 700. The board is one layer, so I already drilled it and prepped it for re-wiring. Provided the switches turn "on" quickly (they should, since they are basically just a hall sensor and an amplifier) I can strobe the power and sense the lines to get NKRO without diodes
4. also have to test how well they work with crummy power. Might need to put a little cap by every switch to ensure it turns "on" fast enough to scan at 100 kHz.
« Last Edit: Sat, 04 February 2017, 19:45:54 by dorkvader »

Offline sinusoid

  • Posts: 160
  • fd > ESC
Re: Hall Effect switch electrical characterization.
« Reply #1 on: Sat, 04 February 2017, 22:26:38 »
Thanks for all that research and documentation on the hall effect switches.
I always liked the concept because of its inherent indestructibility, and now those timings make me hyped about it all over again.

Would you be able to map the graphs to magnet height travel? Do you plan on testing newer hall sensors in that setup?

Modding-wise, Cherry MYs have a perfect spot for a 2mm circular magnet on the tip of the leaf spring. Longest travel point of the whole switch. Got a spare G81 board for that purpose long time ago, gonna try doing it one day. When i have the time -_-

Anyway, subbing the thread and waiting for more!

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #2 on: Sun, 05 February 2017, 11:19:53 »
Did some more work on the switch. I'm now measuring what it looks like when I power the switch off and press it, then apply power. I tried adding a 0.68 uF decoupling capacitor, but it didn't change the "width" of the waveform.

DS1Z_QuickPrint5 by dork_vader_exe, on Flickr
waveform with a 0.68uF decoupling capacitor. Looks like it's about 0.56 us. My power HP 66332A supply has a transient response time of under 50 us for a change in current of up to 50% of the current rating, so it takes 50 us to co from 0A to 2.5A, since it's going from 1.3 mA to 40 mA, we can expect 1/60th of that time. It's actually better than that, but this will do. It should take it about 1 us. I should measure the PSU discharging through a resistor to check though. Add that to my list of things to do "make sure you are measuring the switch through the scope and not the PSU."


DS1Z_QuickPrint5 by dork_vader_exe, on Flickr

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #3 on: Sun, 05 February 2017, 11:34:31 »
Thanks for all that research and documentation on the hall effect switches.
I always liked the concept because of its inherent indestructibility, and now those timings make me hyped about it all over again.

Would you be able to map the graphs to magnet height travel? Do you plan on testing newer hall sensors in that setup?

Modding-wise, Cherry MYs have a perfect spot for a 2mm circular magnet on the tip of the leaf spring. Longest travel point of the whole switch. Got a spare G81 board for that purpose long time ago, gonna try doing it one day. When i have the time -_-

Anyway, subbing the thread and waiting for more!

Hi there sinusoid.

Since they are Schmitt triggered, there shouldn't be any map to magnet height travel. Based on how it operates it should suddenly go from "off" to "on" once the lower threshold of the trigger is reached. This also means it is hardware debounced. Not having to worry about bouncing is likely one reason why these were popular in the 1970's: less circuitry and complexity. Including an IC to debounce the chips would have added a lot of expense.

These are tests of the newer hall sensors. I tried testing an older one in circuit and it didn't work, so I'll take one of my known good boards and cut the traces to isolate a switch. I will of course be comparing to the Chinese hall effect boards that xmit / MD were able to sell recently. It'll be sad to ruin the conformal coating and potentially destroy the keyboard, but science must be done!

Hmm that's an interesting idea on the cherry MY. I have a nice one with dyesub PBT caps on it that I'm not really using. Assuming I can still find it...

I also need to test how "fast" a microcontroller can turn a pin on. These use so little current that I can direct drive them from the pin, but I might want to drive them through a transistor, to see if I can get them to turn on faster. Anyone know the slew rate / transient response time of an atmega 36u4 that a teensy uses

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #4 on: Mon, 06 February 2017, 01:21:24 »
update: each switch draws 4mA when pressed and 0.13 mA unpressed. 40mA would be a no-go for usb, but 4mA is totally doable, even with 100 switches. I also learned that high speed circuits (and this does qualify) benefit from larger pullup resistor value, so maybe more than 10K is the way to go.

« Last Edit: Sat, 18 February 2017, 13:43:55 by dorkvader »

Offline sinusoid

  • Posts: 160
  • fd > ESC
Re: Hall Effect switch electrical characterization.
« Reply #5 on: Sun, 12 February 2017, 22:00:44 »
[...]they are Schmitt triggered, there shouldn't be any map to magnet height travel.

Okay, I'm dumb, it's all there in the timings ;_; . I skimmed through that and assumed these curves were fluent state changes resulting from the switch mechanism, describing the magnet approaching the switch. The timings are obviously too short for that, and I'm stupid for not noticing this.

My brain always subconsciously went for the full hall sensor that changes value based on magnet proximity, because of all the nice features like velocity measuring and variable actuation height. And they come in crazy resolutions. I did a bunch of fiddling with them using an arduino and simple mechanical setups. The kind of sensor I got measured proximity with precision of around 200-300 points per centimeter (probably more, for testing I assumed perfect linear action from the setup and perfectly stable current, then rounded those from the value spreads I read on arduino's analog pin).

I guess I need to go rethink my ways and stop with the overkill :P


Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #6 on: Mon, 13 February 2017, 09:49:05 »
Turns out that xmit has already done most of this work for me.
https://deskthority.net/workshop-f7/converting-my-wang-t12379.html

So I've decided to hasten work on converting an actual keyboard. Enter the TI silent 700. There have been a lot of variations of these, and I had two with identical model numbers, features and layouts, made less than a year apart that had radically different construction.
IMG_20170212_121154 by dork_vader_exe, on Flickr
IMG_20170212_121208 by dork_vader_exe, on Flickr

Now you can get NKRO on these without diodes, because you can only power one column at a time, then read across to see what switches in that column are pressed, then unpower the column, power the next one, etc. This KB is cool in that it has a 1 layer PCB, so I was able to drill the traces. I left the grounds connected and drilled the other 3 lines. I plan to strobe the power lines as columns, then connect all the rows across, yielding a normal sense/strobe configuration, only the microcontroller doesn't "know" that it's powering switches, but it'll send out 5V and receive 5V back on the sense lines. I suspect this will work with existing firmware without issues (especially if the controller is only expecting 2kro) , then once I have that working, I can figure out how to program and start modifying KB Controller code to support faster scanrates and whatnot.

You may notice the plate supports a few extra switch locations, like next to the spacebar in useful positions. Right now I don't plan on utilizing those, only to get a working prototype, Then I can drill the PCB and install more switches once I have it working. I'll plan for this when I make the matrix, to leave those locations open, so I can easily add them later.

Once that's done, I'll start work on completing another few keyboards. I have another 2 silent 700, but both of those actually work, so I might not mod them. The 1KRO they have is annoying however. After that I have 2 vintage dual magnet ones that I want working, then I'll decide which of my others I want. One reason I'm doing this is that I promised someone that I would give them a working prototype, and I intend to honor that. The other reason is that they're awesome :)

I've been advised to stop this project, because nobody can type fast enough to take advantage of the 100kHz scanrate, and nobody will keep a keyboard long enough to take advantage of the 30 billion actuations to failure, but I replied that overkill is the soul of keyboarding and I would not stop until I had a superlative board.

So like always, expect slow updates. I'll continue logging my efforts here.

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #7 on: Mon, 13 February 2017, 10:07:22 »
[...]they are Schmitt triggered, there shouldn't be any map to magnet height travel.

Okay, I'm dumb, it's all there in the timings ;_; . I skimmed through that and assumed these curves were fluent state changes resulting from the switch mechanism, describing the magnet approaching the switch. The timings are obviously too short for that, and I'm stupid for not noticing this.

My brain always subconsciously went for the full hall sensor that changes value based on magnet proximity, because of all the nice features like velocity measuring and variable actuation height. And they come in crazy resolutions. I did a bunch of fiddling with them using an arduino and simple mechanical setups. The kind of sensor I got measured proximity with precision of around 200-300 points per centimeter (probably more, for testing I assumed perfect linear action from the setup and perfectly stable current, then rounded those from the value spreads I read on arduino's analog pin).

I guess I need to go rethink my ways and stop with the overkill :P


Yeah modern hall sensors are great! I recommend looking at the XMIT Chinese hall effect boards. These use a slider with a magnet, and the hall sensors are all on the underside of the PCB, which is conformally coated. These are cheap and effective, and perform better than a lot of other switch designs. I've said it for years: hall sensors are cheap and good, instead of wasting time with designing special "high actuation" switches, or forgetting to gold plate your copper, just grab some hall sensors and go. You can tune the keyboard to actuate at whatever point you want, NKRO is a breeze, and you can also do fun and unnecessary stuff like insanely fast scanrates and waterproof PCBs. I'm not 100% sure they will work underwater though, since it's diamagnetic, some magnetic keyboards won't work under water.

One thing I still need to determine is if I can drive the power lines of the switch sufficiently quickly. Time to whip out the 2MHz signal generator and a high bandwidth amp!
(I will be using an audio amplifier that has a 3dB rolloff at 1.2MHz so I can drive 100 kHz through it without any noticeable drop in "volume" :p

Offline sinusoid

  • Posts: 160
  • fd > ESC
Re: Hall Effect switch electrical characterization.
« Reply #8 on: Thu, 16 February 2017, 17:14:48 »
Yeah modern hall sensors are great! I recommend looking at the XMIT Chinese hall effect boards. These use a slider with a magnet, and the hall sensors are all on the underside of the PCB, which is conformally coated. These are cheap and effective, and perform better than a lot of other switch designs. I've said it for years: hall sensors are cheap and good, instead of wasting time with designing special "high actuation" switches, or forgetting to gold plate your copper, just grab some hall sensors and go. You can tune the keyboard to actuate at whatever point you want, NKRO is a breeze, and you can also do fun and unnecessary stuff like insanely fast scanrates and waterproof PCBs. I'm not 100% sure they will work underwater though, since it's diamagnetic, some magnetic keyboards won't work under water.

https://www.reddit.com/r/MechanicalKeyboards/comments/5uf3ed/xmit_hall_effect_keyboard_update/ these look nice.

Also, this. Halls let you completely separate the mechanics/feels from the actuation parameters and reliability of a switch, and add lots of features.  They seem superior to everything else, unless you're working with MRIs or sth.

Will probably test them underwater at some point. In the fuuuuture.   :rolleyes:

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #9 on: Sat, 18 February 2017, 11:55:20 »
Yeah the big weakness of hall effect is that they have traditionally been very expensive, but the reason they lasted until the mid 2000's is because they were really durable in harsh conditions (dust/dirt/etc) and found their way into many industrial process control boards. Nowadays, hall sensors and magnets are cheap, and we have XMIT boards at good prices. I'll have to check with HaaTa but I think they might still work in a strong magnetic field if it's constant. also not sure about underwater but I think there too, it's only magnetic valve types that don't work underwater. I'm not a magnetics expert so this is just what I remember of other people saying. Maybe I'll shove a switch in a bowl and give it a shot.

I'm told that a atmega32u4 (teensy) is only good for about 9mA per pin, so I will have to drive the columns through a transistor network (5-6 switches in 1 column draws about 25 mA pressed). I'm researching suitable examples on Mouser now. I'll need one per column, so two dip16 might suffice. Since they're not as common as I'd like, I might just pick up one transistor per column and wire them all up. Let's see mouser has MOSFETs for... good gravy $.22 each in qty10! geez, I'll hit up eBay for this.

The limiting factor will be idss(drain/source leakage current), we don't want them to stay on or turn on due to ripple in the power rail and I'm seeing 1 uA up to 1 mA depending on condition. These are at high voltage (45-60) so I imagine it'll be negligible here but its always safe to check.

Hm maybe I'll go downstairs and check how they respond in a current limited condition. What happens if I set 3mA to be the max?

Finally: the one weakness of these switch types is they are (usually) linear. I have some (very rare) tactile hall switches that implement tactility by placing a pogo pin in the slider, and a channel in the housing and they feel TERRIBLE. To fix this I will want to add a solenoid bolted to the chassis. Might steal xwhatsit's solenoid driver design for this purpose. I haven't looked but I think its a small SMPS.

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #10 on: Sat, 18 February 2017, 12:47:16 »
as expected, switches work the same underwater.
switch underwater by dork_vader_exe, on Flickr




DS1Z_QuickPrint8 by dork_vader_exe, on Flickr
This is what happens when driving them at 18kHz (unpressed, I have it set to go to 0 when pressed) The waveform looks ugly, but it does work. I forgot to change the voltage. You can see it's at about 10V and the switch is fine



DS1Z_QuickPrint9 by dork_vader_exe, on Flickr
This is the switch being driven from my analog signal generator at about 18kHz. This is pressed. As expected, voltage drops to 0 when pressed (how I have my pullup resistor wired)



DS1Z_QuickPrint10 by dork_vader_exe, on Flickr
Switch driven off the analog signal generator. Unfortunately as I up the frequency, it shaves the waveform down until there's nothing left. 35 kHz is about the max it could do. I'm not sure exactly what causes the duty cycle to become shorter as I up the freq, but I'm guessing it's some high speed stuff beyond all mortal ken



DS1Z_QuickPrint11 by dork_vader_exe, on Flickr
Since I was accidentally driving the switches from the signal generator at 10V I wanted to do 10V properly off the powersupply and see what happened. As always, switch performs the same.

I'll eventually try higher voltages. It's amazing to me that even at 200% of their recommended input voltage, they still operate just fine.

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #11 on: Sat, 18 February 2017, 13:47:16 »
update, according to the hall effect sensing and application PDF that I found a few years ago absolute maximum ratings are 30V

https://sensing.honeywell.com/honeywell-sensing-sensors-magnetoresistive-hall-effect-applications-005715-2-en.pdf

Code: [Select]
Absolute Maximum Ratings
Supply Voltage (VS)        -1.0 to +30 VDC
Voltage externally         +25 VDC max. OFF only
applied to output          -0.5 VDC min. OFF or ON
Output Current             50 mA max.
Temperature                -40 to +150°C
operating Magnetic flux    No limit. Circuit cannot be damaged by magnetic overdrive
No wonder these were used for so long!


Code: [Select]
Electrical Characteristics Parameters    Min. Typ. Max.
Supply Voltage (VDC)                     3.8       30
Supply current (mA)                                10.0
Output voltage (operated) volts               0.15 0.40
Output current (operated) mA                       20
Output leakage current (released) μA               10
Output switching time (sinking 10 mA)
Rise time 10 to 90%                                1.5 μs
Fall time 90 to 10%                                1.5 μs


hmm, my measured rise time is easily within spec, but fall time is far outside. I'll have to look at my test circuit and make sure that it's set up properly, I think the issue is that I'm measuring "turn off time" which should be a function of the inherent capacitance discharging (looking at the output curve this is reasonable) and might be the output capacitance of my power supply. Will spend some time looking at "fall time" which is important if you want to hook this up to a normal microcontroller for 2KRO.

Hmm, I wonder if I can figure out how to modify the code for a sense/sense theory of operation for "easy" 2KRO drop in controller, instead of the sense/strobe currently employed in other keyboard designs (and will be applied to the NKRO model)

Offline dorkvader

  • Thread Starter
  • Posts: 6288
  • Location: Boston area
  • all about the "hack" in "geekhack"
Re: Hall Effect switch electrical characterization.
« Reply #12 on: Sun, 09 April 2017, 10:54:12 »
update. I got some 2n2222 and 2b3904 in the mail, I'm deciding which is better for use here. I think 2n2222 becuause higher hfe, but I understand usig a transistor as an amplifier much more than using it as a switch in the saturation zone.

So for now I research and learn and for later I Will play with it more. I might just hack up a test circuit and then play with it until it's about right, then scale it to be a full kb.

oh I almost forgot: I need to test all my hall kbs to see if they sent a pulse or not, I think my current test board is good because it has key repeat, even if it was 1kro.

the bud Honeywell keypad is spec'd to 1us max rise and fall time (to 90%), which is much better than what I'm seeing here. I think I'm going to test with that and see what I can come up with

link https://drive.google.com/file/d/0B4Wyz4bY7XjLNTdiMjFkNjEtMWI1Yi00YWQ3LTk3ZDctMzkxOTAzY2VjOTdj/view
« Last Edit: Sun, 09 April 2017, 11:02:50 by dorkvader »