Servo Motor Control using New Blynk2.0- 0 to 180 Degree Angle Control with ESP32 & NodeMCU
Вставка
- Опубліковано 20 сер 2024
- This Video will guide you, how you can control angles of servo motor through Blynk2.0. You will get the working programming code for both, ESP32 as well as NodeMCU ESP8266 with circuit diagram. All the related material for this video available in the below description.
Note: All the programming codes are well tested and worked perfectly with hardware. Please like, subscribe and share our channel and gets notified for latest update for research as well as industrial projects related to IoT.
Key Moments:
0:35 List of the Components
0:59 Circuit diagram of servo control through blynk2.0
1:46 Conning SG90 servo motor with blynk2.0
2:01 Configure blynk2.0
2:15 Create template for your blynk project
2:56 How to define data stream in blynk2.0
3:06 How to create virtual pin in blynk2.0
3:59 Add widgets in web dashboard
4:10 how to configure Gauge in web dashboard
4:24 how to configure Super chart in Blynk2.0
5:12 SG90 Servo Control program for ESP32
5:50 Servo motor library for ESP32
6:24 How to add Library to Arduino IDE- 2 alternate method
9:32 How to install ESP32 board in Arduino IDE
9:57 Download Blynk2.0 mobile app
10:30 Add new device to blynk2.0 mobile app
11:39 add slider to Blynk mobile app
12:31 How to configure Super Chart in Blynk2.0 mobile app
12:50 Live demonstration of SG90Servo motor control through Blynk2.0 mobile app
13:50 Live demonstration of SG90Servo motor control through Blynk2.0 Web dashboard
So here is the list of components you need for this project-
• ESP32 Wifi Board
• SG90/ MG995 Servo Motor
• 3 male to female connecting wires
Important Links:
Programming code for Servo Motor (ESP32):
drive.google.c...
Programming code for Servo Motor (NodeMCU ESP8266):
drive.google.c...
Download the code from Github Library:
github.com/its...
Circuit diagram for ESP32:
drive.google.c...
Circuit diagram for NodeMCU/ ESP8266:
drive.google.c...
Blynk 2.0 Library:
drive.google.c...
ESP32 Servo Motor Library:
drive.google.c...
Servo Library for NodeMCU:
drive.google.c...
How to install ESP32 board in Arduino IDE:
www.nuttyengin...
How to install NodeMCU ESP8266 board in Arduino IDE:
www.nuttyengin...
Blynk cloud server:
blynk.cloud/
Link to download winzip:
www.winzip.com...
Link to download WinRAR:
www.win-rar.co...
Arduino IDE Software:
www.arduino.cc...
Atmel AVR Studio:
www.microchip....
NuttyFi Wifi Development board:
www.nuttyengin...
Contact link for Nutty Engineer Company:
www.nuttyengin...
Contact link for SME:
www.smedehradu...
Our Other Video for Blynk2.0: Stay tuned with us for more videos.
Our Channel: / smedehradun
How to start with Blynk 2.0- with Web & Mobile Dashboard- LED control
: • How to Start with New ...
Home Automation with manual control:
• Home Automation using ...
DHT11 sensor interfacing with /blynk2.0:
• DHT11 Sensor Data to N...
TDS sensor based Safe Water Quality Meter with Blynk2.0
• TDS sensor based Safe ...
Smart Dustbin with Blynk2.0 - ESP32
• Smart Dustbin with New...
Live Testing of Long Range LoRa SX1278 with Arduino Customized Atmega328 with working code DIY
• LoRa Module Testing wi...
For more, visit to our channel.
For any query, you can comment on comment box below.
Like, subscribe & follow us at
UA-cam channel: / @smedehradun
Twitter: / itsbhupendra
LinkedIn: / schematics-micro-elect...
Facebook: / schematicslab
Instagram: / itsbhupendrasingh
Blog: schematicslab....
Website: www.smedehradu...
#blynk2 #servo #sg90 #esp32 #nodemcu #iot #smedehradun #servomotors #sg90 #newblynk #arduino #blynk #angle #servo
Heartily thanks from the bottom of the heart , new bylnk app confuses me so much atlast u taught me completely
Most welcome @Eugene Ritu
THANK YOU !! THE ONLY VIDEO that i found that shows you how to do this from start to finish !!! solved my issues - works 100% easy to setup as well thanks for the video
You are most welcome 🙏
Thank you bro for giving esp8266 programing code
🙏 thanks
Thank you so much sir, now I finally got to make it work. You sir are a lifesaver!!!!
🫡👍
@@SMEDehradun can u solve my problem ? my servo motor rotate slowly I cant sliding fast that slider button like the video , cos when i slide fast on the blynk , motor are not rotated . I using esp8266 . Can I use phone charger adapter as power source ?
@@muhdazim1729 Hi, Go to the slider setting and turn off the "send values on Release only" option. It will resolve your problem.
@@SMEDehradun I already turn off , the motor still slow to rotate
It may due to power shortage in the NodeMCU. You can use USB mobile charger for this. But be careful.
Also check the internet speed, may another cause for this issue.
Try it. If possible check the maximum angle of the motor.
Awesome explained
Thank you @NuttyEngineer.
Good Work! Thank you so much!
🙏
Thank you bro 👏👍💪
Welcome @pro222yt
U gained new subscriber from india 😊. Can u please make esp8266 rfid lock with blynk
Sure. Already in progress. Try to post as soon as possible.
Thank you so much...you solve my problem with servo...why you use DOUBLE not INTEGER?..thank again
In double we can also store the float values.
Sir my servo motor turns only 90 degrees when controlled in blynk, but it turns 180 degrees in sweep function. I'm using esp8266. Pls reply
K. You need to set the maximum angle limit in datastream tab. If you want to turn servo till 90, then you need to set that to 90.
well explained
Thank you
Please sir, make video to control servo motor to certain position and returned back to initial position, using blynk
Hi,
You can do it by simply adding little bit commands as per your requirements.
If you want to control multiple servo motors using blynk then this video can help you.
ua-cam.com/video/DBrLP0DQazc/v-deo.html
Hello Dear,
Your code is really perfect working,
But I faced another problem like Servo is Run in one way continuously!!
Can you say why is this happened??
Please give the ans ASAP!!!
Hi,
Once change the servo & then check.
Sir i have the code which the code want auth id ,ssid,pass
That’s was an blynk1.0 version. It will not work with the new Blynk
Sir plz help me I have esp8266 it not working
Hi,
Plz watch the complete video. I have shown all the steps.
Sir, The codes in links are not for this project. Those are for LED projects. Please check them. Thank you.
Hi @Baseer
Link & codes are for servo control, & well tested & verified.
Plz check again what you have downloaded?
hi.. thank you for a very informative video.. i was wondering how to set the speed of the servo so it wont rotate so fast?
Thanks @ecks5452
i have problem when using esp8266 with servo it only rotates 90 degree instead of 180 degree
Hi,
Kindly check the maximum angles set on datastream tab in blynk web dashboard and servo motor also.
@@SMEDehradun i try it but it not working
Have you tested the servo motor? If you have alternate servo motor, then you can replace & check
@@SMEDehradun sorry i not check my servo it working at max 90°
Ohk. Great.
Sir can you please make a vedio on how to control multiple servos with esp8266 with new blynn iot
Please sir
Try to make it under 4 days it's an urgent please sir
Hi,
Not possible to make video at this time but I can help you personally. so mail your problem at schematicslab@gmail.com or WhatsApp at 9927715123.
Please reply my comment and mail please and make the vedio on topic how to control multiple servos with esp8266
Check your mail
how can we add led or buzzer to be signal when its on
Simple write a command to digitally high the pin while it is on certain angle.
why we didn't write any BLYNK_AUTH_TOKEN.. ?
Because you have to add your board to blynk using blynk IoT App.
If you see video carefully, will will every single steps to connect.
Which id we want to add in auth id
Plz check the video properly. This is the Only way you can go with blynk2
Sir - Thank you very much for a VERY informative video. I wish Blynk will post detailed videos like this!! I do have a question though - I'm using a WeMos D1 ESP32 board. Everything worked well as outlined in your video, up until I tried to connect the device to my Blynk app. When trying to add the device, I can connect to it on WiFi, but when choosing my home SSID, the device configures WiFi, Reconnect back to cloud, but then gets stuck on "Waiting for device online". After several minutes it gives an error message stating "Your device couldn't connect to the network". I've tried this several times, and using the Android as well as IOS devices. Any idea what the problem may be?
Hi @Johan Claassen,
Thanks for valuable comment.
There is some network issues in your wifi, either there is wrong user name or password or slow internet.
Try to connect it with other wifi or hotspot.
It may resolve your problem.
@@SMEDehradun Thank you sir. You are correct ... my mobile devices were connected to the 5GHz side of my WiFi network. I switched it to 2.4GHz and it solved the problem. Thank you again!!
Congrats. Most welcome
@@SMEDehradun Please tell me what email address I can reach you on.
Reach us at
schematicslab@gmail.com
Sit then which id we will write in the place of auth id
You need to add the blynk credentials in the program from the blynk template. Se the video properly & follow all the steps. I have shown all the steps in the video
Will this work over an LTE cell network, connected to my wifi?
It my be. Try once & if found error, let me know.
You can also use another method to connect with new blynk app. Below video will guide you-
ua-cam.com/video/DBrLP0DQazc/v-deo.html
@@SMEDehradun Thank you. I'll take a look at it
sir can u help me plz i am using a ESP32 board when i followed the same process as u showed in the vide it shows me that my board is not compatible is there any way that it can be solved
Try to upload any program & let me know that your board working or not?
sorry you can do the same with the servo but after 10 minutes the servo turns off (so it returns from 180° to 0°)
It may be power source issue due to continue running of servo.
i have problem on i2c lcd with blynk and analog pin will you please make a video on it please
K. Can you explain what the problem you are facing on it?
i am writing code on main loop but lcd will show unknown char but blynk shows
Try to define that char as global char means define that char at the top of the program. It can work.
when i try to upload the code i get this error please help
In file included from C:\Users\suita\OneDrive\Other\Documents\Arduino\Servo_control_blynk2.0\Servo_control_blynk2.0\Servo_control_blynk2.0.ino:14:
C:\Users\suita\OneDrive\Other\Documents\Arduino\Servo_control_blynk2.0\Servo_control_blynk2.0\BlynkEdgent.h:16:2: error: #error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
#error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
^~~~~
exit status 1
Compilation error: #error "Please specify your BLYNK_TEMPLATE_ID and BLYNK_DEVICE_NAME"
If you read the error that you write into the comment, then you need to replace the blynk credentials in code. And you have put all the header files inside programming code folder.
Alternatively, you can do it with another method. Below is the link that can help you.
ua-cam.com/video/DBrLP0DQazc/v-deo.html
Do you have programming code for Stepper Motor (ESP32)? please reply asap
Yes. I will post the video on it soon.
Followed all the steps am still getting error help me with this please
What error you are getting
@@SMEDehradun error: 'WIFI_OFF' was not declared in this scope
error: 'WIFI_STA' was not declared in this scope
error: 'class WiFiClass' has no member named 'persistent'; did you mean 'setPersistent'?
error: 'class WiFiClass' has no member named 'enableSTA'
many more are there is there any way how do i fix it
@nickshaylongmailai2717
You need t watch the video completely. The headers files must inside your coding folder.
Below video may help you.
ua-cam.com/video/EPhY_hDozeo/v-deo.html
3:22 Is the first 180 the angle of the servo? I have a 270 degree servo motor, should I write 270 instead of 180 both times?
Yes.
you can write 270 instead of 180.
Sir what is blynk credentials
See the complete video, I have explained it with live.
excuse me, i want to ask how to controll 4 servo motor?
Hi,
You can control multiple servo using New Blynk2.0
This is the link to control multiple servo motor Multiple Servo Motor
ua-cam.com/video/DBrLP0DQazc/v-deo.html
Thank you for your help
i can't connect to wifi in Blynk can you help me ? I'm using Esp8266. I compile not error.
Yes.
What’s the error you are getting while connecting to blynk.
@@SMEDehradun When I load the code into esp8266, this led goes off. I can't find Wifi esp8266. But I try to download the code to run Servo not connecting to Blynk it works
Ohk.
So you need to erase the eeprom of your Board then try again.
See this video to fix errors in new blynk
ua-cam.com/video/EPhY_hDozeo/v-deo.html
blynk edgent.h problem
All the headers must be inside the programming folder &change the blynk credentials in code as well.
Below video can help you.
ua-cam.com/video/EPhY_hDozeo/v-deo.html
You can also connect to new blynk with manual credentials method. This is the link
ua-cam.com/video/DBrLP0DQazc/v-deo.html
Sir I need help..
I am using esp8266 and everything is going good but the servo motor is not rotating.. I hope I get a solution for this
Hi,
Plz check what you have feed the minimum & maximum value you have to virtual pin that control the servo.
And also check the servo maximum rotation angle.
This will help you to resolve the problem.
@@SMEDehradun I have given 0 to 180 sir
Then check your servo motor.
@@SMEDehradun sir. I changed the servo motor ... Now it's working .
Thank You sir ❤️
That’s great.
Congrats.
Plz refer my channel to your friends.
I am making robotic arm from node mcu esp8266
Ok good.
you use 12V adaptor for esp32?
Yes.
Sir.. I'm not able to add my arduino on Blynk app.. even tho my Esp32 is in running state
Kindly guide me a way out to this issue
What error you are getting while you try to connect ESP32 board to Blynk2.
@@SMEDehradun It is just loading forever.. and not showing the device
Sorry I didn’t get you point? Which blynk you are using blynk1 or Blynk2?
@@SMEDehradun Kindly check your mail.. I've mailed you my issue in detail
K
My servo motor is rotating only 90 degree even after setting it at 180 degrees it is capable to rotate 180 but still it is rotating 90 degrees
It can be due to power issue. Provide 5V DC power to servo without any load. And also check the blynk slider values.
I have a Tower Pro SG-90 servo motor. I tried replacing attach(D2) with attach(D4,544,2400) and it solved my issue. We're setting the minimum and maximum pulse widths. I think those values may change for different servo motors.
Where did you gave the wifi details to the nodemcu?
I haven't noticed in the entire video an I'm unable to controll it with esp8266
Hello Sai Ram,
This is new Blynk2.0 IoT version. It is elite different from the blynk legacy version.
You just need to connect your NodeMCU or ESP32 board to wifi through the new Blynk IoT app.
If you watch the full video, you will understand how we connect it & there is no alternate for it.
@@SMEDehradun I have finally got the controll over servi motor successfully, but sir its only rotating 90 degrees in both clockwise and anti clockwise. But I want it to move 180 degrees. Can u please help me. Is there anything to change in the code?
Tomorrow i have to submit this project in my college.
It can b due to maximum value set to 90 in datastream or may be servo maximum angles are 90 degree.
Check both conditions.
My servo model name is sg90.
I don't know about the servo motor max angles. But I kept the value in the datastreem as 180 degrees only.
Sg90 comes is variant- 90, 180, 360. So it may be.
The esp2886 code is not visible in the description!
Hi,
Plz look on the description properly. There is a link to download the code.
Yes it is there but link is not working! If u can share the ss of it then it will be more good!! By the way thank you so much! But please provide code for esp8266 by ss
Or this programming code file is only supported in pc and laptop
Hi,
Code is working with Arduino IDE in laptop & PC.
& the code is available for esp32. I will try to date the code for esp8266 as soon as possible.
@@SMEDehradun actually sir i need it so urgently!! I am gonna use that for INS project
Hello, I get an error at #include "BlynkEdgent.h" when writing to the IDE.
How can I get rid of it?
Hi,
Install the new blynk library in your Arduino ide as well as header files must be include in the program.
Watch this video to fix errors.
ua-cam.com/video/EPhY_hDozeo/v-deo.html
@@SMEDehradun Thank you for your reply.
I will refer to the video of the URL.
It's been about two months since I started, so I don't know anything.
Also thank you.
Ohk. Thanks.
If you need any kind of help, let me know. I will help you.
@@SMEDehradun It helps, I'm Japanese so I don't know the explanation, but I'm doing what I should do from Video.
Please let me know if you have any questions.
thank you.
👍
How can we control a normal dc motor with nodemcu?
You can use L293D motor driver for it. It’s very easy.
@@SMEDehradun but how to do its wiring
Check the circuit diagram. You can download it from the video description.
Sir, I use NodeMCU ESP8266 V.3 I follow you every step but, I can’t connect device with my phone. Can you please help me is there something that I can check?
Have you uploaded the code to your NodeMCU?
If possible install the blynk to other Mobile. Some time, android do not support the Blynk2.
@@SMEDehradun I have no problem connect to my phone by using this ua-cam.com/video/AvSCAxbqvvE/v-deo.html but, I really need to use servo for my project and I found out that you channel is very useful So, I try to study about code that you wrote.
Now, the only problem is conect to my phone because when I upload code my servo move a little bit.
Follow the instruction as shown in the video. It will work.
@@PeerawatSornphao thanks.
hi where can i find the code? i can't see your description, thank you
There is option “more” to see the description. You will get the code there.
@@SMEDehradun thank you so much for helping me, keep the great work sir
Welcome 🙏
Hi! Ikeep getting this error, could you help me? The error: Arduino: 1.8.19 (Windows 10), Board: "ESP32 Wrover Module, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), QIO, 80MHz, 921600, None"
Sketch uses 1024574 bytes (78%) of program storage space. Maximum is 1310720 bytes.
Global variables use 41948 bytes (12%) of dynamic memory, leaving 285732 bytes for local variables. Maximum is 327680 bytes.
esptool.py v3.0-dev
Serial port COM1
Connecting........_____....._____....._____....._____....._____....._____.....____An error occurred while uploading the sketch
_
A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hi,
Select the com port of your ESP32 board. It’s com port error.
Also don’t change any setting in board selection.
how to control servo motor more than one
Hi,
You need to add code for second servo in the program
@@SMEDehradun can you share with me coding to control more than servo
Mail me your requirement at schematicslab@gmail.com
Why does it say BlynkEdgent.h No such file exist
There could be few reason behind it-
- blynk library not properly installed,
- if you are selecting proper board like NodeMCU or ESP32.
@@SMEDehradun I encountered another problem it says that In included file: typedef redefinition with different types ('int' vs '_ssize_t' (aka 'long long'))
Hi,
Plz follow all the instructions as shown in the video. Other wise you may miss the things.
And if you were using old blynk then remove that library. And use the latest or as shown in the video.
Blynk2 is quite different from the old one.
Sir how i can get password and ssid
In blynk 2.0, you can add the board only Through the Blynk2 mobile app. No other way to do it.
can i use this video on esp8266?
Yes you can.
@@SMEDehradun thank you very much i love this video
Welcome
It was hard to listen to your explanation because of the background music.
First time, I got this kind of comment.
How we will get ssid
Once you download the blynk IoT app, then you need configure it via that aap. Check out the complete video, you will understand
Sir please make 4Dof robotic arm with node mau esp8266
Hmmm k. Whenever I got time, I will try to make video
Sir sir thanks sir
👍
Dosent work, i tried... Had to write a seperate code
Hi,
All the information in videos to operate the servo motor with new blynk. And it’s soo easy if you follow all the instructions.
You can also do it with alternate method. Below video may help you
ua-cam.com/video/DBrLP0DQazc/v-deo.html
I have old code
Means you are still working with blynk1.o
🙏
🙏
Please help me sir
Let me know how can I help?