Arduino PWM

Thread Starter

JohnBravolta

Joined Dec 18, 2022
2
Hello, I have an arduino Uno that I am trying to use to control a 12v motor.

I need to control this motor. I have tried using the analogWrite(); method, and also changed the frequency but still could not get my valve to move.

This valve can be controlled via linbus or pwm according to the manufactures website.
 

Attachments

geekoftheweek

Joined Oct 6, 2013
1,429
Between the web site and the download there is not enough information to even begin.
LIN typically uses 12V so it's possible you will also need a 12V PWM to make it work.
Normally with a PWM driven device you would use a specific time cycle with a variable duty cycle to denote how far to open the valve.
I'm guessing the valve needs to be ordered as either PWM or LIN, but it is possible that it can decide which method is being used based on timing the input pulses.
You're going to need some form of wave forms or detailed explanation from the manufacturer as to how exactly to communicate with the valve, what PWM time base, what PWM duty cycle does what, and what voltages are expected.
 

Jerry-Hat-Trick

Joined Aug 31, 2022
822
The PWM frequency on the UNO is https://www.google.com/search?client=firefox-b-d&q=arduino+uno+pwm+frequency

But I think there is a way to change it. https://www.etechnophiles.com/change-frequency-pwm-pins-arduino-uno/

For a quick check, so long as you have sorted the necessary voltage and current needed, you can simulate a different frequency by going high and low with a delayMicroseconds() between high and low. This ties up the processor while it's happening, so analogWrite() is handier if the frequency is okay. Maybe better to drive linear if you can, filtering analogWrite() to making it analog.
 

KeithWalker

Joined Jul 10, 2017
3,607
What are you using between the motor and arduino to drive the motor? An Arduino output pin can not supply enough current on its own.
 

KeithWalker

Joined Jul 10, 2017
3,607
@KeithWalker Currently I have the 2 power leads connected to a 12v powers supply and the com wire connected to pin 9 on the arduino.

@geekoftheweek I will try to contact the manufacturer to get more information about the pwm.
You have probably damaged the pin 9 on the Arduino. The digital pins are not designed to carry the amount of current needed to drive a motor. Here is a link to a tutorial that will explain how to do it correctly:

https://create.arduino.cc/projecthu...-motor-with-npn-transistor-arduino-pwm-cdaf2e
 
Top