arduino 4wd rc car


They have to build a car that does this, and because none of that people on my team actually know how to build something like this. They called on me to help build it for them. So what I did is I built this RC car or modified it with an Arduino circuit board. So that way it can use the inputs from these four different sensors to control the output to the electronic speed controller and it said steering servo. This was all done using a circuit board and Arduino shop, and it works really good. So in this video I’m going to show you how I made this and how the program works, let’s get started. So let’s start by taking a look at the car. So this is just a typical RC car chassis that was pretty stock and what I did is I first took a piece of plexiglass and I mounted it to this Center aluminum frame. Now this plexiglass has standoffs for the first arduino circuit board to stand on it. Also has standoffs for the second piece of plexiglass that holds all the other sensors. These types of sensors were ultrasonic distance sensors and you can learn how those work in one of my previous videos, but these are all mounted with one screw to this piece of plexiglass. So that way they can be freely rotated, because the angle of these ultrasonic distance sensors makes a very large difference in the how it navigates this track.

I forgot to mention the track. This will be autonomously. Navigating is a track that has a four by eight square. In the middle and then surrounded by an oval on the outside, this is about 15 by 8, and so this car will have to navigate the wall inside this track without hitting any of the walls to get the most points, and you can see it driving in One of my previous videos, but anyway back to the point, so this circuit board is made on a piece of perf board and that everything is modular and connected on. So this car uses four ultrasonic missing sensors to autonomously navigate this track. Now this whole thing is controlled by this arduino nano. It is hooked up to this piece of perfboard and it has all these other connections on it. Now this whole circuit board is modular. This means that anything, including this Arduino, can be easily removed to see the female headers that are beneath. Also, these wires can be easily unplugged. So that way you can plug in different things or remove the circuit board easily. These wires go to the different ultrasonic, sensors, ESC and servo I’ll plug that back in and, as you can see, the bluetooth module is also modular, which means it can be unplugged. So all these parts interact to form this RC car that is actually able to autonomously navigate a track. This circuit board was soldered on the bottom, with different soldered connections.

Now I didn’t actually take a video of what it looked like a lot of soldering, but you can see a picture of what the circuit board looks like underneath in this picture. This part right here is the electronic speed, controller or ESC, and this is what drives the high current motor from the battery. Now, this est needs a certain pulse width, modulation signal, and so this wire from the ESC goes into this port right here. That goes into the Arduino and the Arduino, and it applies a pulse width. Modulation of eight causes the ESC to not move at all and it supplies anything higher than 89. Then the motor will move forward but supplies anything less than 75. The motor will move backwards. The servo, it also works using kind of the same concept where 95 makes the wheels go forward. Anything below that makes them turn right and anything above it makes them turn left. Now all these connections are connected to the Arduino. The far piece of wire right here is ground, the second one in is positive or VCC, and then the ones going in after that are the control pins to the Arduino for the servo and ESC. These two pins right here are the signal pins and for the four ultrasonic different sensors. These two pins are trigger first and then echo. Those are connected to the respective pins on the Arduino underneath use modules. Px is connected to the Arduino as rx, while the Bluetooth module is Rx is connected to the Arduino ste X, so now how this car works, when it’s actually inside its track, how the code uses the distances from these different sensors to help maneuver the car.

So what happens? Is it kind of uses, a servo emotion, so, first of all, the code scan through every single distances or, respectively, finding each distance about every 10 micro second, so they have an extremely fast refresh rate. Now what happens is if the car gets too close to the wall with this sensor, which is beneath a certain set point of the code, then it’ll turn this way now after it gets far enough away, it’ll sit back, but if it gets too close on any Of these other sensors, it turn the other way the each sensor is working individually in a way. So that way, if it gets too close to the wall on one side, it’ll turn, it gets too close on the other side, it’ll turn now this forward sensor is kind of a backup or failsafe. So what happens is if this sensor gets too close to a wall? The car will immediately back up and turn so that way it avoids hitting that wall. If that ever happens, so this whole code is actually quite complicated because there are a lot of nested. If statements to make these sensors work in the best way possible, and also all of the values from the sensors took quite a while to find so in the end results, as you can see, when we turn this on, all the sensors will work from such a Way so if I move my hand close to one of them, it’ll turn one way and the same with the other way.

