Tuesday, June 14, 2022

IoT Based Servo Motor Control using Blynk Apps and Nodemcu | ESP8266 | Project

Today, I will share how to control a servo motor using Blynk web or apps via the internet. The project controls the position of a servo motor using Blynk apps. I'm using an SG90 180-degree micro servo. Nodemcu board can drive this servo motor without an additional power supply.


Related Post:

References:

Steps: 

  1. Prepare 3 jumpers, servo motor, and Nodemcu module.


  2. Connect servo motor GND (brown wire), VCC (red wire), and DATA (orange wire) pins to the GROUND, 3V/5V, and D2 (GPIO 4) of the Nodemcu.


  3. Connect micro USB to Nodemcu module.


  4. Go to the blynk.io website and log in. If you do not have an account yet, click "Create new account".




  5. Create New Template > Type NAME "Servor Control" > Select HARDWARE "ESP8266" > Select CONNECTION TYPE "WiFi" > Done.




  6. Go to Datastreams Tab> New Datastream > Virtual Pin > Type NAME "SERVO" > Select PIN "V0" > Select DATA TYPE "Integer" > Set MIN 0 > Set MAX 180  > Set DEFAULT VALUE 0 > Click Create.



  7. Go to Web Dashboard Tab > Select Slider widget to the canvas.



  8. Select Slider widget setting > Type TITLE "SERVO" > Select Datastream SERVO (V0) > Save. Then, save the Web Dashboard.




  9. Go to Info Tab > Copy FIRMWARE CONFIGURATION.


  10. Open the Servo Control coding project and paste the FIRMWARE CONFIGURATION. Click HERE to download the project code.


  11. Verify and upload the project.


  12. Download and Log In Blynk IoT app on Google Playstore.


  13. Click Add new device > Connect to Wi-Fi > Start > Continue > Connect Blynk Servo Control-57CBF.






  14. Click Ready > Choose your Wi-Fi network > type Wi-Fi password > Continue > Finish.





  15. Click Spanner symbol 🔧 > Click + > Choose Slider widget.




  16. Click Slider Widget > Type Title "SERVO" > Select Datastream "SERVO" > Change SHOW VALUE "ON" > Click back arrow "←".



  17. Lastly, exit the canvas by clicking the back arrow "←".


  18. Test from Phone Apps by sliding the slider widget to the left or right (Minimum value 0 degrees, Maximum Value 180 degrees). The servo motor will position according to the slider value.


  19. To test from the website, go to the 🔍 icon at Tab > Click Servo Control 57CBF.



  20. Slide the slider widget to the left or right (Minimum value 0 degrees, Maximum Value 180 degrees).




Video:


If you have any suggestions, please write in the comment section. Thank you for your time 👷.

No comments:

Post a Comment