Questions tagged [pwm]

PWM is a form of signal modulation that allows digital output to approximate an analog signal. Use this for questions about using the PWM pins (marked with ~).

Filter by
Sorted by
Tagged with
0
votes
1answer
28 views

Deriving the exact relationship between PWM and steering

I am using a L298n driver to make a basic RC car. I realise that PWM is used to control the speed of the motors and that the car would turn when the wheels on one side of the car have a rpm different ...
1
vote
0answers
66 views

LEDs lighting up when off due to servo motor being on

Within my arduino project I have began to run out of GND ports on my arduino so I am having to resort to using 1 GND port for lots of electric components. I have 2 LEDs that are each connected to a ...
0
votes
1answer
43 views

Can't turn off fan using PWM and analogWrite(x, 0)

I'm trying to make PWM Signal Generator with Arduino Uno. I'm trying to control 230V 50hz "NRG118" combi boiler fan. The fan powered by AC and have 3pins for PWM control. "vcc,gnd,pwm&...
0
votes
1answer
42 views

Can I use this camera switcher?

I am wondering can I use this bicks camera switcher with the arduino since it uses a PWM signal. If i can do I just put it on one of the PWM outputs or do I need to wire I add something to make it ...
0
votes
1answer
58 views

I just want to control a 48 volt and 30 amp current with pwm singnal…i don't nkow what components is needed for this [closed]

I just want to adjust voltage of a dc dc converter output with pwm signal...i used MOSFET but i get some heating effect..please tell me what model of MOSFET or ijbt or anything else which components ...
1
vote
2answers
51 views

Switched from 3ft to 10ft connection wires. My setup doesnt run correctly now. Timing issues?

Running a DC motor(6.5A max input), motor driver (MD10C 7Amp peak output), and Arduino Mega. I am stabilizing an object with an accelerometer as my sensor. I switched to longer wires so I can have my ...
3
votes
5answers
757 views

How do I convert 0-5v PWM to a 0-12v PWM

I have a Arduino which I would like to use to control a 12v PWM fan for speed control. I know about the 0-3.3v to 0-5v logic level shifter, is there a similar option for 0-5v to 0-12v? Or is there a ...
2
votes
1answer
26 views

How to use PWM with DRV8870?

I'm using Arduino nano and I'm struggling working with the DRV8870 IC on PWM mode. When I use analogWrite(_pin, duty_cycle); the motor makes weird noises. I thought it's because of the PWM frequency ...
2
votes
0answers
35 views

Fast PWM: Resolution in hertz

I am trying to get a nice sounding varying PWM to DAC, and intend to use a Sallen Key as part of an active low pass filter. I set the Fast PWM at a max of 255 (WGM1[0-3] = 5) and set/clear OC1A upon ...
0
votes
2answers
54 views

Output voltage range between 0-5v

I am using arduino Uno/Mega. I am trying to output a range of 0-5v volts using PWM. Is it possible to do it? It’s would be nice to see some code or instructions, as far I have seen, they used external ...
2
votes
1answer
51 views

Maintain constant PWM voltage with changing Vcc

I am making an arduino project with a single lithium ion battery, and want to be able to maintain a constant PWM voltage, even when the battery goes from 4.2-3.2v. I have been able to read the Vcc ...
1
vote
1answer
47 views

Timers, PWM pins and digital outputs on Arduino Mega

I'm using an Arduino Mega to control motors via PWM and Adafruit DRV8871 motor drivers. I also use TIMER1 for a timed interrupt. After adding the TIMER1 interrupt I discovered I had problems with ...
1
vote
0answers
29 views

74hc595 brightness control

I can change the led brightness when I connect the led's + pin to 74hc595. I use pwm with output enable pin.But I want to use 74hc595 with led's - pin(gnd). So figure this.Will this work ?
0
votes
1answer
61 views

ARDUINO expected ';' before 'delay' [duplicate]

