Skip to main content

Make Arduino Steering Wheel for Gaming!

Can one single board give you the feel of Gaming Steering Wheel?

Behold! Here it comes people. With just few components you can make one that is super reliable and effective too.

Intro

We all love playing games. To control games we need controllers, usually that is our keyboard + mouse combination or for some games on phone it's gyroscope. I saw some people make gaming steering wheel but one main problem is those are attached to something, which means they are not portable.

My idea was to design a single controller for racing games that will give the steering wheel vibe and will also come with all the buttons I need. But it has to be movable, so that I can take it anywhere and play on the go. 

Components



The components are minimal, you can find them at nearest hobby store at a very cheap price

  1. IMU 6050 - 1x
  2. Arduino Pro Micro - 1x
  3. Small LED - 2x
  4. Mini Push Button - 4x
  5. 10k Resistor - 4x (For buttons)
  6. 330r Resistor - 2x (For led's)

Those are the primary components, for soldering things in place you may need (optional):

  1. Female Header
  2. Male Header
  3. Soldering Wire

And one micro USB cable to connect the board to pc an upload program, and for later purpose too.

The whole system is going to be powered from a USB cable that plugs into arduino and goes to all other components. This makes the design more reliable and super cool.​

How it works


Although that looks like a baby's drawing, that's actually my design! Look doesn't matter as long as it is functional, right? Jokes apart, lets get and idea on how the whole system will work.

The controller will will work like our pc's keyboard and mouse, pressing forward, left right etc. I used Arduino pro micro for that. To get the steer wheel vibe without connecting to any potentiometer I used IMU6050 (Inertia Measurement Unit) to measure Y axis data, that will point out the tilting. And some buttons for pedal, brake, nitro etc.

I targetted​ Beach Buggy game's pc's version, it's light weight and runs on simple pc's too. To customize the controller with the game what is does is - 

  • Auto accelerator is on,
  • For left right tilt presses - left_arrow, right_arrow
  • For power/boost presses - 'z'
  • For Character Power presses - 'A'

The whole system is going to be powered from a USB cable that plugs into arduino and goes to all other components. This makes the design more reliable and super cool.

Circuit Diagram



The circuit diagram is simple and easy. I used ​EasyEDA online editor. One advantage of this system is I don't need to install anything on my pc, thus it doesn't put that much pressure on pc. 

Drag and drop things from left menu, find the components in the library section. If you use any components make sure it has prints (white masking image will be shown) otherwise it will be a disaster. Connect everything in place and double check. Those are tips for you guys, I already have made the design, you can see that (Image).

Designing the PCB





PCB making is super easy, when it comes to custom shape - in my case I wanted it to look like a steering wheel - it becomes tricky. I used the wheel on the 2nd image (without background) as a reference and drew all the lines by hand. Man, this takes everything out of you. I used easyEDA here too.

Okay once done I removed the image and​ made everything as PCB border. That gave me the shape. Then I placed things in place and made the PCB. 

One thing to remember, only one 5v source powers the whole system. So current could be an issue here. That's why I used track width = 0.300 mm. It can pass 1A current easily. After I was satisfied, I exported the pcb gerber file to my pc.

For printing the PCB I used ​PCBWay service. From there I could print 10 two-layer PCB by only 5$! Which is very very cheap. I used ​pcb-instant-quote which is a smart system to do everything automatically. I uploaded the gerber file and the system detected layer information, masks everything instantly. 

It took 3 days to reach the pcb's from China to Bangladesh of which I had no idea, that's insanely faster than I could imagine. The pcb's look great. All the traces, the masking looks great. I can't believe how they can deliver such quality product in this price range. The finish looks wowsome. The shiny glassy look takes the pcb to another level. I designed them but you know what? The pcb's are inspected by PCBWay's engineering team to deliver me a better product. I am amazed at their service.

PCBWay also sponsors student projects, if you think you have a great idea and need help you can contact them.

Enough talking, now let's solder things.

Solder everything




​This is a straight forward process, put things in place and solder. Please be careful, do not inhale the fume that comes from the soldering iron. I used optional components (female headers) as I like my devices as - PLUG n Play. Because if one component damages I can easily replace it.

I saw PCB's bend a little after soldering (due to the massive heat of soldering iron) but this PCB stood in place. Thanks PCBWay.

Upload Code

Now it is time to upload code. The program is written in Arduino code which is C++ (kind of yes). 

You can download the full code from ​here or copy from below, Although I prefer to download from github as code doesn't break that way.

At first I imported keyboard library, then defined button and led pins. In the setup section I set things up, this section runs only once. Inside the loop (which runs till the eternity) I check for button press, if pedal button is pressed then it it checks for IMU (Y position) - tilt- movement and presses left right accordingly. If the brake button is pressed it presses 'down arrow' button, if nitro - 'z', if nitro is pressed twice 'A'. The two led's indicate left right movement so that while looking at the screen you can have a sense of left-right trigger.

As I have used arduino, I can anytime customize it according to my need, for any games.

/*** PCB Steer Gaming Wheel ***
 *  
 *  Author: Ashraf Minhaj
 *  Mail: ashraf_minhaj@yahoo.com
 *  
 *  Licence: Copyright (C) Ashraf Minhaj
 *  GNU General Public License v3.0
 */


#include <Keyboard.h>
#include<Wire.h>

// Threshold value for steering
int THRESHOLD = 4000;

// Controller buttons
int brake = 5;
int nitro = 6;
int pedal = 4;

// Indicator LEDs
int left_led = 8;
int right_led = 9;

int x;
int y;
int z;
 
const int MPU_addr=0x68;  // I2C address of the MPU-6050

void indicator_blink()
{
  // blinks the leds - 5 times
  int i = 0;
  
  for(i=0; i<5; i++){
    digitalWrite(left_led, HIGH);
    digitalWrite(right_led, HIGH);
    delay(100);
    digitalWrite(left_led, LOW);
    digitalWrite(right_led, LOW);
    delay(100);
  }
}

void setup(){
  // set pin mode and initialize things
  pinMode(brake, INPUT);
  pinMode(nitro, INPUT);
  pinMode(pedal, INPUT);

  pinMode(left_led, OUTPUT);
  pinMode(right_led, OUTPUT);
  
  Serial.begin(9600); 
 
  Wire.begin();
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x6B);  // PWR_MGMT_1 register
  Wire.write(0);     // set to zero (wakes up the MPU-6050)
  Wire.endTransmission(true);

  indicator_blink();
}

