Monday, October 9, 2023

The Cheap PS/2 Arcade Trackball

Broken trackball? Not working? Curious about the innards?

I bought one of those cheap / inexpensive PS/2 trackballs off eBay for my arcade system.

It goes by a few different titles:

Illuminated 4.5cm Round PS/2 PCB Connector Arcade LED Trackball Mouse + 4 Screws

4.5cm Illuminated Round PS/2 PCB Connector Arcade LED Trackball Mouse + 4 Screws

It has a large "H" printed on it. Newer ones on eBay are labelled with "KM".




An overly aggressive friend hammered the trackball during a game of Golden Tee, cracking a plastic part inside. I had to fix it, but this lead me to do a complete teardown, 3D model of the inner plastic, and sketch of the PCB.



Here is the PCB as well as a schematic. This schematic is NOT perfect. I threw it together haphazardly. The red and green LEDs I didn't map out because I'm lazy. The optical phototransistor is purely a guess.



The hardest part of figuring this out was the phototransistor. I had to find a phototransistor with dual sensors, which isn't very common in my searching. I finally found it with the company Everlight. They go by the name Everlight Electronics Co., Ltd.

They have four versions of this phototransistor. Here is my best guess what the variance between them is...

PT2559B/L2-F - short leads, -25 ~ +85℃
PT2559B/L2/H2-F - same as above, but with longer leads

PT5529B/L2-F - better operating temperature vs the above. Short leads, -40 ~ +85℃
PT5529B/L2/H2-F - same as the above, but with longer leads

I can't say for sure if I'm right. This is just my best guess.

Here is my best guess BoM...
Name Designator Quantity
47pF C1,C2,C3 3
100nF C4 1
10uF C5 1
100nF C6 1
22272041 CN1,CN2 2
1N4148-35 D1,D2,D3 3
PT2559B/L2 LED1,LED2 2
1.2k R1 1
680k R2,R3,R4 3
47 ohm R5,R6,R7 3
51k R8 1
EM84510EP U1 1
CD4049UBE U2 1
IR908-7C-F U3,U4 2


Right now I'm trying to model the plastic in Fusion 360. I'm an absolute amateur with Fusion 360, so it has been slow and painful.




I've already gone through multiple revisions. I'm almost there. Original piece on the left. Final model will be two parts. Bottom part has the ring column that drops below the PCB plus supports for sitting on the PCB. Top portion has the bearings and wheels.


I figure I have at least 2 or more revisions to do before getting this right.
























Wednesday, September 27, 2017

Arcade MAME Spinner

I love Tempest, and I want a spinner on my arcade machine.

Unfortunately, they aren't cheap. It looks like the two main solutions are...

The Ultimarc SpinTrak - https://www.ultimarc.com/SpinTrak.html

TurboTwist 2 - http://groovygamegear.com/webstore/index.php?main_page=product_info&products_id=268

Both of these products start at $69 USD ( *cough* price collusion *cough* )

There are a bunch of DIY spinner articles that involved ripping apart old mice. The one that really caught my eye involved an old VHS VCR drum head.

http://www.instructables.com/id/Spinner-Jog-Wheel-Inside-of-a-VCR-Head/

I bought a couple old VCRs from the local thrift shop for $10 each. Ripped them apart. Extracted drums. The first one I ripped apart was very different in structure than the Instructables article. I put it aside unsure if I would be able to use it. The second one was similar to the article, so I was pleased.

The article made reference to a DIY circuit board, ripped apart mouse, etc, and I wasn't really keen on this solution.

I had read a few things here and there about the Arduino, and decided to dive in. I wanted to make a quadrature encoder. Here are a bunch of articles that I came across:

https://learn.adafruit.com/simple-arduino-based-usb-vid-and-pid-tester/lets-do-this-thing

https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide

http://yameb.blogspot.ca/2012/11/quadrature-encoders-in-arduino-done.html

https://www.circuitsathome.com/mcu/reading-rotary-encoder-on-arduino/comment-page-1/#comments

http://bildr.org/2011/03/various-proximity-sensors-arduino/

https://www.arduino.cc/en/Reference/attachInterrupt

http://makeatronics.blogspot.ca/2013/02/efficiently-reading-quadrature-with.html

https://www.hackster.io/ShawnHymel/quadrature-encoder-demo-dea334

http://wiki.bildr.org/index.php/QRE1113

http://www.robotoid.com/appnotes/circuits-quad-encoding.html

One of my personal problems (I blame my ADHD) is that I don't document enough. So I do a bunch of stuff, and then I don't know why I did it.

I had previously done a bunch of reading on all of this, and a couple months ago I ordered the following components.

