Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Auto switching Nanao MS2930 with Arduino.  (Read 10312 times)

0 Members and 1 Guest are viewing this topic.

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Auto switching Nanao MS2930 with Arduino.
« on: January 13, 2016, 05:10:11 am »
Hey guys,

I just wanted to share a project I've just completed - I've modified my MS2930 monitor to auto switch video modes based on the horizontal sync being sent to the monitor over the VGA connector.

The first thing I did was go out and buy an Arduino, a breadboard, some push pin wires, a pack of assorted resistors and some MOSFETs suitable for use with an Arduino (the "logic" type that can be switched using 5v on the gate).

I then did a bit of a search and found this Arduino library for measuring the frequency of an input.  Hooked up Digital Pin 5 from the Arduino to Pin 13 from the VGA output of my PC.  I found the easiest way to achieve this was to use 2 gender changer plugs (1 male, 1 female), then cut the shielding on the bottom side of one of the male connectors and fold it back so there isnt a sharp edge along the bottom.  I then simply inserted a wire into Pin 13 (bottom middle pin) of the female gender changer and then connected the male gender changer to hold the wire in place.  Inserted the combined gender changers into the VGA output from the video card and then connected the regular VGA cable going to the arcade monitor.

So, that allows me to monitor the horizontal frequency of the current video mode and then I can set some variables to mirror the behavior of setting the video mode dip switches.

Now need to figure out the best way to replace the physical dip switches on the remote board.. I have a Blast City cab and found that getting access to the remote board is near impossible without dismantling the cabinet.  This isn't something I really wanted to do, so I looked for alternatives.

I then noticed that the remote board was connected directly to the monitor via a 12 pin ribbon cable - one of those pins must carry the value of the dip switches.  It turns out that Pin 12 does indeed serve this exact purpose  ;D

I then set out to replicate the circuit that the dip switches are connected to on my breadboard.  It's a pretty simple circuit that takes a 12v input, then through a series of resistors alters the voltage.  This worked out to 31kHz = 10.16v, 24kHz = 6.03v, 15kHz = 2.14v.

Then instead of having dip switches, I have 2 MOSFETs serve the same purpose, but controlled via software running on the Arduino.

I have created an example of the circuit layout on 123d.circuits.io.  If you click the Run Simulation button, set the voltage on the power supply (the top dial) to 12v and you will see it cycling through much the same voltages as I outlined above (the MOSFETs have a very little amount of resistance, so the voltages won't be exact, but they're good enough for this job).

So, finally, we need to bring it all together.  For the 12v and Ground connected to the breadboard in my sample circuit, it just so happens that pin 11 of the ribbon connector going into the monitor is Ground and pin 10 is 12v! How convenient ;)

The point that the multimeter connects to in the sample is where I get the value for pin 12 of the ribbon cable - the one that tells the monitor the hsync mode to use.

I then wrote this code to run on the Arduino that ties it all together:

Code: [Select]
#include <FreqCounter.h>

long int frq;
bool dip1 = false;
bool dip2 = false;
int dip1pin = 7;
int dip2pin = 8;

void setup() {
  pinMode(dip1pin, OUTPUT);
  pinMode(dip2pin, OUTPUT);
}

void loop() {
  FreqCounter::f_comp= 8;             // Set compensation to 12
  FreqCounter::start(1);            // Start counting with gatetime of 100ms
  while (FreqCounter::f_ready == 0)         // wait until counter ready

  frq=FreqCounter::f_freq;            // read result

  if(frq >= 30) {
    dip1 = false;
    dip2 = false;
  }
  else if(frq >= 20 && frq < 30) {
    dip1 = true;
    dip2 = false;
  }
  else if(frq >=10 && frq < 20) {
    dip1 = false;
    dip2 = true;
  }
  else {
    // invalid frq, don't change dip switches
  }

  digitalWrite(dip1pin,dip1);
  digitalWrite(dip2pin,dip2);

  delay(10);
}

With all of that done, it's time to crack open a beer and play some games  :cheers:

Hope someone else out there finds this little guide/write up helpful.  I know there's plenty of people out there that have MS2930's that secretly wished they had a MS2931 - well, now they can!  ;D

