PS4 controller as RC car transmitter

Hi,

this will be a longer project with a lot of guidance required, but I hope I can finish it before spring when we want to go outsite again and race RC cars. Here's the idea, story, what ever you want to call it. I race RC cars and hope my kids want to, too. So far, they are interested but not for a longer time. They rather play with the PS4 we bought for rainy days. And I can tell you, we have many rainy days in the Netherlands, so my kids get tons of practice using PS4 controllers, more than using an RC car transmitter. Hey, there's an idea... I have seen many Arduino RC controller projects on YouTube, using nrf24l01 modules, so why wouldn't I give this a go? First I searched AliExpress for controller bits and bobs and believe me, there are tons. If you want to build something similar to what I am making, I recommend to buy the parts you need new from Ali and be done with it. I didn't, because I wanted to check out a real controller first, determine what to re-use and then set up the project. So I bought a broken second hand controller for 10 bucks and took it apart. I quickly realised it was a good guess to start with a broken controller as I need to make a PCB matching the original in size and some part locations, but as said above, when I am done measuring and PCB-ing, you are probably better of buying the few PS4 parts required new.

So, yesterday I received the controller in the mail and took it apart:

I tossed some bits like the vibration motors, the battery (which was dead, I probably am wasting a perfectly good controller :wink: ) some ribbon cables, etc.

I found that all buttons are routed through a ribbon cable to a central collecting part, to which the PCB connects by simply being pressed down on it. On this pic you can see the 18 connection points on the brown section between the holes:

Next I put the plastic part with the ribbon cable back in, so here's what I am going to work with:

The PCB will be replaced by a custom one, with the ribbon cable connection at the same location and the two joysticks too, of course.

Here are the plans for the functions, in random order, also for myself as a list and reminder:

  • The steering will be done with the left joystick, left to righ movement. The up and down movement will not to anything, nor will the other joystick or the switches in the joysticks
  • Throttle will be the right hand lower button, R2
  • Brakes will be the left hand lower button, L2.
  • Since one can press L2 and R2 at the same time, there will need to be some code defining 'ThrottleValue = R2Value unless L2 value is greater than 0'.
  • In the central pad button of the controller, a 4 digit 7 segment display will be mounted, showing the battery voltage.
  • The throttle channel will not get any features, it is pretty straight forward. The ESCs we use we program the centre and end-points into, so the transmitter does not need anything.
  • The steering channel will get four features, accessable using the four buttons on the right hand side of the controller. When a button is pressed, the display will change from battery voltage to the function value. The function value can be changed using the up and down buttons on the left hand pad.
  • The four functions are: centre setting, end point left, end point right, exponential setting. For the last one I am messing about with math, ax2 + bx + c = y. I haven't figured it out yet, but I will.
  • When the transmitter is switched off, the four feature values should be saved somewhere so when you turn it back on, the transmitter is where you were.

On the hardware side, I am considering not to use an Arduino board but buy a processor and mount it on the PCB. I might even make the nrf24l01 and TM1637 chips and parts on the same board. I think I wil hook up all buttons and joysticks and such to the processor, so with different Arduino sketches this can be used for other purposes, too.

Well, that is a lot of ideas and no clue where to start. Well, some clue. The first project will be to design the PCB and have it made. I worked with EasyEDA before and had the PCB made, so that will be the chosen route again, now. Besides that, I measured on the ribbon cable and, for your purpose but also for me to remember:
All buttons connect to patch 9 and ...
Left hand buttons:
Up is patch 6
Down is patch 5
Left is patch 7
Right is patch 8
Right hand buttons:
Triangle is patch 13
X is patch 11
Square is patch 14
Circle is patch 12
L1 and R2 I didn't measure yet.
L2 unpressed gives 13k53 ohms between patches 1 and 3
L2 unpressed gives 6k9 ohms between patches 1 and 4
L2 pressed gives 8k97 ohms between patches 1 and 3
L2 pressed gives 2k37 ohms between patches 1 and 4
R2 unpressed gives 7k03 ohms between patches 15 and 18
R2 unpressed gives something else probably between other patches, but I damaged the flatcable
R2 pressed gives 3k04 ohms between patches 15 and 18
R2 pressed gives something else probably between other patches, but I damaged the flatcable
So, here is where I am at with the measuring.

Well, that's all for now, feel free to chime in with additional ideas and usefull remarks.

Cheers,

Hugo

Some progress made, some decisions made, too. I've split the project into two sections, one of which will probably not see completion as it is very complex. I might make it public if someone wants to give it a shot. It is a PCB with the Atmega2560 directly on it, to connect each and every button on the controller and leave all possibilities open:

This will be the best option, but very complex. It will leave open each possibility imaginable, as each button is connected and can be read as desired.

But I should not forget the goal, which is an RC car controller for my son. So I worked out this second option, which will be the first I will try to finish.

It is based on an Arduino Nano, on an RF-Nano to be exact. (https://nl.aliexpress.com/i/32980796969.html) This does not connect all buttons and switches and triggers. But more then enough for my purpose and with the 2.4GHz module already on the Nano board, it is very simple.

One hurdle is that I don't have enough digital input pins, so I wil lhook up one button to an analog pin, and analog read it to compare to 2,5V. Making it fairly digital.

There is a step-up section on the board to make 5V from a single (or two parallel) 18650 cells, I will make a connector point for the TM1637 wires as that board will be mounted elsewhere in the controller housing.

I just found out the joysticks I have on the boards are not the PS4 ones, they don't fit. Unfortunately the right part is not available in the EasyEDA libraries, I will need to create it. No problem, just more time needed.

Hugo

Yesterday evening some progress. I decided on a separate nrf24l01 module and an Arduino Pro Micro, as it just does not phisically fit. (unless I go the Atmega 2560 on-board route.) So I finished the schematic and PCB design and placed an order for two pieces:

It is my first try at something like this and the gerber generator noted a lot of mistakes. But I think I understand them and they are not important, we'll see. The Arduino board and the nrf have arrived from Ali, now I need to source the remaining bits and bobs. And the dreaded writing-of-the-code is getting near, for which the guidance will be very much needed!

BTW, because of the board choice (and limitations) combined with my son's requirements, the current design only uses the left hand horizontal joystick, R2 for throttle, L2 for brakes and the buttons up, down, left, right, triangle, square and circle. For the remaining buttons and sticks there is just no port on the Pro Micro. But it should suffice for the purpose.

Hugo