Home automation , servo motor SG90

Hy Guys ,
so i wanted to do a simple home automation project , and i wanted to use the blynk app , in my project i wanted to open and close the door using a servo motor sg90 , to do that i need to make the servo goes from 20° to 120° so the door is open and from 120° so the door is closed , and i wanted to do that using a bushbutton in the blynk app using virtuel pins , please help me , i will be very greatfeul if someone could help me with the code

We can help you learn about Blynk… the servo control mechanical, linking and programming is up to you to research… Google will help :slight_smile:

As for Blynk… Run through the Documentation and Help Center, then try out the Sketch Builder examples until you have a better understanding if what it can and can not directly control.

http://docs.blynk.cc

http://help.blynk.cc

You didn’t mention the MCU type you will use, but here is a simple servo example from the sketch builder… tweek the device type as necessary.

https://examples.blynk.cc/?board=Arduino%20Uno&shield=ESP8266%20WiFi%20Shield&example=GettingStarted%2FServo

As you run into questions with Blynk, post them here and various forum members will assist as knowledge and availability provide.

You can also search this forum for other related topics and examples… e.g.

https://community.blynk.cc/search?q=servo%20motor

1 Like

Can the servo really open and close the door?
If its a regular door then no servo that I’ve ever come across has the power to move a door.

If the servo is mechanically up to the job then a quick search of the forum will give you plenty of code examples.

Pete.

you can fix it by using Virtual pins. For example;

BLYNK_WRITE(V0) {
  byte value = param.asInt();

if(value == 1) {
  servo.write(120); 
} else {
servo.write(20);
}
}