giloris
(Lombard)
March 14, 2020, 2:24pm
1
Hi,
I try to use my servo motor to esphome.io but it’s dont move
I followed esphome.io doc but servo don’t work.
My config:
Configuration YAML
# Home Assistant configuration
input_number:
servo_control:
name: Servo Control
initial: 0
min: -100
max: 100
step: 1
mode: slider
Automation YAML
- alias: Write Servo Value to ESP
trigger:
- entity_id: input_number.servo_control
platform: state
action:
- service: esphome.servo_moteur_control_servo
data_template:
level: '{{ trigger.to_state.state | int }}'
Esphome
esphome:
name: servo_moteur
platform: ESP8266
board: nodemcuv2
wifi:
ssid: "my_SSID"
password: "my_password"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: control_servo
variables:
level: float
then:
- servo.write:
id: my_servo
level: !lambda 'return level / 100.0;'
ota:
# Example configuration entry
servo:
- id: my_servo
output: pwm_output
# Example output platform
# On ESP32, use ledc output
output:
- platform: esp8266_pwm
id: pwm_output
pin: D8
frequency: 50 Hz
Regards
Giloris
1 Like
Erickk
April 27, 2020, 6:20pm
2
@giloris Did you ever get this working? I’m trying to control a servo but not having any luck
1 Like
giloris
(Lombard)
April 27, 2020, 7:09pm
3
Hi
I didnt found solution and anybody answer and help me !
What is your project ?
Regards
Giloris
1 Like
yusuff34
(Yusuff34)
May 1, 2020, 12:25am
4
Hello no solution?
@giloris @Erickk
Hello! What version of ha are you running?
I am using the Servo setup on esp with ha 107 and it’s working…
1 Like
giloris
(Lombard)
May 8, 2020, 8:30pm
6
Hi
My version is 0.107.7
Can you send me your differents files (yaml and on esphome ) ?
Regards
Giloris
1 Like
Hi… this is my esphome.yalm
esphome:
name: 'robotarm'
platform: ESP8266
board: d1_mini
wifi:
ssid: 'wifi-ssid'
password: 'password'
manual_ip:
static_ip: 192.168.100.176
gateway: 192.168.100.2
subnet: 255.255.255.0
api:
services:
- service: control_servo
variables:
level: float
then:
- servo.write:
id: my_servo
level: !lambda 'return level / 100.0;'
web_server:
port: 80
logger:
output:
- platform: esp8266_pwm
id: pwm_output
pin: D4
frequency: 50 Hz
servo:
- id: my_servo
output: pwm_output
And in home assistant i have this in configuration.yalm
# Servo Control
input_number:
servo_control:
initial: 0
min: -100
max: 100
step: 1
mode: slider
and the automation to control it in automations.yalm
- id: '1588946703480'
alias: Write Servo Value to ESP
description: ''
trigger:
- entity_id: input_number.servo_control
platform: state
condition: []
action:
- data_template:
level: '{{ trigger.to_state.state | int }}'
service: esphome.robotarm_control_servo
2 Likes
giloris
(Lombard)
May 10, 2020, 6:29am
8
Hi
Thank you for your help. Files and configuration are similar
I use an ESP8266 nodemcu V2 board and i m connecting to Pin 8 (pwm)
I will try another Pin and test it. How do you connect servo to your board ?
Your servo use 3,3V or 5V and what power pin do you use ?
Regards
Giloris
1 Like
I use male to female 30cm pin cables to connect it on the wemos d1 mini pins.
I use 5v pin because my servo is a big one 5v Servo but when I was doing tests it also worked with 3.3v.
1 Like
giloris
(Lombard)
May 10, 2020, 11:44am
10
Hi
How is your Battery power ?
USB 5v or indépendant power battery 5v or more
Regards
Giloris
1 Like
It’s a wall plug to usb, 5v 2A with 1m usb to micro usb cable.
1 Like
giloris
(Lombard)
May 10, 2020, 7:23pm
12
Hi
Thank You to your help
I will try it
Regards
Giloris
1 Like
giloris
(Lombard)
May 17, 2020, 4:27pm
13
Hi
I have same problem. Can you send me a short video or a picture ?
Regards
Giloris
Hellis81
(Hellis81)
May 17, 2020, 4:44pm
14
Can you take a picture of how you connected it all, or draw a schematic of the circuit?
giloris
(Lombard)
May 17, 2020, 5:58pm
15
Hi
When i connect servo it comes at max and i hear a noise ,when i move slider it dont move. Need i change a parameter ? Could you see my configuration at the top of the page ?
I use ESP8266 nodemcu V3 and i connect servo to
VCC 5V --> RED cable
GND --> BROWN cable
D4 (for PWM) --> Orange cable
Regards
Giloris
giloris
(Lombard)
May 17, 2020, 6:18pm
16
hi
This is my config
input_number:
servo_control:
name: Servo Control
initial: 0
min: -100
max: 100
step: 1
mode: slider
Esphome config :
esphome:
name: servo_moteur
platform: ESP8266
board: nodemcuv2
wifi:
ssid: "xxxxxx"
password: "xxxxxxx"
# Enable logging
logger:
# Enable Home Assistant API
api:
services:
- service: control_servo
variables:
level: float
then:
- servo.write:
id: my_servo
level: !lambda "return level / 100.0;"
# Example configuration entry
servo:
- id: my_servo
output: pwm_output
# Example output platform
# On ESP32, use ledc output
output:
- platform: esp8266_pwm
id: pwm_output
pin: D4
frequency: 50 Hz
Automation :
- id: 6209852ff5b8426d9992076a6052c814
alias: Write Servo Value to ESP
trigger:
- entity_id: input_number.servo_control
platform: state
condition: []
action:
- data_template:
level: '{{ trigger.to_state.state | int }}'
service: esphome.servo_moteur_control_servo
Regards
Giloris
Hellis81
(Hellis81)
May 17, 2020, 6:50pm
17
So you use the VCC pin of the 8266? That won’t work.
You need to get the 5 volts before the 8266.
The 8266 has a limited output and no matter how large the USB charger/power supply is the VCC pin can only output the limited mAh.
If you instead have the 8266 and the servo in parallel then the servo will be able to get all the current it needs (and you offload the 8266).
giloris
(Lombard)
May 17, 2020, 7:23pm
18
Hi
I use ESP8266 extension board with 5v (4,67v around) before ESP8266
My servo is Connect to 5v pin and gnd
Only signal is Connect to d4 on ESP8266 nodemcu.
Do you see
My home assistant config ?
Regards
Giloris
Hellis81
(Hellis81)
May 17, 2020, 7:38pm
19
giloris:
Do you see
No. That picture is very small…