So this Bluetooth module will turn on the car initially if it receives the command to do so now I also added another failsafe or another, easier way to turn it on where I press this single button. Now, when I press this button, the Codel entered drive state, which will mean it’s driving in its autonomous order, and this blue light in the back will turn off so I’ll press this button, and it takes a little bit to load because I have a delay set Inside there it’s approximately 15 seconds and the car will start running you’ll see the blue light come on and you’ll see it drive forward. So sighs you can see. The car is working right now and and it’s driving forward in the blue by two dogs. Now, if I move my hand close to a different sensor, you can see that the wheels turn in a different direction, so I’m moving my hand close to any any one of the sensors. They immediately start moving. So if I move my hand close to this sensor occurrence, so that is how all the sensors work on there and they actually worked very good. So this is the code that I use for the whole Arduino and I’ll put a link to my instructable in the description that will have this code inside that on that instructable will be up in the next few days, so how this code works is in the Top it initializes all the pins to do the different things that they do, including the Bluetooth, module and stuff, and these are all the trigger and echo pins for all your sonic sensors, and these are just some long variables which are 32 bit and those have store.

The distances and stuff – and these are just more initializations then right here – is where it scans all the sensors. So it warns a method called sonar sensor which pings each one and receives the echo for how much distance was for it, and that sets the distance ones. Distance and so then it takes the distances and it gets rid of all the extraneous values right here by setting any extraneous value to zero, and then right here is when it gets the driver state, which means that if the Bluetooth sends a 1 to it, then It will make driver state 1 and if the button is pressed it’ll make driver state 1. Then, if it’s zero, then nothing happens with the car and if it’s 1, then it runs this code, and this code is all blanked out, because this is previous attempts at making the code and down here is the actual code that makes this car work now, as You can see it is extremely long right here now pretty much what it does is it servos between all of the different pins and all of the different sensors of the robot to make it work. So, for example, if we go down here, mister, the if distance 3 is less than 53 and it is not equal to zero, which means that if it is zero, then it is an extraneous value because too far, then it will make the RC car drive forward.

At medium speed now there is quite a bit of code here and it would take a long time to explain so I’ll just have you read through it, and so this is a video of it actually running inside the competition, and if you check out my previous Video, you can see a whole time lapse. Kind of of its hold two and a half hour run around this track, which is actually pretty cool, but for now I’m, going to just run the car, not with autonomous, but with my phone by opening up a new code called Bluetooth car. This will allow me to run the car using my phone as a remote control, which is pretty cool. Let’S see that so now that you’ve seen what this car looks like when is driving in the actual track, and it was able to drive in the stretch or two and a half hours now we can have a little bit of fun with this car and connect To it using bluetooth on my phone, so this is an Android app that allows you to send different data packets to the Bluetooth module on the car. So that way, I can program the car to drive wherever I want using my phone and what, if you sleep, that I want so, as you can see, I can put a low speed right now and doesn’t even drive forwards as a dead battery and that’s low Speed and I can drive backwards, but, as you can see when I increase it to full speed, it goes super fast.

Well, it seen this car has crashed into the bushes, because the Bluetooth last question is that so let’s try this there’s.


arduino 4wd rc car Video







arduino 4wd rc car news








arduino 4wd rc car Social






👋 Want to bring Tony Stark-like gesture control to your projects? Learn how with the BLE-enabled MKR WiFi 1010 and Nano 33 BLE Sense boards using the ArduinoBLE library.
safe image.php?d=AQDyi1ELcW4VGzhx&w=720&h=720& dChOhNMmeF - arduino 4wd rc car

Arduin-yo ho ho! A fairground favorite, the pirate ship is a fun way to explore the oscillation of a pendulum. How much fun, you ask? Access our Science Kit Physics Lab preview and see for yourself:

🔬 Now that you’ve gotten your feet wet, dive into the kit and enjoy all nine experiments. Order yours today:

70537898 550174072395145 8798850142103928832 n.jpg? nc cat=102& nc oc=AQmCfMPwMf1oPpYqFhzbxfnGdbrmsjZXrEEBy1ox5Z8EJtiYMADoFNZ5mnSNRgCCY74& nc ht=scontent - arduino 4wd rc car


TheDIYGuy999 photo

RC 4WD Mobile Robot Car Chassis with Tracking and Avoidance System for Arduino

castomatanzo photo









(Visited 16 times, 1 visits today)

About The Author

You might be interested in

Comment (23)

  1. Mia here from RayMing, 10 years PCB and PCBA manufacturer.
    Could you please introduce our company on your Youtube? and we will pay for that.

  2. I’m trying to learn robotics from you but you don’t really show us you building it. or what to have to try and make it.

  3. How would you go about to make it into a path finding car which has mapping capability, enabling it to get to point A to point B with a single user input on an interface?

  4. Hey, could you make a step by step tutorial on how to build this. Not the code, the code thankfully you have provided already. I just need to know how to build it.


Your email address will not be published. Required fields are marked *