PWM output pin on reset

asi_dadon@yahoo.com
Posts: 3
Joined: Sun Apr 14, 2024 2:00 am

PWM output pin on reset

Postby asi_dadon@yahoo.com » Sun Apr 14, 2024 2:17 am

hi, i have a code used to control 4 pumps, and i use PWM to control their power (flow).
0V means 100% power.
5V means 0% power.
problem is that every time the ESP resets, the pumps starts to work for a brief moment, as if the output pin went low during that time.
i have seen Espressif's 'ESP32 pin list' document, but still not sure what to do, love to hear advices.
I'm using pins 12,13,14,26 pins as PWM outputs.
thanks.

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: PWM output pin on reset

Postby liaifat85 » Sun Apr 14, 2024 3:04 pm

How long is the time? It is more than a few seconds?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: PWM output pin on reset

Postby lbernstone » Sun Apr 14, 2024 4:13 pm

Put a 10-50K pullup resistor on the pins you want to stay high. When the device resets, there is not going to be any signal delivered on those pins, so you need to provide a default one.
You should choose a pin other than 12, which is a strapping pin that needs to be pulled low for 3V3 flash.

asi_dadon@yahoo.com
Posts: 3
Joined: Sun Apr 14, 2024 2:00 am

Re: PWM output pin on reset

Postby asi_dadon@yahoo.com » Mon Apr 15, 2024 7:25 am

liaifat85 wrote:
Sun Apr 14, 2024 3:04 pm
How long is the time? It is more than a few seconds?
it happening for less than a second, just a friction.

asi_dadon@yahoo.com
Posts: 3
Joined: Sun Apr 14, 2024 2:00 am

Re: PWM output pin on reset

Postby asi_dadon@yahoo.com » Mon Apr 15, 2024 7:43 am

lbernstone wrote:
Sun Apr 14, 2024 4:13 pm
Put a 10-50K pullup resistor on the pins you want to stay high. When the device resets, there is not going to be any signal delivered on those pins, so you need to provide a default one.
You should choose a pin other than 12, which is a strapping pin that needs to be pulled low for 3V3 flash.
hi and thanks for the reply,
i have already tried once to put a 100K pull up resistor and it didn't worked

the PWM output pin is connected to the pump VIA a buffer '74LS07DR'

also, in the attached figure from the pump data sheet we can see there is some kind of pull up resistor and yet its happening.

it might be something with my code?
Attachments
PHOTO-2024-04-15-10-32-45.jpg
the io's of the pump scheme from the manufacturer data sheet
PHOTO-2024-04-15-10-32-45.jpg (73.57 KiB) Viewed 1150 times

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: PWM output pin on reset

Postby lbernstone » Tue Apr 16, 2024 4:22 am

You need a stronger pullup than what is included in the pump control circuit there. Try a 10K.
From your description, this is happening when the device restarts, so it literally can't be a problem in your code (which isn't running during a restart). You say there's more involved in the circuit- I am not going to guess at your schematic. If you can see that the device starts and stops when you apply 0V/3V3, then what you need is a pullup resistor.

Who is online

Users browsing this forum: No registered users and 62 guests