I want to shine LED in 64 of 255 duty cycles = level of brightness but it pops up this error (see picture). Can anybody tell me why and help me ? Thank you. void setup() { // put your setup code ...
1
vote
1answer
30 views

Do I need a resistor to control a servo with a PWM signal?

I working with Arduino Nano Every that has several analog PWM pins. I want to use one to control a small servo. Do I need to put a resistor between PWM pin and the servo signal?
2
votes
1answer
42 views

Timer question: Phase Correct PWM at specific frequency

I am trying to create a sinusoidal wave segmented in 64 Frame, each holding a Duty cycle precisely varying from 0x00 to 0xff. This is for an Arduino Nano. I have trouble understanding the following: ...
0
votes
1answer
26 views

Why delay of more than 64 millisecond stops the servo motor from rotating? I am not using “Servo.h” instead i am just managing the length of pulse

The code I used was this int servo = 5; int angle; void setup() { pinMode(servo, OUTPUT); } void loop() { for (angle = 0;angle<180;angle++){ digitalWrite(servo, HIGH); ...
-1
votes
1answer
50 views

Can't read PWM signal from 2-pin fan header

I'm trying to get PWM values from a 2-pin fan header on DuetWifi board (it is a 3D Printer Controller Board). Here is some info about the fan connection on that board. From their forum, I got to know ...
0
votes
1answer
132 views

3.3V to 5V PWM level shift

I need to shift a PWM signal from a ESP32 (3.3V) to receiver that supports 5V. The signal is at maximum of 400Hz. Can this shifter do the job ?
0
votes
2answers
40 views

Speed control of BLDC with an integrated controller (Hall out, PWM in)

I am aiming at precise speed control of this BLDC motor: it has an integrated controller, outputting digital Hall signal (period 20.8ms on oscilloscope, w/o load) and taking PWM as input for speed ...
0
votes
1answer
64 views

3pin (GND, 12V, tach) 12v FAN control using PWM

I know there are fans out there that have a dedicated PWM input, but I like to know if I can PWM control a fan that does not have such a dedicated PWM input. So... If I have a 3 pin 12v fan like the ...
2
votes
1answer
70 views

Mega: attachInterrupt on pin 18/19/20/21 not working

Task: I'm trying to create a fan-control with the arduino mega. I'm generating a PWM signal on pin 6 and 7 and want to use interrups to measure the rpm of the fans. Problem: On pin 2 and 3 everything ...
-1
votes
2answers
62 views

Why am I getting erratic Analog.read() readings?

Im trying to make an arduino controlled PWM fan using a potentiometer. Ive connected the circuit as in the diagram below (The transistor is a TIP120 if it's hard to read): Here is my code: int fan = ...
1
vote
0answers
42 views

I'm trying to control the ESC using remotexy, esp8266 and arduino mega but I think there is a problem with the PWM signal in the slider. Please help [closed]

{ define REMOTEXY_MODE__ESP8266_HARDSERIAL_POINT include // RemoteXY connection settings define REMOTEXY_SERIAL Serial3 define REMOTEXY_SERIAL_SPEED 115200 define REMOTEXY_WIFI_SSID "RemoteXY" ...
0
votes
1answer
108 views

Fading LED with different frequencies

I have a potentiometer attached to one analog port of arduino (assume A0) I'm reading the value of that using input_voltage = analogRead (A0); which is a value between 0-1023. So I want to map this ...
1
vote
0answers
43 views

Chance light intensity in a pwm pin using LDR using Arduino UNO

I am using proteus and Arduino software to simulate my circuit. What I need to do, is to have an LDR in my Arduino uno. When light intensity increases in my LDR, I need another LED which is connected ...
0
votes
0answers
29 views

combinate two codes [duplicate]

i am trying to put these two codes together someone would be so kind to help me. ""#include const int photores = A0; // Photo resistor input const int pot = A1; // Potentiometer input const int led =...
0
votes
1answer
43 views

very small PWM when timer says zero

I'am getting a little PWM signal when my potentiometer is at zero and OCR2B always reads zero on the serial monitor. My LED has low forward voltage but I still get a little PWM on the pin when I prob ...
0
votes
1answer
54 views

PWM Input Pins Never Receive a Value from Working Receiver?

I have a very simple sketch that's supposed to intercept the signal from an RC receiver and print the pulse duration from that channel. Sketch int PwmPin = 9; unsigned long duration; void setup() { ...
0
votes
1answer
49 views

How to generate 3 PWM signals

I have 2560 mega, and I Want to generate 3-phase PWM signal at 62.5khz, synced and shifted 120 degrees apart. I need that for 3-phase split-coil boost converter (or even isolated flyback converter), ...
0
votes
2answers
121 views

Using SDA and SCL with analog inputs at the same time

I'm trying to build a robot arm based on Arduino UNO and PCA9685 controlled by few potentiometers. The easiest way that I figure out and find on internet is using two Arduino's, one as master and ...
0
votes
0answers
29 views

How can I add PWM to my BLDC code using port manipulation?

I have the following code, which currently uses 6 output pins (pins 8 - 13) from the Arduino to my inverter circuit, which controls a BLDC motor. The code is fine and it works, however I want to add ...
-1
votes
1answer
65 views

PWM supplying led breaks down at near to zero threshold

I use timer1, mode 8, on both pin 9 and 10 at 1 kHz my PWM signal breaks down when I turn the potentiometer just above where I set the zero at, no matter where I set the zero at. I power the Arduino ...
0
votes
1answer
65 views

“Manually” generating a PWM signal

I've been trying, just out of curiosity, to write my own function that generates a PWM signal, just like analogWrite(), and to make it light up an LED. Here's my attempt so far: const int pin = 3; ...
0
votes
0answers
29 views

Motors would make the car go extreme left instead of forward (Self Driving car)

This is my very first day in the community, please bear me until I make myself comfortable here. Coming to my question, I'm making a self Driving car. My car instead of moving forward it moves on the ...
0
votes
1answer
262 views

Problem with PWM pins on Arduino uno [duplicate]

I am working on an Arduino Uno Project of a car with two motors. The motor driver board is an L9110 H-Bridge. Here is how everything is connected: And here is the code I am trying to run: //Define ...
1
vote
4answers
100 views

Issue with incrementing PWM over time

First post here. So I have an issue, which I have identified, but I'm not quite sure how to fix it. I'd really appreciate some input and suggestions. I realize that my "pwmDelta" is the problem, but I ...
0
votes
2answers
160 views

problem with decrement in a loop

I am trying to write a sketch wherein the led brightness increases in increments of 15 until it reaches 255. At that point I want to make decrements of 15 until it reaches 0. The increment part of the ...
0
votes
1answer
51 views

Is it possible to measure analog output?

I'm using PWM to control LED brightness using MOSFET, using analogWrite(pwmPin,val), while val is a 12 bit bit value. pwmPin is defined as- pinMode(pwmPin, OUTPUT); Since val changes in time due to ...
0
votes
1answer
36 views

Joy stick Implementation on PID controlled balancing robot [closed]

I am developing a self balancing robot which uses DC motor as actuator, IMU as input sensor and PID as controller. I want to use Dual axis joystick to control the forward and backward motion as well ...
1
vote
1answer
127 views

How to create an inverted PWM on the Due via software

Hello I am i need of a piece of code that lets me invert a PWM signal of two PWM pins on the due. Example D1 will be 101010 and D2 will be 010101. Is it possible? Im pretty limited in my options ...
0
votes
1answer
61 views

For what is used an ESC with a PWM?

So I was reading a few questions on drone, and I reach this one. It said that an ESC is used between the PWM Arduinno's port and the motor. I don't really understand what it means. According to what ...
0
votes
0answers
68 views

Reading PWM signal as on or off

what I am trying to do seemed simple but I have been failing to come up with a solution I have a PWM signal on an external circuit that switches LED on/off, all I need is to set bool powerOn to true ...
0
votes
1answer
160 views

DC Motor Car Steering

I am working on a project with a 3-Wheel Car: 1 Custer Wheel, and 2 DC Motors. I need to steer the car playing with the speeds of these two dc motors. If I would supply a constant voltage and current ...
0
votes
1answer
53 views

16 bit PWM doesn't go to absolute 0V

void setup() { Serial.begin(9600); setupPWM16(); } uint16_t icr = 0xffff; void loop() { analogWrite16(9, 0); } void setupPWM16() { DDRB |= _BV(PB1) | _BV(PB2); /* set pins as outputs *...
0
votes
1answer
435 views

High frequency PWM on Adafruit Feather M0

I'm trying to get a Bluefruit Feather M0, which has a SAMD21G, to do high frequency PWM by accessing timer registers directly, rather than using the Arduino API to do PWM at ~1kHz or ~500Hz. Actual ...
1
vote
1answer
210 views

Trying to control DC motor speed with PID

i'm trying to control a DC motor with PID. I have already made a code where i control the motor with an ultrasonic sensor (for distance) but now i need to run the motor at a given RPM (the Output). I ...
0
votes
1answer
44 views

PWM using timer3 for servo control won't generate any output

I'm making a program for a small robot arm controlled by four servos. Problem: I need for PWM outputs, timer1 has three so i need to use timer3 for the last one The main program and the timer1 ...
0
votes
0answers
38 views

Uno PWM freq conflicts with other PORTs

Am working on a small project in which I can control the speed a 24V DC Motor using a Variable resistance to A/D then generate the right PWM to an optocoupler while displaying the speed in 4 7-...
0
votes
0answers
84 views

Serial port selection and command receiving failure with Arduino Uno and Adafruit servo shield

For a long time I use Arduino Uno controller and Adafruit 16-Channel 12-bit PWM/Servo Shield with 6.3V 1000 uF capacitor, powered with 6V 8Amp adapter to control 6 High-Speed Digital Micro Servo DSM44 ...

1
2 3 4 5
9