void loop()
{ // Main loop that runs forever
  
  Wire.beginTransmission(MPU_addr);
  Wire.write(0x3B);  // starting with register 0x3B (ACCEL_XOUT_H)
  Wire.endTransmission(false);
  Wire.requestFrom(MPU_addr, 14, true);  // request a total of 14 registers
  
  x = Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)    
  y = Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  z = Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)


  if (digitalRead(brake)){
    Keyboard.release(KEY_UP_ARROW);
    Keyboard.press(KEY_DOWN_ARROW);
    //Keyboard.press(217);
  }
  
  if (digitalRead(nitro)){
    delay(10);
    Keyboard.press('z');
    if (digitalRead(nitro)){
      Keyboard.press('A');
    }
  }
    
  else if (digitalRead(pedal)){
    Keyboard.release(KEY_DOWN_ARROW);
    Keyboard.press(KEY_UP_ARROW);
    //Keyboard.press(218);
  
    if(y < -THRESHOLD){     
          Serial.print("    Left    ");
          Keyboard.release(KEY_RIGHT_ARROW);
          Keyboard.press(KEY_LEFT_ARROW);
          digitalWrite(left_led, HIGH);
      }
  
    else if(y > THRESHOLD){     
          Serial.print("    Right    ");
          Keyboard.release(KEY_LEFT_ARROW);
          Keyboard.press(KEY_RIGHT_ARROW);
          digitalWrite(right_led, HIGH);
      //Keyboard.press(37);
      }
     else{
          Keyboard.releaseAll();
     }
   }
   
  //Serial.println(y);
  delay(10);
    digitalWrite(left_led, LOW);
    digitalWrite(right_led, LOW);
}

Upload the code from Arduino.ide and two led's that indicate left right tilt will blink five times. Which means the board is ready to go.

 Finish:

Now it’s finally the time to test. Let’s see how this thing works.



Wow, would you look at that! This thing works just like I wanted. Although it requires some practice to go along as it’s new for me. Thank you.

Comments

Popular posts from this blog

Make a Smart Phone Controlled Robotic Arm ! Arduino DIY.

Making ROBOT ARMs is very popular and fun among hobbyists, but it's not that easy to control a ROBOT ARM. So today we'll be making a robot arm that can be controlled using just your Android Smartphone or tablet. Good news is, you just need to program the Arduino, the App is already available to download for free. Step 1: Parts You'll Need 2 More Images Servo motor 4x (I'm using micro servo Sg90 but any model or size is okay) you can use upto 5 servo for this robot arm, I've only 4, so I'm using them. sliced piece of Card Board - to make the body. USB OTG (on the go) [pic3 & 4- all the same] And of course a Arduino board (any board) And a few jumpers to make the connection And a 9v battery to power the servo motors. Step 2: Making the Robot Arm (THE BODY) Now in here I'm actua

Make a Smart Humanoid Talking Robot- MOFIZA.

