Hello, welcome to Robojax's ESP32 tutorial. in this tutorial we are going to learn how to steer the pedal motor from the interface of your phone or mobile device or browser to any predetermined angles by simply touching will be controlled via your Wi-Fi will have an unlimited number of pressures buttons. each will have their own angle direction and speed. you can get the code for this by clicking on the link below the video in the description that will do take you to www.robojax.com/learn/arduino let's get started. my name is Ahamd Shamshiri. I present this tutorial from Canada. stepper motor is widely used in many applications and mechatronics automation and other industrial applications and I worked on it for some time pedal motors GS car Arduino and other ways to control it. inclusive direct connection or via Wi-Fi and Bluetooth. and I wrote this code for this car so you can control and steer the pedal motor to any desired angle. you just press the push button and the car will go to that corner.
If you are I use a separate video for Arduino here you can set the angle where you can set the direction and you can set the speed for each pushbutton and there are no limits as long as you do not device let you push more buttons you can have, and you can send them to that corner. now in this – really you will be able to control the hiker car with an unlimited number of pushes buttons via Wi-Fi from your phone or your computer or tablet browser. so you have different push buttons each has a separate angle, direction and speed. just touch it and the car will go to that corner and with that speed and direction.so you can have a personal angle with different directions and make you faster can tap it directly on the screen and just send and the car goes there direction. and it is available for ESP 32 and esp8266 d1 mini and NodeMCU Wiring explained let me now explain the wiring.
I connected five volts external 5 volts to make sure you have this module jumper it is connected. and now the 5 volt comes here in the red side is connected to positive it is linked to the negative. for the cars you can not make a mistake as it is linked here for the module I linked like this IN1, IN2, IN3 and IN4 I have some extension connected man-to-woman cable it comes so and in this this IN1 is connected to pin 13, IN2 is connected to pin 12 there is an empty space in between, because this is ground and then IN3 is connected to pin 14 and IN4 is connected to 27, so they are all ordered inside with the exception that there is a ground GND. and these pens are marked exactly as they are here as you can see here G 13 ground G 12 G 14 g27 on this modulates exactly the same g13 ground G 12 14 27 you can change it to any other digital pen as you like. if you die wiring diagram for it is available as part of my Arduino course at udemy.com.
If you want to learn Arduino, I have a course for best sellers udemy where you can learn Arduino from the ground up with hundreds of projects all course material library codes wiring diagram all available in one place. the link for more new courses below this video in the description. Code Explained the original code that I started it from this example if you click on file examples and then scroll down until you see this area is for ESP 32 and it line the distributor web server and then advanced web server. I took it and it changes drastically. due to some of the inclusion and some features so I did not change it easily, but I changed the code heavily. let me now explain the code.
For the code you need to set the pins here. Pins 1 and 2 & 3 & 4 it's for the pins we have in here for these input pins. so i have set pin 13 12 14 and 27. and then because we want us to have four push buttons has four angles, it's for 1 2 3 and 4 so it's these values you see here to 360 and then the next line the direction and in the next slide we have the direction CW, CW is for 360 s CCW is for 270 CW is for 90 and CCW is for 20 and the next one is a speed factor for which it is 10 for the 360 is 1 for 270, so there is to be in line with each other. and if you want have more just add a comma here and if you want you get for example 287 degrees it clockwise capital CW does not put small CW you will get error. and then a speed factor let's say 2 and then the last one here it's a value that when you click it sends the car and it's just text.
"car sent to" and also for the for the last one also a comma and within the double quote the reason why I stated all because sometimes the location refers to something and for example it place where something moves and you call it 5 degrees and here you call it turn if I turn it off I do not know what to do so to enable you to adjust it I prepare it in full. it's the rest the extent you see here is this in this "in" is here and then a speed factor is this text I prepare and allow them to customize it because people use different languages for many other languages or sorry other purpose you need to be able to change it and this angle is this text and then direction did not use it here comma velocity is this text and then send is this text.
So all these texts that you see here is customizable and here including this stop this stop is here so everything you see with the word title you can customize it. SSID and u Wi-Fi password this is a route I use manual I will turn it off. I do not worry if you know the password. if you must explain the full code available as part of my Arduino course by udemy.com.
The link to my course at Udemy is below this video. Demonstration: desktop computer here is the ministry. the first thing you need to know if it's inside the code connected to my Wi-Fi router for this tutorial it's called Robojax. so your computer should be connected to the same as you can look here it is linked to the Robojax otherwise it does not work. so this is the first condition. afterwards if you upload the code on the series monitor it now opens and press it sets the push button here like the reset press the button as soon as you press it, it will press the IP address for you so you can get this IP address, but in the majority of networks you can type it directly http: // roobjaxESP32, so I'm copying it right now by pressing Control + C and I'm going also show you that one that IP address.
So i'm going to open a new one tab and then control V. and press Enter. so it now comes from this module because the module now acts as a web server. and it is defined so first try this on your phone http: // robojaxESP32 if it does not work then use this IP address. this IP will be different from network to make networks, whatever your ESP 32 shows here will be your address. and late i also show you the one that will make it work. let me open a new tab plus paste and enter. and here through the IP address we get and go through it the robojaxESP32 we can also get this. and now here is the demonstration. currently the car is stopped and these are the available values for the four corners with a set direction.
The speed I do not want to show the speed here, but once you click it for example for 270 so it goes when i start turning the car pressure and it shows you the in angle it shows the direction it shows the speed factor you have set the code and it also shows you the time it will take to complete. with this speed this angle. for example if i go for 90 it will work clockwise 90 degrees somewhere. in here, but because the speed factor is 4, it will take 4 seconds to complete the section.
And these 20 degrees clockwise from here maybe up to here and it took 2 seconds because a speed factor was 10. and now look at 360, so it will happen come back to the same place and it will take 40 seconds because the speed factor is set to 10 for 360 if you set it to 1 it will take 4 seconds and 2 3 4 and because it is 10, 10×4 = 40 40, so it takes 40 seconds to complete and I also show you the counter here at the top. so you can see It. and and when it's running at all at the moment you can just click and stop it. so the stop is always available go for 360 and it runs a lot now slowly, but you can stop it at any time. does not matter. so you can move take it anywhere you want and stop it and then stop all this stuff angles apply for example this 90 means that from this point it is now 90 and with the clockwise direction it goes here.
So it will go 90 degrees in that direction and from here to 90 is now here and all these angles are with respect to the last known location. so this way you can move it and stop it where you want. Demonstration with custom values I also worked a lot on this section too, and it was very time consuming so that you can set your angle, for example, you can set it 450 degrees clockwise and speed factor of 1. now it's 450 so 360 plus some extra corner in goose 450 and I put her in before that means it was normal 450 the angle was the factor was 1 it will take 5 seconds to complete angle within 5 seconds. and if I do it 2 that will be the same angle for 10 seconds now it's much slower and it shows her that timing. Demonstration on mobile and here I have now connected my phone to the same Wi-Fi Robo connection and here I enter the IP address I just showed you 192.168.1.100 192.168.1.1 here is now a demonstration with a mobile device let us send it to the clockwise 270 degrees, so that it displays exactly the same as a larger display.
90 degrees and stop it at any moment. 20 degrees and you can go also in here and let me insert 289 degrees here clockwise and go. the push button does not display the text here properly. I need to see why. and now if i go with 360 I state that the speed factor of 10 so it would take 40 seconds before that would happen let's go for it. now it shows that it takes 40 seconds and here also in the same way as you can depart with a speed factor the one means the fastest speed and as you increase the number the speed will slow down down, for example if I set it to 2 and I go 360 clockwise or maybe clockwise it will take 8 seconds because one means four seconds and two means it will complete eight seconds. and the calculation also shows there Caption typed and corrected by Ahmad Shamshiri on June 19, 2020 in Ajax, Ontario, Canada I thank my guests from Patreon.com I did my part to help you learn.
Now it's your turn. You can subscribe to my channel. Thumb in the video 👍 and simply say 'thank you' in the comments section. My PayPal account link is below this video if you would like to send cash donations. Think about it. thank you for looking ahead how to do this control the small pedal motor with ESP32 via Wi-Fi on your mobile device or browser. if you learn something and found this helpful it will help my video to search YouTube algorithm. if you have comments or the question posted a comment section below I try to answer and answer. if you want to get updates for my upcoming videos make sure you subscribe