After several days searching for a good DIY analog plunger I coudn't find anything that fits in my pocket. So I started a project with a Arduino Uno(actually a chinese version), but it works just fine. First of all: if you have a regular version of Arduino good for you , because you can just install UnoJoy and use your plunger. But if you bought a copy of arduino (like the CH340) you can follow this tutorial:
First of all, if you dont have any Arduino background I recommend you to search some videos about Arduino. Then follow this steps:
After downloading everything plug your potenciometer in your arduino like this:

You can use any analog port.
Then upload the following code to your arduino (this code is available in the vJoy directory):
#include "ibus.h"
// //////////////////
// Edit here to customize
// How often to send data?
#define UPDATE_INTERVAL 3 // milliseconds
// 1. Analog channels. Data can be read with the Arduino's 10-bit ADC.
// This gives values from 0 to 1023.
// Specify below the analog pin numbers (as for analogRead) you would like to use.
// Every analog input is sent as a single channel.
#define NUM_ANALOG_INPUTS 1
byte analogPins[] = {0}; // element count MUST be == NUM_ANALOG_INPUTS
// 2. Digital channels. Data can be read from Arduino's digital pins.
// They could be either LOW or HIGH.
// Specify below the digital pin numbers (as for digitalRead) you would like to use.
// Every pin is sent as a single channel. LOW is encoded as 0, HIGH - as 1023
#define NUM_DIGITAL_INPUTS 0
byte digitalPins[] = {}; // element count MUST be == NUM_DIGITAL_INPUTS
// 3. Digital bit-mapped channels. Sending a single binary state as a 16-bit
// channel is pretty wasteful. Instead, we can encode one digital input
// in each of the 16 channel bits.
// Specify below the digital pins (as for digitalRead) you would like to send as
// bitmapped channel data. Data will be automatically organized in channels.
// The first 16 pins will go in one channel (the first pin goes into the LSB of the channel).
// The next 16 pins go in another channel and so on
// LOW pins are encoded as 0 bit, HIGH - as 1.
#define NUM_DIGITAL_BITMAPPED_INPUTS 0
byte digitalBitmappedPins[] = {}; // element count MUST be == NUM_DIGITAL_BITMAPPED_INPUTS
// Define the appropriate analog reference source. See
#define ANALOG_REFERENCE DEFAULT
// Define the baud rate
#define BAUD_RATE 115200
// /////////////////
#define NUM_CHANNELS ( (NUM_ANALOG_INPUTS) + (NUM_DIGITAL_INPUTS) + (15 + (NUM_DIGITAL_BITMAPPED_INPUTS))/16 )
IBus ibus(NUM_CHANNELS);
void setup()
{
analogReference(ANALOG_REFERENCE); // use the defined ADC reference voltage source
Serial.begin(BAUD_RATE); // setup serial
}
void loop()
{
int i, bm_ch = 0;
unsigned long time = millis();
ibus.begin();
// read analog pins - one per channel
for(i=0; i < NUM_ANALOG_INPUTS; i++)
ibus.write(analogRead(analogPins[i]));
// read digital pins - one per channel
for(i=0; i < NUM_DIGITAL_INPUTS; i++)
ibus.write(digitalRead(digitalPins[i]) == HIGH ? 1023 : 0);
// read digital bit-mapped pins - 16 pins go in one channel
for(i=0; i < NUM_DIGITAL_BITMAPPED_INPUTS; i++) {
int bit = i%16;
if(digitalRead(digitalBitmappedPins[i]) == HIGH)
bm_ch |= 1 << bit;
if(bit == 15 || i == NUM_DIGITAL_BITMAPPED_INPUTS-1) {
// data for one channel ready
ibus.write(bm_ch);
bm_ch = 0;
}
}
ibus.end();
time = millis() - time; // time elapsed in reading the inputs
if(time < UPDATE_INTERVAL)
// sleep till it is time for the next update
delay(UPDATE_INTERVAL - time);
}
Note that the bold part of the code is where you define where you plugged your potenciometer. Upload this code to your arduino.
Now you have to overwrite some dlls at vJoySerialFeeder directory, just go to >> c:\Program Files\vJoy\x86 and copy two dlls: vjoyinterface.dll and vjoyinterfaceWrap.dll.
Put these dlls at vjoyserialfeeder directory. Then open vJoySerialFeeder and connect to your serial communication port (COM1, COM2...). Now, click on Add Axis and configure your potenciometer scale.
Now you can set your DIY plunger in Visual Pinball, but if your computer is in another language, rather than english, you may have problems with future pinball, to solve this problem just download a winXP dll an put into the Future Pinball's directory. You can download this dll here:
http://download1321....9ig/dinput8.dll
EDIT: I didn't explained how everything works, but if you have any questions just leave a comment!
Edited by igortor4, 04 August 2020 - 05:34 PM.