STM32 Radio Controller | NRF24 + NEXTION Display & 3D PRINTED Case

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys i have a new radio controller project and i think it looks a lot better than my previous controller in this case this one is based on the stm32 so it could get a lot faster and have more modes and options without creating big delays and 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 first 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 this pcb looks awesome and perfectly fits inside of my 3d design of the case it had some small errors but i fixed those it is supplied by two 18650 batteries and have two tp4056 modules in order to recharge it but i've changed this part a little bit because it was giving me some problems the joysticks that i've used are also better than some of my previous radio controllers and this time these are exactly like any other commercial radio controller in this video we'll start with the problems that i had with my last arduino based controller then we'll see the improvements for this new project and then we'll see the components that we need to make such a project show my design for the pcb the 3d printed case assemble everything and give it a test and 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 alexwoods.com so guys let's get started [Music] video sponsored by pcb look at those great gold finish pads their pcb quality is amazing and for so low prices so if you want to get your own pcb design manufacturer all you have to do is to download the gerber files from your designing platform such as ltu kicad and so on then go to pcbway.com click the code now button and insert the board settings such as thickness size and finish then upload the gerber files and apply the order and for just five dollars plus shipping you'll receive amazing pcbs with professional look and great finish select up to 14 layers different color for the solder mask different finish for the pads and more on pcbway.com what's up my friends welcome back here i have my previous radio controller and here is 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 this pcb from pcbway and the quality looks great so why is the new version based on the stm32 well one of the main downsides in the previous arduino based controller was the refresh speed because the arduino nanospeed is 16 megahertz and it has an 8 bit structure so working with big numbers is a bit slow also the use of the oled screen with the ice creasy communication made a small delay in the code loop but the stm32 works at 72 megahertz and it has a 32-bit structure and that means more speed and better results right another difference are the joysticks the ones that i've used with my previous project are ok i mean they are a lot better than the small joysticks that i've used with my old controllers but the problem with this previous project is that the joysticks are too hard to move so this controller would be ok for rc cars or my 3d printed tank but for drones for example we need smooth joysticks and that's why i bought these ones these have decent potentiometers and they move very smooth and also have some resorts so they will stay in the middle position just as any other commercial controller on the market okay so the next difference is the screen that i've used my previous controller was using this oled display that is controlled with squeezy communication with signals from the arduino so using this screen and the radio module at the same time will create some extra delay and that's why on the receive signal we can sometimes see a bit of lag now with this next in display the values are printed by its own driver and all i get from the stm32 is align with the values for all the channels together in that way the loop speed is a lot better so from the stm32 i'm getting a line like this one and inside of the next in display i am chopping this string of data into 6 different channels for all the channels so the process is made inside of the display module and not by the stm the microcontroller and the radio module are working at 3.3 volts so for that i've used this small buck converter module that is set to exactly that voltage and to supply everything i'm using 2 18650 batteries each one with a battery socket and to charge these batteries with a usb connector i had to use two of these charging modules with a tp4056 in order to charge and protect each battery separately then we also have these push buttons which are not programmed yet but in the future i will use this to find adjust the middle position of each channel the pcb also has a buzzer which can be used for sound notifications as a receiver this controller will be compatible with this other small pcb that i haven't mounted yet but we'll see this in a future video as well this pcb is designed in such a way to have the smd version of the nrf24 and 7 channels output but also a ppm channel just in case okay guys so we have seen more or less what we need to assemble this first we need the 3d printed case this design took me a lot of time to make in order to have the exact dimensions for the pcb the hose the position for the connectors and so on it also has the holes for the pcb and the joysticks so we could screw them in place first we fit the battery sockets then we place the pcb on top then we fit the joysticks and on top of this we add the other part of the case now for this top part i've also made a few versions it has the holes for the joysticks four holes for these long buttons and two more holes for some round buttons and in the middle we have the screen socket that is made in such a way that it will fit perfectly inside as you can see each buttonhole has these small bumps and this is my idea for keeping in place the plastic buttons so you add the button and then we fix that 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 it so it will fit perfectly on top of the other part this here is the on and off button and once in place it will get exactly on top of the switch that we have on the pcb and like that we can turn it on and off okay so we need to paint the case a little bit since this wipe doesn't look that good so first we sand paper a little bit i first applied a coat of primer and after a few hours i've sandpaper it once again and then i've used some spray paint and painted black if needed you can apply more than one coat of paint then i've also painted the buttons with a gold color so i let these parts to dry until then let's take a look at the pcb and the rest of the electronics download the 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 you can download the gerber files if you want to order the same pcb and in my case i've ordered it from pcbway and the results are very good actually pcbway is the sponsor of this video and if you want these same pcbs once you download the gerbers you go to pcbway.com and select code now then select your settings for the color the amount of pcbs that you want the thickness and so on and upload the gerber files you receive the pcbs in just a couple of days the first thing that i do is to solder the push buttons i know that i told you that i won't use these buttons for today but we need this for the future update so that's why i will add them then i solder the main on and off switch next you get the small bar converter and solder the 3.3 volts connection on the back and that will make the output to be fixed at 3.3 volts 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 will try to do that later with some external wires and correct my mistake but don't worry all the errors i've made with this pcb are already corrected and the design that you download from below is the correct one then i add the buzzer and some female connectors for the next-gen display then we have four triple connections for the joysticks on these four connectors we have to solder 3 wires for each channel but i will do that once the pcb is inside of the printed case the pcb also has 2 inputs for some toggle switches that will be for channel 5 and 6. also another input for a potentiometer for a possible channel seven but i haven't programmed these three channels for today's video so i won't solder them then 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 socket on these pins and finally i add the radio module now get the stm32 microcontroller and upload the code before you solder it to the pcb and you have that code below you can see how to do that on my previous video on how to work with the stm32 and remember to put back the boot jumper onto position 0. now you can solder the stm32 in place and pretty much all the connections are made we still have 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 yet so first download from below the tft file and copy that to microsd card then insert that card into the nextion display and turn it on the tft file will get copied onto the memory when you get to 100 turn off the display and remove the sd card and now when you pour it back on you 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 using the serial connection it will get the values from the stm32 for all the channels and move the sliders on the screen and also show the values 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 quite decent now in the code another improvement is the precision because the stm32 makes the analog grid with a 12-bit adc in compared with the previous project with the arduino that only has a bit abc with 12 bits we can read from 0 to 4095 so we'll need to send 2 bytes for each channel instead of a byte structure as before i'm now using a long variable that will occupy 4 bytes so we read the potentiometers then we send the data via serial for the display and also send the data with the radio connection ok so by now the paint is already 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 of the plastic case so now we can use some entry nuts to close the case i first glued the battery sockets in place with some double side tape on top i put the pcb and right after that i add the joysticks in place and add two screws and before we close the case we need to add the small tab buttons i secure and place the next hand display with some hot glue for now and then i add all the buttons and secure them in place as well with some elastic ribbons the top case is made in such a way that it will sandwich the pcb in between the top and the bottom case so now i can close this case and that's it the controller is ready just one more step i've designed this front label and i've printed it on a thin cardboard then i cut the shape and now i'll glue that on top of the case to give it a better look i also added toggle switches which by the way they are not connected inside the so now i think it looks quite good right and to test the receive signal i get my nrf24 tester and this will print on the screen the throttle and the yard channels and also control the brightness of this led with a pwm signal according to the throttle channel then i've also connected that pin to my oscilloscope and see the signal and it works the idea is that for a future video i'll also finish the receiver pcb that has output for 7 channels and the ppm channel as well in that way it will be more like any other commercial controller so please stay tuned for more updates on this project and more test speed precision errors that might appear and so on and as always for the code the pcb files the part list the 2d files and for all that you need the links are below on electrodes.com so please check the video description if you want to start the same project thanks again and see you later guys so guys this is the end of the video for this weekend i hope that you like it and as always the most important part i hope that you have learned something new and i would like to thank you to all of you who are supporting me on patreon because that for me is huge and if you would like to support my projects you have all my links below for patreon for my shop for my instagram and so on so thanks again and see you later guys
Info
Channel: Electronoobs
Views: 64,662
Rating: undefined out of 5
Keywords: stm32, nrf24, radio controller, homemade, DIY, channels, range, test, 3D printed, NEXTION, display, lora, frequency, joystick, drone, PWM, opentx, Arduino MEGA
Id: zb67NLfTaGo
Channel Id: undefined
Length: 15min 14sec (914 seconds)
Published: Sun Jun 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.