Finally, if you made it this far and want to see it in action, here's a quick demo video I made!

Replacing this (the first 2 switches):


With this:


The gender changer plugs with the wire connected to pin 13 (hsync):


The ribbon cable that carries the video mode signal we need to replace (this is located at the bottom front of the monitor, directly behind the bezel):


« Last Edit: January 13, 2016, 12:56:29 pm by chrisvg »

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #1 on: January 13, 2016, 06:59:07 am »
Just wanted to add that I wasn't quite sure if this post belongs in here or the Monitor forum board.  If a mod feels this belongs in the Monitor section then please feel free to to move the thread :)

baritonomarchetto

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 821
  • Last login:Yesterday at 02:57:48 am
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #2 on: January 13, 2016, 10:57:11 am »
Very interesting project!

obcd

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 160
  • Last login:April 03, 2019, 11:44:36 am
  • I want to build my own arcade controls!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #3 on: January 13, 2016, 02:29:02 pm »
Just Curious, is it known to be safe to switch the frequency of that monitor without first switching it off?
Also, don't it need some adjustments for every frequency? (Like horizontal and vertical position)

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #4 on: January 13, 2016, 06:26:09 pm »
Just Curious, is it known to be safe to switch the frequency of that monitor without first switching it off?

Honestly, I don't know if it causes damage to the monitor.  I'm no electronics or monitor expert, I'm just some dork that got sick of opening the control panel to flip some switches!

Also, don't it need some adjustments for every frequency? (Like horizontal and vertical position)

I use CRT_Emudriver on the PC that is hooked up to my cab and have configured each video resolution to fit as well as possible horizontally, so that's one thing I don't need to adjust.  But you are right, some video modes will need adjusting to look perfect on the screen, most notably vertical size.

One motivating factor for doing this project was to be able to run games that switch resolutions dynamically, one such example of this is Radiant Silvergun.  Now I can run the game and have a nice high res title screen, while the actual game itself runs at low resolution with visible scanlines.

DebGugel

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:March 08, 2019, 05:01:01 pm
  • I want to build my own arcade controls!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #5 on: January 18, 2016, 01:02:51 pm »
Can you please share some more details here?
I want to know about the specifications of the all hardware components you are using.
Also share the schematic if you can share please.

seo expert
« Last Edit: March 08, 2019, 05:01:31 pm by DebGugel »

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #6 on: January 19, 2016, 01:45:01 pm »
I want to know about the specifications of the all hardware components you are using.
Also share the schematic if you can share please.

Hi Deb,

If you click the 123d.circuits.io link in my original message you will see a breadboard circuit layout with components.

The components I used are: Arduino Uno, 2x 10k Resistor, 1x 2.2k Resistor, 1x 56k Resistor, 2x N-Channel MOSFET 60V 30A.

Hope this helps!

burn_654

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 159
  • Last login:April 29, 2025, 04:25:44 pm
  • I want to build my own arcade controls!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #7 on: April 08, 2016, 04:47:33 pm »
You mention Radiant Silvergun - is this the arcade version running on Mame or a Saturn emulator like SSF? If it's the latter I never had luck running the game in native res. on a 15khz display...though the details escape me as it's been a while. I just remember going with the Saturn emu and dealing with it being in interlaced mode. Which emu is supporting the resolutions changing?

chrisvg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 28
  • Last login:August 03, 2019, 09:47:50 pm
  • Blast City fanboy!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #8 on: April 09, 2016, 12:19:48 pm »
You mention Radiant Silvergun - is this the arcade version running on Mame or a Saturn emulator like SSF? If it's the latter I never had luck running the game in native res. on a 15khz display...though the details escape me as it's been a while. I just remember going with the Saturn emu and dealing with it being in interlaced mode. Which emu is supporting the resolutions changing?

Playing it using GroovyMAME, it automatically switches modes between the game itself (low res) and the title screen (high res).  I've only tried it on my tri-sync monitor and never experienced any issues.

burn_654

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 159
  • Last login:April 29, 2025, 04:25:44 pm
  • I want to build my own arcade controls!
Re: Auto switching Nanao MS2930 with Arduino.
« Reply #9 on: April 09, 2016, 02:52:58 pm »
Good to know, thank you!