330 ohm resistors
10k ohm resistors ( I keep accidentally typing resisters)
QRD1113 photointerrupter
Arduino Leonardo Pro Micro ATmega32U4 w/ USB header - these things are about $5 CAD on eBay. I don't know if there is a significant difference between the $5 eBay versions and the $20 SparkFun version. We'll see when things start to come together if there are any issues with the cheap Chinese stuff.

So I have all this stuff, plus some other odds and ends I've been ordering off eBay for the past few months, and now I'm at the point where I should be able to start prototyping.

I asked myself if I had enough components. The articles I read above included some additional things like 100, 150, 220, 270, 4.7k, 5.6k, 33k, 470k, ohm resistors, 0.1µF (100nF), 1uF (1000nF), and 10nF capacitors. Do I need these things while working on this project?

Tangent! It's easier to type uF for microfarad, but using a 'u' is not accurate. The proper symbol is 'μ'.

μ, µ
Lowercase letter Mu / Mμ; micro sign or micron
ASCII 230
ALT + 230
HTML µ
Option + m on Mac (hmm, maybe it isn't that difficult to type)

Also, ohm - Ω (Mac - Option + Z), unicode U+2126, alt+234. Something, something about Greek Omega -U+038F.

Back on track. Do I need all these extra components while working on this project? It's better to have them on hand than not. I hopped onto Arrow.com, and ordered a bunch of extra pieces. When possible, I splurged and ordered automotive grade components. We are talking about pennies difference here.

100Ω resistors

Don't worry about ammo vs reel - it's just the way they are packaged in bulk. Exact same components. Lower TCR is better, but not necessary in small projects like this.

To be continued...




Sunday, August 14, 2016

The CY-822B USB led-joystick controller board

I wanted to build myself a MAME pedestal with a Raspberry Pi 3. I ordered a cheap joystick plus LED kit from eBay, and it came with this controller board. The print on the back reads USB CY-822B led-joystick. After a lot of Google searches, I came up pretty empty on results. So I decided I would post what I know about this board for others.

This board should be AUTOMATICALLY recognized by your OS. Windows, Linux, Mac, whatever. On Windows is appears as a Generic USB Joystick / HID-compliant game controller.

Below, you can see what the back side label says, and what the MAME software reads it as. Example, the top plug is K1 according to the back of the board (see the back side of the board picture below). The MAME software reads the button plugged in as L2.
USB CY-822B led-joystick controller board - face
USB CY-822B led-joystick controller board

USB CY-822B led-joystick controller board - backside
USB CY-822B led-joystick controller board - back side

I ordered another set of buttons and joystick a while later and received a blue variation of this board. This one had a female USB-B port as well.






I read another post somewhere referring to this board as the Bosega 822. Is it made by Bosega? I have no clue.

Bosega USB CY-822B led-joystick schematic
Bosega USB CY-822B led-joystick schematic


Many eBay listers just copy bad information from other sites for their listings, and don't provide any useful information for noobs like me in setting this up.

MODE - this port is absolutely useless. Might as well fill it in with hot glue. What does it do? It switches the Joystick input from the digital d-pad to the analogue joystick. Thing is, this board doesn't have the analogue joystick socket. It may be possible to solder on some sort of connection for an analogue joystick, but that will have to be for another post. NOTE: if the joystick isn't working for you, connection a button to MODE and try switching modes.

TURBO - this button is used by pressing it PLUS any other of the switch buttons. Let's say I want to put the L1/A button into auto fire. It press AUTO and L1/A at the same time. L1/A is now in auto fire mode. Instead of having to tap tap tap constantly on L1/A, I can just hold it down, and the controller will tap tap tap for me.

CLR - this clears the button. If L1/A is in AUTO mode, I press CLR + L1/A to set it back to normal mode.

AUTO - use it in the same way as TURBO. The difference is the controller will tap tap tap the button without me having to press the button.

EDIT: February 2020 - I happened to be tinkering around with this board and realized I made an error in some of my descriptions. I've corrected my errors. I've also added some more pictures to explain things better.

Wiring up the buttons


This board is designed to pass USB 5V to an LED button. Depending on how the connector cable is configured, the LED in the button will either always be on, or only illuminate when pressed.

I found this reference image online.


When connected to the controller board


Press to illuminate wiring

LED always on wiring



INNER PIN (the one with the red wire) is COMMON / GROUND.
OUTER PIN is 5V.
CENTRE PIN is trigger

NOTE: The wiring is how I received these from eBay. Having RED as ground/common may be confusing. I would normally use black as ground/common.





Pressing the button sends 5v to the Centre Pin.



My wires came configured as always on. I like the way my MAME console looks with all the buttons always lit up. I'll have to check what the current draw is with all the LEDs lit. Since I have two controllers, that's 24 LEDs drawing 5V from the USB power supply connected to my Raspberry Pi 3. It didn't seem to have any issues. I plan on using a powered USB hub between the RPi3 and controllers anyway.