Part 1. Hardware
Beginning
The first idea was to implement a physical speed gauge for BVE5 train simulator. Fortunately I had a few dirt cheap stepper motors 28BYJ-48, a fake Arduino Nano, a fake CNC shield and some fake drivers.
The drivers are made for bipolar steppers, whereas 28BYJ-48 are unipolar. Luckily there's a remedy for that and it's well documented by a number of kind people.
Thus the first step was made: a speedometer for BVE5.
This was a good beginning.
Inputs
I took a nice donor RC remote with a couple of sticks and some switches. A train controller needs some fixed positions, for example 5. The RC sticks already have a mechanism for some clickiness in them, but they are to smooth. I filed some big notches and made a harder spring from a large paperclip. This can't compete with a real train controller, but it's enough for a child's toy.
There are two more analog inputs: brake lever and a reverser lever. The reverser is not really analog, but it was easier to implement it using a potentiometer.
Digital inputs are 2 toggle switches for various things, and two buttons, mostly for tooting. Trains toot a lot.
Box
The project is housed in a reasonably sized wooden tea box.
Pictured here are the throttle stick, a brake pot and everybody's favourite controller.
Speedometer revisited
There's a problem of resetting to 0 when the game starts. I contemplated an idea of zero setting, and even considered a complete overkill of using a BLDC servo from one of my earlier projects. Then I read somewhere that these steppers have a friction clutch because they're used in air conditioning systems. So they don't have to have any end switch, you just spin them and they slip, and that's how they can be reset.
I implemented the same thing. There's a little screw in the face plate that doesn't let the needle to go past zero, and that's it!
Clamps
Such a versatile controller is useless without clamps, so it has got clamps. I found fantastic parametric clamps by [akaJes] and updated them so that they fit snugly with my teabox.
The clamps really made the box usable:
For the cables:
The box from the inside:
Buttons
Simple tactile switches in a harness. It's easily my favourite mechanical bit. They are really fun to press.
Now the box needs some means of closing. After some deliberation I decided to simply make angles that would kind of squeeze it together. It works surprisingly well. Also, face plates to cover the rest of the box.
#iseefaces
Like so.
Here's what it looks like now. Pardon the dirty table.
There's also a multipurpose LED. In BVE5 it indicates closed doors/clear to go.
Part 2. Software.
Coming soon...
Интересно, а как вы получаете данные скорости из игры?