Hi guys
I have a new radio controller project and I think it looks a lot better than my previous controller.
This one is based on the STM32 so it could get a lot faster and have more modes and options
without creating big delays. Compared with my previous radio controller that was based on the
Arduino, this new model also has a better, bigger, color and touchscreen display.
I’ve made a prototype to see if everything works and after that
I’ve designed this PCB for this project and we can solder all the modules here.
The PCB looks awesome and perfectly fits inside my 3D design for the case.
It had some errors but I've fix them. Is supplied by two 18650 batteries and we have two TP4056
modules in order to recharge it but I've changed this part a bit because it was giving me problems.
The joysticks that I’ve used are also are better than some of my previous radio controllers
and this time, they are exactly like any other commercial radio controller.
In this video we will start with the problems I had with my last Arduino based controller,
then we will see the improvements this new project will have, we will see the components we need to
make this project, show you my design for the PCB and the 3D printed case, assemble
everything and give it a test. As always, for the code, the PCB files, the part list, the 3D files
and for all that you need, the links are below on electronoobs.com. So, let’s get started.
What’s up my friends, welcome back. Here I have my previous radio controller
and the new model. The previous one is based on the Arduino and I’ve been using it for
more than a year. You have the video about this project below in the description.
So, as you can see, I ended up with this PCB for the new version
and in the middle, we have the STM32. I’ve got the PCB from PCB way and the quality is great.
So why is the new version based on the STM32? Well, one of the main downsides of the previous
Arduino based controller was the refresh speed. The Arduino NANO speed is 16MHz and it has an
8-bit structure. So, working with big numbers is a bit slow. Also, the use of the OLED screen
with i2c communication made a small delay in the code loop. The STM32 works at 72MHz
and has a 32-bits structure. That means more speed and better results, right?
Another difference are the joysticks. The ones I’ve used with my previous project are ok.
I mean, these are a lot better than these small joysticks I used to have on my old controllers.
But the problem with my previous project is that the joysticks are too hard to move.
This controller is OK for RC cars or my 3D printed tank. But for drones,
we need smooth joysticks and that’s why I’ve bought these ones. They have decent potentiometers
and they move very smooth and also have resorts so they will stay in the middle position just as any
other commercial controller on the market. The next difference is the screen I’ve used.
My previous controller was using this OLED display that is controlled with i2c communication
with signals from the same Arduino. Using the screen and the radio module at the same time,
will create some extra delay, that’s why on the received signal we sometimes have a bit of lag.
Now, with this NEXTION display, the values are printed by its own driver,
and all I get from the STM32 is a line with all the values for all the channels together.
In that way, the loop speed is a lot better. From the STM32 I’m getting a line like this,
and inside the NEXTION display I’m chopping this string of data
into 6 different channels for all the channels, so the process is made inside
the display module and not by the STM. The microcontroller and the radio module
are working at 3.3V so for that I’ve used this small buck converter module set to exactly that
voltage. And to supply everything we have two 18 650 batteries, each one with a battery socket.
To charge the batteries with a USB connector I had to use two of these charging modules
with the TP 40 56 in order to charge and protect each battery separately.
Then we have these push buttons which are not programmed yet,
but in the future, I will use these to fine adjust the middle position of each channel.
The PCB also has a buzzer which we can also use for sounds notification.
As a receiver this controller will be compatible with this other small PCB that I haven’t mounted
yet but we will see this as well in a future video. This is design in such a way to have
the SMD version of the NRF24 and 7 channels outputs but also a PPM channel just in case.
Ok, we’ve seen more or less what we need so let’s assemble this.
We need the 3D printed case. This design took me a lot of time to make in order to have the
exact dimensions of the PCB, the holes, the position for the connectors and so on.
It also has holes for the PCB and the joysticks so we could screw them in place.
First, we fit the battery sockets, then we have the PCB on top,
then we fit the joysticks and on top we have the other part of the case.
Now for this top prat I’ve also made a few versions. It has the holes for the joysticks,
4 holes for these long buttons and two more holes for some round buttons.
In the middle we have the screen socket and is made in such a way that it will fit perfectly.
Inside, as you can see, each button hole has these small bumps. That my idea for keeping in place the
plastic buttons. So, you add the button and then we fix it in place with some elastic ribbons.
In this way, they won’t fall when we flip the case in order to close it.
This top part also has a small bumper around so it will fit perfectly on top of the other part.
This is the on and off button and once in place, it will get exactly on top of the switch we have
on the PCB and like that we turn it on and off. Ok, we need to paint the case a little bit since
white doesn’t look that good. So, we sandpaper it a bit. I first applied a coat of primer. After a
few hours I’ve sandpapered the case again and then I’ve used some spray paint and paint it black.
If needed we can apply more than one coat of paint.
I've also painted the buttons with a gold color. I let these parts to dry and till then,
let’s take a look at the PCB and the rest of the electronics.
Download this schematic from below and have it in front of you. Please check the good schematic
because I've changed the charging part a little bit. Also download the GERBER files if you want
to order the PCB. In my case I've ordered it from PCBWAY and the results are very good.
Actually, PCBWAY is the sponsor of this vide so if you want the same PCBs, once you download the
GERBERS, go to PCBWAY.com and select quote now. Select your settings for the color, amount of
PCBs, thickness and so on and upload the GERBER files. You receive the PCBs in a couple of days.
The first thing I do is to solder the push buttons. I know I told you I won’t
use them for today, but we need them for the future update so that’s why I add them
Then I solder the main ON and OFF switch.
Get the small buck converter and solder the 3.3V connection on the back.
That will make the output to be fixed at 3.3V for the radio module and the STM32.
Then we will solder this converter here on these pins and supply the entire circuit.
Since I have a small mistake for the charging circuit on my schematic,
I won't solder the charging modules yet. I'll try to do that later using
some external wires to correct my mistake. Don’t worry, all the errors I’ve made with
this PCB are already corrected and the design you download from below is the correct one.
Add the buzzer and some female connectors for the NEXTION display.
We have 4 triple connections for the joysticks. On these 4 connectors we
have to solder 3 wires for each channel but I'll do that once the PCB is inside the printed case.
The PCB also has two inputs for some toggle switches that will be channel 5 and 6.
Also another input for a potentiometer for a possible channel 7 but I haven't
programmed these 3 channels for today video so I won't solder them yet.
I solder this LED here with a resistor and this will be the indicator for when the
controller is powered on. I solder the battery sockets on these pins.
SPACE. Finally, I add the radio module. SPACE. Get the STM32 microcontroller and upload the code
before you solder it on the PCB, you have that code below.
See how to do that on my previous video on how to work with the STM32.
Remember to put back the boot jumper to the 0 position. Now solder the STM32 in place
and pretty much all the connections are made. There are still some resistors to be soldered
but since I won’t use the push buttons yet, I won’t solder those for now.
Add the batteries and now, when I toggle the main switch, the PCB will be turned on. But the
display is not connected. Download from below the TFT file and copy that to a micro-SD card.
Then insert the card into the NETION display and turn it on. The TFT file will get copied
to the memory. Then turn the display off and remove the SD card. Now when you power it back
on it will have the graphics for all the channels and also a small animation at the beginning.
The sliders are jumping around because the joysticks are not connected yet
but here, I've connected the joysticks as well. SHOW.
Using the serial connection, it will get the values from the STM32 for all channels
and move some sliders on the screen and also show the value with numbers.
I will definitely improve this design soon.
But it looks that we get decent control for the screen and the refresh rate is decent.
CODE. Now in the code, another improvement is the precision. The STM32 makes the analog read
with a 12 bits ADC in compare with the previous project with the Arduino that has only 10 bits
ADC. With 12 bits we can read from 0 to 4095 so we need to send two bytes for each channel.
Instead of a byte structure I’ve used long variables that will occupy 4 bytes. So,
we read the potentiometers, we send the data via serial for the display and we also send the
data with the radio connection. END CODE. Ok so by now the paint is dry for the case.
Before I assemble it we need to add some of these brass insertion threads.
So, get them and your soldering iron. Heat them up and push the nut inside the plastic case.
Now we can use M3 nuts to close the case.
I glue the battery sockets in place with some double side tape. On top I put the PCB.
Right after that, I add the joysticks in place and add two screws. Before we close the case, we need
to add the small top buttons. I secure in place the NEXTION display with some hot glue for now.
THn, I add all the buttons and secure them in place with some elastic ribbons.
The top case is made in such a way that it will sandwich the PCB in between the top
and bottom case. So now I close the case. And that’s it, the controller is ready.
Just one more step. I've designed this front label and printed it on a thin cardboard.
I cut the shape and now I will glue it on top of the case to give it a better look.
I also add the toggle switches. I think it looks quite good, right?
To test the received signal I get my NRF24 tester. This will print on the screen the throttle and
yaw channels and also control this LED with a PWM signal according to the throttle channel.
SPACE. I've also connected that pin to my oscilloscope and see the signal, and it works.
The idea is that on a future video I will also finish the receiver PCB and this has outputs
for 7 channels and a PPM pin as well. In that way it would be like any other commercial controller.
Please stay tuned for more updates on this project and more tests for speed,
precision, errors that might appear and so on.
As always, for the code, the PCB files, the part list, the 3D files and for all that you need,
the links are below on electronoobs.com so please check the video description
if you want to start this same project. Thanks again and see you later guys.