Arduino Uno PWM Signal Help

Hi i would like to use this PWM DC Motor controller from here: https://www.servocity.com/dual-5a-pwm-switch/

It says I need different signal threshholds 1400-1600 microseconds to change the channels on the switch. I'm unsure of how to get the arduino to produce these signal threshholds. I know how to use the PWM pins on the arduino but am unable to generate the needed threasholds to activate the switch.
I have tried this using the native PWM pins:

analogWrite(ledPin, 128);

I know I can use the native PWM pins or use a digital pin to bit bange a PWM signal like this:

digitalWrite(13, HIGH);
delayMicroseconds(1400);
digitalWrite(13, LOW);
delayMicroseconds(1400);

I know I must be missing something so if you can point me in the right direction that would be great.

Hi,
The Arduino output is 5V, and this module needs at least 9V at the input.

Input Voltage Range (Recommended) 12 - 24VDC
Input Voltage Range (Limit) 9 - 30VDC

I have a 12volt power supply going to the PWM switch. The switch also outputs 5 volts that i use to power the arduino with and send the PWM signal to the switch. THe arduino powers up just fine but it must not be sending the correct signal to turn the motors on.

I was wondering what code would be needed from the arduino to generate the 1400usec signal.

How about tone() this produces a squarewave with a specified frequency (dutycycle of 50%) and even a duration can be given..
levelshifting, if necessary, can easily be done with a transistor IMHO.

Hi,
Please post a schematic of your project.

The plug for the PWM-signal looks like a 3-pin header used for RC-servos.
Also the company logo looks like RC-servos
image

RC-servos use a much more special "PWM" -signal in the range 1000µSec to 2000 µSec.

What looks odd to me that this PWM-controlled switch is using 9 to 30V as input-voltage
The usual inputvoltage is 5V.

If it is a standard-RC-Servo-signal you need to use the servo-library and not tone.
Because a RC-servo looks like this a short pulse of 1 millisecond to 2 millisecond (equal to 1000 µsec to 2000 µsec) and this short pulse is repeated once every 20 milliseconds.

best regards Stefan

Please forgive the crudity of my schematic but this is how i have it setup.

So perhaps I cant just use a standard PWM signal from arduion I need to use a special servo library code to generate the signal in question then?

The infos given by this company called servocity is more like
servo-in-the-woods but not city
the specs from thier website say Input 9V to 30V

image

The product itself has printed on it 6V
image
Now what is valid???

How much current do your motors pull?

Are you sure that you want your motors simply switched full power on / fully off?

Or do you want to precisely control the motor-speed?
This device has a somehow PWM-input but simply switches the two motors on/off

The switch is supplied with 12v dc into the 12-24 V IN port which is capable of supplying power to two 12v motors at 5 amps. The 6V BEC as you pointed actually supplys 5.5V OUT so it can supply power to a wireless reciever (Used to control the switch) (in my case im using the 5v out to supply power to the arduino). The switch seems to be well designed if I can provide the correct PWM signal from the arduino to it. I wish the company would publish a data sheet on the switch so I didn't have to guess so much.

Also I don't really need to control the motor speed these are 40 RPM motors and don't move very fast and will have almost no load on them for my project.

Sorry. I posted wrongly in Portuguese.

O codigo que postou, o arduino está gerndo pulsos de 1400uS.
Pelo que entendi do datasheet pullsos até 1400uS, os motores ficam parados.
Para testar gere pulso acima de de 1600 uS (1700 uS por exemplo),
e os 2 motores deverão girar.

The code you posted, the arduino is generating pulses of 1400uS.
From what I understand from the datasheet pullsos up to 1400uS, the motors are stopped.
To test generate pulse above 1600 uS (1700 uS for example),
and the 2 motors should rotate.

digitalWrite(13, HIGH);
delayMicroseconds(1700);
digitalWrite(13, LOW);
delayMicroseconds(1700);

Gracias, no estaba seguro de si el código de ejemplo que publiqué era correcto. Probé tu código también y todavía no funcionó. Creo que intentaré conectar un medidor PWM al arduino y ver cuál es la salida.

This code creates a PWM-signal with 50% duty-cycle
this is completely different from what a standard-RC-servo-signal is
a standard-RC-servo-signal is duty-cycle minimum 5% and maximum 10%

This special kind of signal is created by the servo-library

image
best regards Stefan

Thanks. I suspect your exactly right. I was somewhat thrown off as they don't even list the duty cycle needed for the Switch to work and a PWM signal relies upon the duty cycle to work and change how it's used to communicate with other devices. I will give that a shot and see if that does the trick. Thanks to everyone for all of the help. I will report back with my findings this weekend.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.