First test of a strain gauge trackpoint. I snapped one strain gauge while figuring out how to mount one well!

It sort of works! There's a lot of noise even though I stuck a 1uf cap on the analog pin. It's also not super sensitive - without the capacitor the signal is only barely visible through the noise.

There are proper load cell amplifiers for this - I think they'd be worth a try.

Here's a closer view of the setup. It's a 3D printed cross suspended above the table, with a strain gauge on one of the arms. The gauge is wired to a PCB with a Wheatstone bridge and an LM358 amplifier. The output from that is smoothed with a capacitor and then goes into an analog pin on the arduino.

I'm wondering how much of the noise is due to the wire length and lack of shielding, and how much is unavoidable.

Once my strain gauges arrived I built a version 2 of the strain gauge trackpoint, with both axes hooked up.

I've attached all 4 strain gauges to allow for temperature compensation later, but for now this seems to be ok. It's a lot more sensitive with the gauges superglued to the thing! Before they were secured with double sided tape, which must have absorbed some of the strain.

Great, I've somehow managed to (temporarily) brick both that Arduino and my backup one. Seems like the Mouse.h stops them properly connecting to my computer over USB, even without actually using anything from it.

The prototype actually works surprisingly well! It has no acceleration or anything and it's a bit slow, but once I added a dead zone it's already fairly usable.

Not sure if you can see it in the video once it's compressed, but it's moving the pointer.

I also printed a cute little TPU cap for extra grip on the screw head!

Added some mouse buttons to my pointing stick prototype. They're very much not ideal, but good enough for testing! Built into a keyboard you'd probably want them to be much lower profile.

I *think* I've successfully reverse engineered the strain gauge amplifier circuit.

It would be great if someone familiar with opamp circuits could take a look at the opamp bit at the bottom and tell me if it looks about right. I've got no idea.

Here are some links to buy the module:

I simulated the amplification portion of the BF350-3AA strain gauge amplifier. For the range of resistances I've seen across the strain gauge (348.8-351.2 ohms), a V_TUNE of 0.5V gets me a 0-5V output.

I think once I have some components decided (e.g. I can get a hold of 348R resistors instead of 360R) then I can re-simulate to tune the resistor values and thus the gain.

I made some slight modifications to the strain gauge amplifier circuit, to use through-hole components for prototyping and add some gain adjustment.

There'll be something wrong with it but that's why it's designed for perfboard rather than a proper PCB.

The capacitor values are complete guesses though.

The parts for the strain gauge amplifier have all arrived now so I tried assembling one on perfboard. As far as I can tell I've done it ok (after forgetting to connect V_excite to half the bridge circuit) but I can't manage to strip the enamelled wire.

Apparently the best way is to heat it with a 400°C soldering iron and plenty of flux, but that didn't seem to be working.

Once I get that connected I can actually start tweaking the resistances.

Once I got the perfboard strain gauge amplifier prototype properly connected to the gauges, it still didn't work.

The method of stripping the enamel off the wires that worked for me was sanding. Some ~600 grit sandpaper worked well.

I probed a few voltages and checked the connections but couldn't see what was wrong.

So the next step was to do what I should have done in the first place - build it on breadboard!

I assumed that there'd be some dodgy connections so I had skipped it. There are, but it still mostly works!

I've found some settings for feedback resistors and V_TUNE that seem to work well - time to figure out what gain it actually gives me!

It looks like the gain values I settled on were -41.3 for stage 1 and 9.125 for stage 2. The second stage could probably be turned down a bit to allow for the signal to be offset a bit.

I'm kind of wondering why I couldn't just do that amplification in one stage - amplify by ~400x instead. I guess that makes it harder to adjust the offset.

The V_TUNE I ended up with was 1.040V, which I think means the bridge circuit is a few tens of millivolts offset when the trackpoint is centred. Not bad.

Tried out using a single inverting amplifier with a gain of 100x on the strain gauge bridge circuit. It seemed workable, with a range of ~0.75V when wiggling the stick.

I might increase that by changing resistors later, but I think that this could work to keep it simple. It means that I can use a single LM358 to amplify both axes of the pointing stick. Exact resistor values can be decided later - I think it would be good to actually get PCBs made!

I was able to use the 2.5V from the TL431 as the Arduino's AREF, so it could get more resolution in the right range. I haven't yet done the calculations to figure out the tolerance on the centre voltage. It would probably be wise to allow me to select whether the AREF is 2.5V or VCC.

I killed the strain gauges of one axis of the pointing stick prototype, so I put together a neater one. This one has the magnet wire connect straight to a rigidly mounted thicker wire, which will hopefully make it a lot less fragile!

I think if I do a proper version of this, it'll need to use something surface mount, because this took hours.

Is this a thing you can do with a digital potentiometer? It would be a way to get high resolution in a small range without needing a really high res DAC.

Otherwise, are there (cheapish) DACs where you can set two voltages for the output to be between?

I'm considering replacing the reference arm of the strain gauge bridge circuit with something like this. That way the microcontroller can set the reference point to zero it easily.

The MCP4251 seems like a solid choice for a digital potentiometer. It's a dual pot one so I can do both X and Y channels.

The plan is to have the output from that be the reference for the strain gauge amplifier. The microcontroller can increase and decrease it to find/set a centre voltage when you're not touching the trackpoint. Should provide a good way to automatically correct any minor drift.

The MCP4251 digital potentiometer worked pretty well for adjusting the opamp bias! Unfortunately once I tried to get it to adjust automatically, some connection somewhere went dodgy and I couldn't get any further. I think it's time to make a proper PCB for this.

Schematics for the pointing stick are coming along! It still needs some tidying up but I think this is enough to get it working.

With this I can make a ~40x40mm board that can be used over USB as a trackpoint, or over i2c with a keyboard, or just output raw analog voltages.

If this works, the version after this could use the PCB itself as the beam the strain gauges are mounted to!

So far the layout is just a mess but I've kinda grouped stuff to get an idea of the size needed.

I'm going for TSSOP packages, which are smaller and more of a challenge to solder than I'm used to, so that will be fun.

Successfully making more of a mess. This is what happens when you don't plan anything, just make it up as you go along.

Aaand that's a PCB. I would check it more buuuut... yolo

Maybe on the next version I'll make sure the connectors are actually on a sensible 0.1" grid. Oh and less of a routing clusterfuck.

Eagerly awaiting delivery of my pointing stick PCBs. They happen to be arriving on my day off, but unfortunately it looks like it's gonna be towards the end of the day. All DHL will tell me is they'll be delivered "by end of day"

Yay the pointing stick PCBs arrived! They're pretty small, but I think I can go even smaller once I remove the debug stuff.

It took 1.5 hours but I finally have the difficult bits soldered on! USB port, and the TQFP and TSSOP packages.

I think I'll add the bare minimum for the microcontroller and then try plugging it in.

Just noticed the first mistake in the PCB - the VDD pin on the ICSP header is labelled as a second reset. That's why I get for copying and pasting.


Somehow the microcontroller worked first time! I got an LED blinking, so I populated the rest of the PCB, except for the non-essential stuff. Further testing will have to wait until tomorrow.

Doing the fine pitch stuff made me really wish I had a hot air soldering station. It's definitely on my wish list for next time.

The pointing stick PCB is now acting as a mouse over USB. Probably should have added some pins to add buttons. Ah well, future stuff.

The plan is for this to act as an i2c peripheral. I have no idea what a normal way to do that would be. Maybe have some registers that can be written for settings, and read for position/acceleration? I also have an "interrupt out" pin that could be used when the position changes by a certain threshold?

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!