This Robot - Mofiza - (weird name) Can SEE , TALK and REACT to her surroundings. Before I proceed watch the video: Ever since I've seen making talking robots I saw that people actually use other development boards rather than Arduino to make talking robots. But it's completely possible to make a Humanoid robot with Arduino who can talk and add a lot of servos to make it move. So lets begin: Step 1: Parts You'll Need Arduino Pro mini (5v 16 Mhz) [any board is good but i've used this to make it small) Female header pins for connecting on pcb Male header pins Vero Board to make the circuit Sd card TF module (to make it talk) micro sd card (not more than 2GB) 3x IR proximity sensor 3x servo motor (I've used micro servo sg90) Cardboard to make the body Step 2: Connecting IR Sensor and the Body Make a

Make AI Assistant Robot with Arduino and Python

Introduction: We all are familiar with ‘Jarvis’ AI assistant robot from “Iron Man’ movies and Marvel series. It has always been a dream of programmers to make something on their own. I will today show a simple way to make such an assistant using Python programming. Moreover, I will also make a physical avatar of that robot, so that whenever we talk to the robot, it can do some movements. That will be more amazing than just a software robot. Because if it has a body, it is cool. So today we will learn to use both Arduino and Python programming to make an AI robot which can control your computer and have a little chit chat with you. Let’s hop in guys! Why I named the robot ‘Jaundice’? Because I painted it yellow, very very yellow!   Parts: Electronics - Arduino Nano – 1x Micro Servo Sg90 – 3x Ultra Sonic Sensor HCsr04 – 1x Body – PVC sheet (preferably white, better for coloring, I used blue one) Servo wheel (for the stand) Tools -  Cutter knife Scissor Hot glu

Arduino Automated Parking Garage

An Arduino Automated Car Parking System that is too easy and too fun to make. When a car arrives it shows the number of empty slots (if available) and then opens the gate. if there is not any empty slot then the gate does not open.  Amazing thing is that the whole project can just be POWERED using a POWER BANK!! Watch the video for the full tutorial. Note: you can use display instead of my hand made led sign display. Now lets get started. Step 1: Parts Arduino  - any board Infrared proximmity sensor  (pic 2 & 3 - both are functional) 330r resistor some  LED 's Servo motor  - any model or size you wish. Step 2: Making the LED Display To make this  LED display  I have used a piece of bredboard then soldered the LED's and the 330r resistor. Then just added a ribbon cable f

Problems using PIR sensor?? Always HIGH? DELAY? Solution is here.

PIR sensor When I was working on a project "controlling home appliances using just a wave of hand" I had used a PIR sensor and found some issues: PIR doesn't work properly when starts. PIR output value is always 1. It some times doesn't read motions. Now those are three Common and Unavoidable problems of a PIR sensor. So what would we do? I assume you know what a PIR sensor is and I'll just try to give a solution to the problems so that you can use PIR in your project efficiently, also I've added a code below on how to solve that problem. As I have mentioned earlier those are Common and Unavoidable,  keep 3 issues in mind: After powering - PIR sensor needs 1 minute to function For that 1 minute the OUTPUT is always HIGH. When a motion is detected it'll take 5 to 7 seconds to detect motion again. SOLUTION: After powering - PIR sensor needs 1 minute to function:  which means when you'll power a PIR sensor it wi

Control Anything Over Internet / WiFi. IOT Light Switch_ NodeMCU ESP8266 .

Parts: NodeMCU ESP8266  WiFi Development Board LED 330r resistor Android app Download the app from Below , To Upload code to NodeMCU using Arduino.ide Update Arduino.ide (desktop app) start Arduino app goto  Files > Preferences  Then  paste the link  then press  ok.    http://arduino.esp8266.com/stable/package_esp8266com_index.json goto  Tools>Boards> Board Manager  then wait untill it finds ESP8266 properties Scroll down and  click install Then Restart the Arduino App. Now you can upload Code in C / C++ to NodeMCU ESP8266 using Arduino.ide Getting IP Address Code T o get the IP Address (Internet Protocol Address) Upload this Code and open serial monitor. #include <ESP8266WiFi.h> const char* ssid="WIFI name"; const char* password = "WIFI PASSWORD"; int ledPin = 13; void setup() { pinMode(ledPin,OUTPUT); digitalWrite(ledPin,LOW); Serial.begin(115200); Serial.println(); Serial.print("Wifi co

How to use ServoTimer2 Library with Arduino- full tutorial.

Introduction I've been trying to make a humanoid robot  MOFIZA -Arduino Talking Humanoid Robot.  recently- which means dealing with Servo motors. Everything worked just as fine just before I tried to make the robot TALK. When I needed to use the TMRpcm library. But there's some libraries like #TMRpcm .h #VirtualWire .h are libraries that use the Timer1 of Arduino. It appears that you can't use two devices simultaneously where both use the same timer...So, if my robot talks- the servos don't work. Because The Servo.h and the TMRpcm both works on Arduino TImer1. Which is a mess. If you want to make both of them work you have to use another library for servos. Which is ServoTimer2 library? This uses the Timer2 on Arduino...Unfortunately on internet I haven't found any tutorials to understand how this ServoTimer2 library actually works, and how to use it in code. So, I've decided to make a tutorial so that people like me can understand better. We'll be u