Code Monkey home page Code Monkey logo

diy-racing-sim's Introduction

Ultra Cheap Racing Sim

This super basic simulator uses an arduino UNO to sample inputs from accelerator and brake pedals driven by potentiometers and a rotary encoder for steering.
The data is outputted serially and is read by a python script. The script taps into the Vjoy ( virtual joystick ) python api to simulate gamepad input calls.
The vjoy interface DLL must be in the same folder as the script and Vjoy must be installed. This can be further hooked into x360 to emulate Xinput. The polling rate can be specified in x360ce and the sampling rate in the .ino code.
This project will cost less than INR 500 or about $7 if you already have an Arduino UNO. Add a bit more if you don't.



Installation requisites

Vjoy - http://vjoystick.sourceforge.net/site/index.php/download-a-install/download
Pyvjoy ( python library for vjoy ) - https://pypi.org/project/pyvjoy/
X360CE (just in case your game doesn't like vjoy ) - https://www.x360ce.com/

Hardware

The hardware requirement will greatly vary depending on how you want to make it but here is what I used:

  1. Two 5k potentiometers for foot pedals
  2. 2cm diameter springs for pedals
  3. Arduino UNO for reading inputs ( make sure to use a microcontroller with few analog inputs and atleast interrupt functionality on 2 pins)
  4. KY-040 rotary encoder
  5. LEGO for supplementary stuctures
  6. Wood from a 2000 year old oak tree :)

Results


Working video
The video is at media/video.mp4 . The gif given below is because I cannot attach video in this readme. The input lag is due to the game and my laptop being kinda slow, but the system in itself works all right.


Steering column is connected to encoder with hot glue

Foot Pedals View

Potentiometer driving mechanism

diy-racing-sim's People

Contributors

siddharthlh24 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.