An innovative solution to integrate an analog plunger into digital pinball games. This project utilizes an ESP32 microcontroller to convert potentiometer input into gamepad Z-axis movements over Bluetooth, allowing precise control of pinball plungers.
- Converts potentiometer values to Z-axis input for Bluetooth gamepads.
- Configurable via a built-in web server hosted on the ESP32.
- Smoothing and dead zone adjustment for stable and accurate control.
- Automatically restarts Bluetooth advertising when disconnected.
- Fully customizable potentiometer pin and value ranges.
- ESP32 microcontroller.
- Potentiometer (e.g., linear slider or rotary).
- A Windows or other Bluetooth-compatible device for connecting the ESP32.
- Optional: AutoHotkey (if you wish to map gamepad inputs to mouse movements).
- The potentiometer reads the plunger's position and sends smoothed, mapped values to the ESP32.
- The ESP32 acts as a Bluetooth HID device, transmitting Z-axis changes to the connected computer.
- A web-based configuration page allows adjustments to the potentiometer settings.
- Optional: Use AutoHotkey scripts to convert gamepad Z-axis inputs into mouse movements if required by specific pinball games.
-
Connect the potentiometer to the ESP32:
- Signal pin to the configured ADC pin (default: GPIO 34).
- Power and Ground to appropriate ESP32 pins.
-
Power the ESP32 via USB or another suitable power source.
-
Install the Arduino IDE and set up ESP32 board support:
- Follow the ESP32 Board Installation Guide.
-
Clone this repository and open the
.ino
file in Arduino IDE. -
Update the
ssid
andpassword
variables with desired Wi-Fi credentials for the ESP32's web server. -
Upload the code to the ESP32.
- Connect to the Wi-Fi network created by the ESP32 (
ESP32_Plunger
by default). - Access the web server at
http://192.168.4.1/
. - Configure the potentiometer pin, rest value, and max value as needed.
- Save the settings to restart the ESP32 with the new configuration.
- Pair the ESP32 as a Bluetooth device on your computer.
- Open your pinball game and map the plunger's Z-axis to the appropriate in-game controls.
- For games that require mouse input for the plunger:
- Install AutoHotkey.
- Use an AutoHotkey script to map the Z-axis to mouse movements.
; Map gamepad Z-axis to mouse vertical movements
#Persistent
SetTimer, CheckJoystick, 10
CheckJoystick:
JoyZ := GetKeyState("JoyZ")
MouseMove, 0, JoyZ * 5 ; Adjust multiplier for sensitivity
return
-
Bluetooth Issues:
- Ensure the ESP32 is powered and advertising.
- Unpair and re-pair the device if it does not respond after a reboot.
-
Potentiometer Not Detected:
- Check wiring and ensure the correct GPIO pin is configured.
Contributions are welcome! Feel free to submit issues or pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
Special thanks to the pinball community for inspiring this project and to the developers of libraries that make ESP32 Bluetooth HID devices possible.