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
2
votes
0answers
18 views

Generating Externally Triggered Complimentary PWM with Arduino Due

I need a 2KHz complimentary PWM waves with adjustable duty and phase that is triggered by an external 4KHz source. After reading the datasheet I think there might be 2 way to do this: Use a TC unit ...
1
vote
0answers
28 views

Hello I am working on getting a pwm signal with arduino nano, I am new to Arduino and i need it for a project [closed]

I want it so that When I apply 1v to analog input i get a pwm signal of 50% duty cycle. When I apply 2v to analog input i get a pwm signal of 80% duty cycle. Can someone tell me the code on how to do ...
-1
votes
1answer
18 views

Arduino simulator - generating sine wave from PWD (Oscilloscope read is rectangular)

trying to create this simple circuit where a rectangular voltage input is transferred to a sine wave output. the process is quite simple, but I couldn't see the actual sine wave when connecting an ...
1
vote
1answer
34 views

How should I decide the cut-off frequency for my low-pass filter?

I'm trying to generate some basic thumping stereo sound using Arduino's PWM pins along with low-pass filters. This is the frequency spectrum for the sound I want to play using Arduino UNO's PWM pins: ...
1
vote
1answer
252 views

Fast PWM with Arduino, the inputs outputs don't work

Hello to the community! I am using ATTINY85 and I am programming it through the AVRISP using an Arduino UNO. This is the code I am using : #include <avr/io.h> #include <avr/interrupt.h> ...
2
votes
1answer
40 views

Using PWM pins on the UNO to generate Stereo Sound

I am trying to generate stereo sound using an Arduino UNO. Instead of using a separate DAC chip (as shown here), can I use the PWM pins on the UNO along with a low-pass filter? Also, would I need any ...
1
vote
2answers
53 views

PWM and Analog Signal Quality

I'm converting a 0-5v PWM signal to an analog signal using an LM358D. I've connected the output to an oscilloscope to look at the signal but I'm not really sure what I'm looking at. The PWM looks ok ...
1
vote
0answers
30 views

About controlling led using push button using ATmega328p

I am using an ATMega328P and I want to illuminate an LED connected to PORTB according to an input (with pull up resistor) from PORTD. In the same program, I generate phase-correct PWM and take output ...
0
votes
1answer
19 views

Change character sequence

I turn on the transmission of one key that works to open the door, but after a certain time I need to close the door, and for this I need to use the second key. I want to do without additional buttons,...
1
vote
1answer
29 views

Rotating Servo Motor using Arduino

Using arduino, I'm trying to rotate a 360 servo that will move clockwise 5 seconds,pause and counterclockwise for 5 seconds and then completely stop. However, my servo just continuously keeps on ...
1
vote
0answers
43 views

l298N PWM motor control with Uno is not functioning correctly

I'm working on a self-balancing robot. The self-balancing is not the issue. The issue is that the motors don't respond as they are supposed to. I would understand if it were unable to balance, but the ...
1
vote
0answers
35 views

Trouble with laser sensor

