Arduino

Introducing SimHub with Games: Harnessing the Power of Custom Serial Data

Introducing SimHub with Games: Harnessing the Power of Custom Serial Data

In the world of sim racing and gaming, immersion is key. From realistic physics to detailed graphics, every element plays a crucial role in making the experience as authentic as possible. One tool that has revolutionized the way gamers and sim racers interact with their setups is SimHub. This powerful software allows users to create and customize dashboards, displays, and gauges, transforming any gaming setup into a sophisticated simulation environment. In this article, we’ll explore how to introduce SimHub into your gaming experience, with a special focus on utilizing custom serial data to send data.

What is SimHub?

SimHub is a versatile software that connects your PC to various devices such as Arduino boards, LEDs, and displays, allowing you to enhance your gaming setup with additional visual and tactile feedback. It’s widely used in sim racing for creating custom dashboards, RPM gauges, speedometers, and more. The software supports a range of games and simulators, making it a go-to tool for gamers looking to elevate their experience.

Getting Started with SimHub

  1. Download and Install SimHub: The first step is to download SimHub from its official website and install it on your PC. The installation process is straightforward, and the software is user-friendly, even for beginners.
  2. Connect Your Hardware: Depending on what you want to achieve, you might need different types of hardware. Common setups include Arduino boards, LEDs, displays, and even force feedback systems. For our focus on custom serial data, an Arduino board is a great starting point.
  3. Configure SimHub: Open SimHub and navigate to the settings menu. Here, you can configure the software to recognize and communicate with your connected hardware. SimHub supports various protocols and connection types, making it easy to integrate with your setup.

Utilizing Custom Serial Data to Send Data Back to SimHub

One of the standout features of SimHub is its ability to send and receive custom serial data. This feature allows you to tailor your gaming setup to your specific needs, creating a more personalized and immersive experience. Here’s how to get started with custom serial data, focusing on sending data back to SimHub:

Step 1: Set Up Your Arduino

  1. Install the Arduino IDE: Download and install the Arduino IDE from the official Arduino website. This will allow you to program your Arduino board to communicate with SimHub.
  2. Connect Your Arduino: Connect your Arduino board to your PC using a USB cable. Ensure that the correct board and port are selected in the Arduino IDE.
  3. Write Your Sketch: Create a new sketch in the Arduino IDE. Here, you will write the code that enables your Arduino to send data back to SimHub.
void setup() {
  Serial.begin(9600); // Initialize serial communication at 9600 baud rate
}

void loop() {
  if (Serial.available() > 0) {
    String receivedData = Serial.readStringUntil('\n'); // Read data from SimHub
    Serial.println(receivedData); // Send the received data back to SimHub
  }
}

Step 2: Configure SimHub to send data.

  1. Open SimHub: Go to the “Add remove features”
  2. Enable serial: Activate Custom serial devices
  3. Set Up Serial Communication: Choose “Custom serial devices” (new menu feature) Configure the serial port settings to match those of your Arduino. Ensure the baud rate and COM port are correct.
  4. Define Data output: In the “Update messages” you can define how SimHub should send serial data.

If you click on edit and select “use Ncalc” down the bottom right there is an add property button. Try and use this while in a game as the data is provided live. Add your selection to the update message screen.

In my example I have just chosen to display the rev counts. You can use functions to format the data. In this case the revs are shown in multiple decimal points. Using the a built in function I reduce this to a whole number and add a new line to make it easier to read.

''+round([Rpms],0)+'\n'

Make sure you chose “log incoming data” under the serial options.

Depending on the size of your screen you may not see the terminal that is echoing back the data sent from Simhub, there is a slider on the side and you might need to scroll down slightly.

If your serial port selected properly along with your baud rate, your Arduino is connected and you can see data below the update message the Incoming serial data should match that which is sent out of Simhub.

This proves to us the data is being sent out of Simhub the Arduino is receiving it, interpreting it and sending it back to Simhub! That in itself is not entirely helpful, but it does prove that the two are talking and we move on to interfacing with the real world.

If you are not seeing any data come back from the Arduino make sure you have selected the correct port and baud rate in Simhub. Make sure no other programs are trying to access the serial port (Cura is good at this) and the terminal in the Arduino IDE is closed. Only one program can talk to the Arduino at once.

Benefits of Using Custom Serial Data with SimHub

  • Customization: Tailor your setup to your exact preferences, whether it’s creating a custom dashboard, controlling LED lights, or managing a force feedback system.
  • Enhanced Immersion: Adding physical feedback devices such as gauges and displays increases immersion, making the gaming experience more realistic.
  • Expandability: With custom serial data, you can continually expand and improve your setup, integrating new devices and features as needed.

Conclusion

SimHub, combined with custom serial data, offers endless possibilities for enhancing your gaming experience. Whether you’re a sim racer looking to build a custom dashboard or a gamer wanting to add unique feedback mechanisms, SimHub provides the tools and flexibility to make it happen. With a bit of creativity and some basic hardware knowledge, you can transform your gaming setup into a fully immersive simulation environment. Stay tuned for our next article, where we’ll cover how to attach a motor to your setup and control it using SimHub. Happy gaming!