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 ) 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