Hello All,
I’m trying to use ESP32 with l298n, Its connected to motor (Standing Desk Motor ) which I want it to go up and down when button pressed (for few cycles) I thought i was doing what I should be what is doesnt work.
Any Help with this ?
output:
- platform: gpio
id: motor_forward_pin
pin: GPIO22 #INT1
- platform: gpio
id: motor_reverse_pin
pin: GPIO23 #INT2
button:
- platform: template
name: Standing Desk Up
id: Standing_Desk_Up
on_press:
then:
- switch.turn_on: motor_forward_pin
- platform: template
name: Standing Desk Down
id: Standing_Desk_Down
on_press:
then:
- switch.turn_on: motor_reverse_pin
It also has a Hall sensor which i want to use later .
I think you might need to provide more detail about your wiring and how you are powering the whole thing for this (including Voltages).
I also can’t see any switches defined in your config but see you are turning some on?
I havn’t defined any switches, i thought typing this in would make the button act as a switch.
Out 1: Motor Live Wire
Out 2: Motor Neural Wire
12v: 29volt cable Live
GND: 29volt cable Neural
INT1: connected to GPIO 22
INT 2: connected to GPIO 23
nothing on the rest
also i unplugged the clip behind 12v and GND as you need to do this if serving more than 12V (i think)
You should define some switches.
You can either turn on/off the outputs you have defined in a Template Switch, or remove the outputs and define two GPIO Switches.
You may also want to look at switch interlocking (ESPHome feature).
thank you,
tried the following with no luck, 1 thing to point out adding a ground to the esp32 from l298n seems to stop the red light on the l298n.
switch:
- platform: gpio
pin: GPIO22 #INT1
name: motor_forward_pin
- platform: gpio
pin: GPIO23 #INT2
name: motor_reverse_pin
I think with the higher voltage and the jumper removed you need to provide 5V to the l298n terminal? You can use the esp32 for that…
The jumper should not be placed when the power supply is greater than 12V and separate 5V should be given through 5V terminal to power the internal circuitry.
Does your code compile/flash?