I have trouble with my laser sensor it doesn't work properly. When I connect all pins its doesn't work, when I remove GND and connect just the signal pin and VCC it works but the laser light is dim(I ...
0
votes
0answers
25 views

OCR0 software PWM “strobes” when additional code is run

I'm having a strange issue with an arduino-ish program. As a MWE, I'm trying to PWM control an LED with interrupts, while also doing other stuff in the background. If I just use the code below, ...
0
votes
1answer
28 views

I have a problem trying to limit motor speed to a certain RPM using a MOSFET trigger switch module

I am using the potentiometer to control the duty cycle of a PWM signal to the MOSFET trigger switch module, thus controlling the motor speed. In my code, I have used the map function to utilize the ...
1
vote
0answers
35 views

Driving high current through an LED using PWM [closed]

We are trying to use an LED as a high frequency light source using PWM implemented through an Arduino. We use an NPN transistor to boost the voltage drop (and current flow) through the LED per the ...
2
votes
1answer
35 views

Can Arduino uno adjust input square wave duty, phase and frequency with just timer-counter?

Requirement: I have input 4KHz pulse input Divide it's frequency in half Arbitrarily adjust phase Arbitrarily adjust duty Out put the modified pulse My solution (CPU): uint8_t cnt = 0; uint16_t t1 = ...
0
votes
1answer
45 views

Problem with sending IR with at ATMega328P-PU

I have a sketch that sends an IR code every second. It works fine (the correct code is received by my receiving Arduino next to it) on the Arduino but when I try to move the sketch to an ATMega328P-PU,...
6
votes
6answers
3k views

Is it possible to generate an exact 15 kHz clock pulse using an Arduino?

I want to generate a 15 kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000 Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds, but we ...
0
votes
1answer
87 views

Weak Arduino Output Pins

Sorry if this is a newbie question, but I'm really struggling with this and I can't seem to figure it out. I've been learning Arduino for a while, and for my next project I'm attempting to build a ...
0
votes
0answers
41 views

Controlling LED from Aux Switch on RC Controller thru Arduino Uno

I am trying to control an LED to go on and off using the Aux Switch (SwA) of an RC controller (FS-iA6B). I have gotten the serial read to work but am stuck trying to implement basic Arduino LED code ...
3
votes
1answer
43 views

(Arduino Uno) PWM output (and servo plugged on it) becomes unstable if I use 1Wire on another pin

Unnecessary context but hey I'm guessing you might be interested Hi, I want to build a PID temperature regulator with a servo that presses on a silicon pipe to adjust the flux of liquid passing ...
1
vote
3answers
88 views

Arduino Pro Mini PWM issue

I want to create a small LED strip driver/controller with 2 channels (Cold/Warm white) using Arduino Pro Mini (5V/16MHz). I have connected the parts per the following diagram I have pins 5 and 6 ...
0
votes
0answers
31 views

I need to change a library to output on pin 3 instead of pin 11(It involves PWM and timers on the arduino)

I read into how the timers on the Arduino work, and I know that pin 3 is OC2B and pin 11 is OC2A. I tried to understand the datasheet and changed the code a bit, but nothing I did worked. This is the ...
0
votes
1answer
38 views

Always HIGHT line on Oscilloscope when UNO's Fast PWM TOP ICR1

I have been trying to get an answer my question for a 2 days already. It's good for knowledge collecting and playing with different things, but there haven't been a solution so far. I'm trying to ...
0
votes
0answers
103 views

Arduino two sketch add to single sketch based on timers [duplicate]

How to add two sketch in single sketch and run same time because one sketch timer1 used and another sketch used timer0 and timer2 both sketch have setup()and loop () so how to add please help us with ...
1
vote
1answer
47 views

How the light brightness stays constant when we increase the frequency of stroboscope

Well I am trying to make a Stroboscop. I found this code at blow: and tried. It works normally. But if I increase the RPM so decrease the "strobeDelay" time, the brightness of the LEDs goes ...
2
votes
1answer
85 views

Arduino Wifi Rev2, bug when reading PWM duty cycle value on pin 6

I am trying to read the PWM duty cycle set for pin 6 on the Arduino Wifi Rev2. By default, the timer used is TCB0, used in 8-bit PWM mode. The 16-bit Compare channel CCMP is used as two 8-bit ...
0
votes
2answers
92 views

Dimming this ~30V led with PWM, what do I need?

I have a street lamp with a led and simple driver in it, I don't know the exact led voltage but the driver (image attached) says 27-36V DC output, MODEL: 50W. Is there a part I could place between ...
2
votes
2answers
64 views

Is it possible to have long wire connections from an NodeMCU to a servo motor or button?

For my proyect, I need to conect my NodeMCU to a servo motor as well as a push button, the thing is, the distance from the NodeMCU and both components has to have a distance of around 6.10 meters (or ...
2
votes
0answers
26 views

Brushless motor vibration/jitter/noise - arduino uno

I am currently using these motors and driving them off these drivers and an arduino uno, and alternatively trying to make them turn using the setup in step 6 (both with l298n and without) in this ...
1
vote
1answer
39 views

How can I PWM 4 LEDs from 0 to full brightness using a two axiz resistive joystick?

I am trying to use the Arduino MAP function to allow me to PWM 4 LEDs between 0 and full brightness. I guess the tricky part is that the joystick neutral position is at the venter of the range of the ...
0
votes
1answer
58 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 ...
0
votes
0answers
94 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
151 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
53 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
67 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 ...
2
votes
2answers
72 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
2k 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
50 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
1answer
54 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
140 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
59 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
275 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
53 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
201 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
63 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
71 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
99 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); ...
0
votes
1answer
93 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
672 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 ?

1
2 3 4 5
10