This project utilizes a PlayStation 1 controller and makes it wireless by connecting it to a nRF24L01+! I found these PSX connectors on AliExpress for a price too cheap to ignore and decided that this would be a super fun way to test the radio transmitter on the Animator board and would allow me to reuse some old video game controller that are just collecting dust.
The first challenge came in the form of reading the controller input. I turned to online sources as to how the chip inside the PlayStation 1 controller worked, nominal power, etc.
As it turns out, the PlayStation 1 and PlayStation 2 controller communicate over a serial line, with a clock select, MISO, MOSI, and SCK. Simple! In order to get the status of the buttons and analog sticks, the transaction goes, you send a request with a specific code (0x42) and the controller will respond with multiple bytes with the data. 2 bytes are returned for a controller with no analog sticks/4 bytes are returned for a controller with analog sticks. Also, the interface controller chips between PlayStation 1 and 2 take different voltages. The PS1 can take up to 5V and the PS2 controller can only take up to 3.3V. Thankfully the PS1 controller is also able to operate from 3.3V so this project will be able to take both controllers.
The first time I hooked up the controller to my o-scope in order to verify the serial communications I was pretty concerns as to whether or not I just broke the controller. The serial communications were somewhat visible but were very skewed, reflected, and certainly could not be read. The serial in from my microcontroller (ATmega328P) was perfectly fine and it was being greeted with the weird signal. So, this told me that the interface chip on this controller was busted or there was excess dust in the controller, or a connector was not seated properly/cold joint on serial out line. However, after opening up the controller and verifying that visually everything looked fine. I simply got a couple extra controllers. Older PlayStation controllers are considered obsolete, and they are very abundant so these were a cheap fins on eBay (about $15 for 2 in near new condition).
With the new controller in hand, I tested out the serial communications using the same methods and I saw some clean waveforms that were changing with the button presses! Perfect. I wrote a quick program to read the input and toggle an LED based on that input and things were looking good.
Now that I had an input device communicating with the microcontroller, I had to get the microcontroller to interface with a radio transmitter so it can relay that data. I settled with the nRF24L01+ as that radio transmitter for a couple reasons. First, the frequency range is right in the short-range point-to-point frequency range at 2.4GHz. Nobody would need a radio license to operate this PlayStation controller. Second, this transceiver comes as a pre-made module that simple has a SPI interface, so I don’t have to layout a PCB antenna and I get to reuse some serial interface code. Lastly, this part has a ton of resources from the open-source community so there were some good, embedded C example to pair with my understanding of the datasheet/registers (also powered from 3.3V volts!).
After writing the interface code and state machine code to poll the controller, send to the transceiver, and transmit the message things were looking good. I set up an animator board to be the receiver to (again) toggle and LED based on the received input. After a few code adjustments I decided that I was ready to put this on a PCB and CAD up an enclosure to makes this more integrated and easier to handle. I made a PCB in EAGLE CAD and an accompanying enclosure in Fusion 360.
I am happy with this project; it is a really fun way to control the animator board and is left open ended to control all sort of things that can accept a 2.4GHz signal. Code is available on GitHub and enclosure is available on Thingiverse. Thanks for reading!
Article last edited: August 2021