add SG90 servo

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

add SG90 servo

#1 Post by asuz » 22 Apr 2020, 16:09

Hi to all, how can I add a SG90 http://www.ee.ic.ac.uk/pcheung/teaching ... asheet.pdf servo to the espeasy? Is there a special release for the servos? May I connect it directly? Which device should I choose for control it? Can anybody help me, I cannot find any tutorial about it and no answer at search.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: add SG90 servo

#2 Post by grovkillen » 22 Apr 2020, 18:37

You can control the servo using the servo commands: https://espeasy.readthedocs.io/en/lates ... motor-page
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

asuz
Normal user
Posts: 175
Joined: 31 Oct 2018, 18:22

Re: add SG90 servo

#3 Post by asuz » 01 May 2020, 11:52

grovkillen wrote: 22 Apr 2020, 18:37 You can control the servo using the servo commands: https://espeasy.readthedocs.io/en/lates ... motor-page
I've got it thanks :)

Christian72D
New user
Posts: 1
Joined: 28 Dec 2021, 13:59

Re: add SG90 servo

#4 Post by Christian72D » 28 Dec 2021, 14:01

grovkillen wrote: 22 Apr 2020, 18:37 You can control the servo using the servo commands: https://espeasy.readthedocs.io/en/lates ... motor-page
Also THX for the link.

But i don´t understand the syntax: "Servo,1,12,-45"

What ist "1" and "12" for?

User avatar
Ath
Normal user
Posts: 3515
Joined: 10 Jun 2018, 12:06
Location: NL

Re: add SG90 servo

#5 Post by Ath » 28 Dec 2021, 14:33

Christian72D wrote: 28 Dec 2021, 14:01 But i don´t understand the syntax: "Servo,1,12,-45"

What ist "1" and "12" for?
That is explained in that documentation, the servo-id can be 1 or 2, and 12 is the GPIO pin the servo is connected to. This implies there can be max. 2 servos active at the same time.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add SG90 servo

#6 Post by TD-er » 28 Dec 2021, 15:10

That index may be outdated.
For ESP32 that number is for sure no longer limited to 2, but not 100% sure about ESP8266.
I guess it only needs the GPIO now and the servo index is left for compatibility reasons.

sartam
Normal user
Posts: 40
Joined: 13 Mar 2022, 21:25

Re: add SG90 servo

#7 Post by sartam » 06 Apr 2022, 16:06

Hello. I tried to use the instructions here, but got the answer "failed". What has changed when working with a servo?

User avatar
Ath
Normal user
Posts: 3515
Joined: 10 Jun 2018, 12:06
Location: NL

Re: add SG90 servo

#8 Post by Ath » 06 Apr 2022, 16:18

What ESPEasy build are you using?
What plugins have you activated?
What commands or rules are you using?
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add SG90 servo

#9 Post by TD-er » 06 Apr 2022, 16:26

I think the "what build" is the most important question, as the servo code is not included in all builds

sartam
Normal user
Posts: 40
Joined: 13 Mar 2022, 21:25

Re: add SG90 servo

#10 Post by sartam » 06 Apr 2022, 16:28

ESP_Easy_mega_20211224_display_ESP8266_4M1M Dec 24 2021
I give the command servo,1,12,-45 from the rules, from the command line

sartam
Normal user
Posts: 40
Joined: 13 Mar 2022, 21:25

Re: add SG90 servo

#11 Post by sartam » 06 Apr 2022, 16:32

I got an interesting effect when I applied PWM,14,100 to the servo's input. the servo started to rotate continuously :)

TD-er
Core team member
Posts: 8750
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: add SG90 servo

#12 Post by TD-er » 06 Apr 2022, 16:36

A servo pulse is a bit different from normal PWM as in the duty cycle is extremely small and the frequency is also relatively low.
So you really need a build with "servo" included.

Post Reply

Who is online

Users browsing this forum: No registered users and 94 guests