Unpredictable PWM behaviour when powered via 5v pin
Re: Unpredictable PWM behaviour when powered via 5v pin
If you disconnect the power to the controller how are the voltages affected?
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
Does your code do this?
pinMode(pwm_1,OUTPUT);
pinMode(dir_1,OUTPUT);
pinMode(pwm_2,OUTPUT);
pinMode(dir_2,OUTPUT);
Setting to output?
Tom
pinMode(pwm_1,OUTPUT);
pinMode(dir_1,OUTPUT);
pinMode(pwm_2,OUTPUT);
pinMode(dir_2,OUTPUT);
Setting to output?
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
Does your code do this?
pinMode(pwm_1,OUTPUT);
pinMode(dir_1,OUTPUT);
pinMode(pwm_2,OUTPUT);
pinMode(dir_2,OUTPUT);
Setting to output?
Tom
pinMode(pwm_1,OUTPUT);
pinMode(dir_1,OUTPUT);
pinMode(pwm_2,OUTPUT);
pinMode(dir_2,OUTPUT);
Setting to output?
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
Tom, the pwm_1, dir_1,pwm_2,dir_2 pins are all set as outputs. When i disconnect power to the motor driver, there's no change in the voltage at the pwm outputs. in fact what has shocked me today is that when i test the circuit again, the pwm output voltage is now the same(1.92v) whether using powerbank/pc or none. i dont know what has changed overnight. i also confirmed that the expected output pwm voltage is supposed to be around 1.9v and not 2.56v as i earlier stated because im using 8 bit and set the pwm to be at a value 150. the problem however still persists.
Re: Unpredictable PWM behaviour when powered via 5v pin
Nodemcu outputs only 0 - 3 volts the board needs are 0-5. Is that right?
If so you need to change levels 3v to 5v for that controller to work.
Tom
If so you need to change levels 3v to 5v for that controller to work.
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Unpredictable PWM behaviour when powered via 5v pin
Tom,
The motor driver/controller works with anything between 0 and 5v. As long as the nodemcu is powered using something that has a battery(powerbank/pc), it works well. The problem comes when battery supply to the nodemcu is eliminated. i dont understand this at all. Is there something that a battery does that a capacitor is not able to do??
The motor driver/controller works with anything between 0 and 5v. As long as the nodemcu is powered using something that has a battery(powerbank/pc), it works well. The problem comes when battery supply to the nodemcu is eliminated. i dont understand this at all. Is there something that a battery does that a capacitor is not able to do??
Re: Unpredictable PWM behaviour when powered via 5v pin
i meant laptop and not pc. the motor driver works well when it is connected to anything that has got a battery as the power supply
Re: Unpredictable PWM behaviour when powered via 5v pin
or could it be that the usb chip converter has to be powered in a specific way with the data pins connected in a certain way?
Re: Unpredictable PWM behaviour when powered via 5v pin
i figured that the pwm will work okay if the chip is powered using a specific usb cable(Anker). i tried many other usb cables but all did not work. They will all supply about 5.01v but when the chip is connected, the voltage output at the 5v regulator reduces to about 4.68v. With the Anker cable, the voltage did not drop.
i also tried a generic 3.3v/5v bredboard power supply chip which i used to power the nodemcu through its 5v pin and everything worked okay (12v 2A DC adapter used to provide power for this unit). this means that the problem has got nothing to do with battery power supply or powering through the microusb port of the nodemcu.
i also tried a generic 3.3v/5v bredboard power supply chip which i used to power the nodemcu through its 5v pin and everything worked okay (12v 2A DC adapter used to provide power for this unit). this means that the problem has got nothing to do with battery power supply or powering through the microusb port of the nodemcu.
Re: Unpredictable PWM behaviour when powered via 5v pin
Hey guys, so i found out that the problem had got to do with the size of wire i was using. i was using a bredboard jumper wire which is AWG 22 or AWG 24. i changed to using another wire that is at least AWG 18 and used it to connect the output of the regulator to the 5v pin of the nodemcu(through the 2200uF cap) and everything now works okay. thank y'all for the help, much appreciated.
Who is online
Users browsing this forum: kaxx1975 and 122 guests