Unpredictable PWM behaviour when powered via 5v pin
Unpredictable PWM behaviour when powered via 5v pin
I have a NodeMCU breakout board which im using as a wifi access point to control dc motors, through a motor driver, using the pwm pins 32 and 33 at a pwm frequency of 1800Hz on pwm channels 4 and 5 respectively. im using a pwm resolution of 8 bits to write a pwm value of 150 on each of the pins at different periods of time (NOT simultaneously). I control the motors using an android phone over wifi. I have also used pins 18,19 as digital inputs, pins 5,21,25,26 as digital outputs, and pins 34 and 36 as analog inputs. The output pins of 5v current sensors are connected to the analog input pins 34 and 36 through a voltage divider of 2.2k and 3.3k resistors to scale down the 5v voltage output from the output pin of the sensor. The pins 18 and 19 are set as input pins(with internal pulldown) for detecting push button presses.
When the breakout board is powered via the microUSB port through a computer or a power bank, everything works okay and the dc motors will spin according to the pwm value that is written to the pins. However, if i supply power to the breakout board using the 5v pin (from a 5v voltage regulator with 2200uF caps at the input and output), the wifi access point will be successfully created and the android phone will access and communicate with the server successfully BUT the dc motors controlled via the pwm pin will just hum for a few seconds, stop and then hum again repeatedly. Note that the voltage regulator is dedicated for the breakout board only and nothing else draws power from it. I've tried powering the breakout board using microUSB and then disconnecting the USB cable while the 5v pin is still connnected, but the dc motors are still humming intermittently but not rotating.
What could be the cause of the problem? i do not want to power my board using the microUSB port because my setup will be very bulky and i want to save on space.
When the breakout board is powered via the microUSB port through a computer or a power bank, everything works okay and the dc motors will spin according to the pwm value that is written to the pins. However, if i supply power to the breakout board using the 5v pin (from a 5v voltage regulator with 2200uF caps at the input and output), the wifi access point will be successfully created and the android phone will access and communicate with the server successfully BUT the dc motors controlled via the pwm pin will just hum for a few seconds, stop and then hum again repeatedly. Note that the voltage regulator is dedicated for the breakout board only and nothing else draws power from it. I've tried powering the breakout board using microUSB and then disconnecting the USB cable while the 5v pin is still connnected, but the dc motors are still humming intermittently but not rotating.
What could be the cause of the problem? i do not want to power my board using the microUSB port because my setup will be very bulky and i want to save on space.
-
- Posts: 9723
- Joined: Thu Nov 26, 2015 4:08 am
Re: Unpredictable PWM behaviour when powered via 5v pin
- Are your grounds all connected together?
- What's the current capacity of your 5V power supply?
- What's the current capacity of your 5V power supply?
Re: Unpredictable PWM behaviour when powered via 5v pin
Yes all my grounds are connected together. Im using LM7805 regulator for my 5v supply with a current capacity of 1.5A.
Re: Unpredictable PWM behaviour when powered via 5v pin
Does your LM7805 regulator have 0.1uf bypass caps on both the input and output ?
Re: Unpredictable PWM behaviour when powered via 5v pin
No i don't have the bypass caps. could this be the cause?
Re: Unpredictable PWM behaviour when powered via 5v pin
I cannot say if that is the problem. I can say you should never use a regulator without a bypass cap on it.
Re: Unpredictable PWM behaviour when powered via 5v pin
I would measure the voltages being supplied to assure they are not lower when the problem occurs.
If you have a scope look at the pwm pins too.
Tom
If you have a scope look at the pwm pins too.
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
I added 0.1uf bypass caps on both the input and output but there's no change. The voltage measured on the 5v pin remains constant(4.56v) even when the problem occurs. ive found out that the pwm output when powered using pc or powerbank is 2.56v but when powered from the lm7805 regulator, the pwm output is 1.92v. I even tried to channel the regulator output through the micro usb port but still the pwm output is 1.92v instead of the expected 2.56v.
Re: Unpredictable PWM behaviour when powered via 5v pin
I think 1.5 to 3.5 is lala land for ttl 5v. As you disconnect components where does it rise? Like the pwm motor controller what are its specs?
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
sorry i dont have a scope to see where it rises when disconnecting. im using the mdd10a motor driver and not able to attach datasheet here.
- Attachments
-
- Capture.PNG (17.27 KiB) Viewed 8104 times
Who is online
Users browsing this forum: No registered users and 91 guests