Skip to main content

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
1 answer
2k views

I want my LED to turn on gradually without using the delay() function and blocking the code. Here's the code i came up with: int led_pin = 6; unsigned long millisTimer = 0; int PWMdelay = 5000; int ...
ElectronSurf's user avatar
-1 votes
2 answers
228 views

The Raspberry Pi has 3.3 V logic level and the Arduino has a 5V logic level. It is warned against connecting the Arduino TX to the Pi RX: Pi is 3.3v and the Arduino is 5v. Connect the two and you ...
AJP's user avatar
  • 181
1 vote
1 answer
3k views

Using this code on an ESP32 allows varying the duty cycle of the PWM with a fixed 5000 Hz frequency; it is working fine. How do I vary the frequency and keep the duty cycle at a fixed value? // the ...
lucian_v's user avatar
0 votes
2 answers
252 views

I am trying output a clock and change its frequency dynamically with a rotary encoder. When the code for the rotary encoder is included the clock doesn't reach its max freq(31Khz). But without the ...
user2242960's user avatar
0 votes
1 answer
476 views

Is it possible to set all 6 PWM frequencies to a value between 2 and 5 kHz? I've read that the base frequency for pins pins 5 and 6 is 62500 Hz. And the divisors for the pins 5 and 6 are only this ...
Wa Kai's user avatar
  • 111
0 votes
1 answer
833 views

I was trying to program my Arduino (along with a connected motor controller) to switch from cycle to cycle with this program. It doesn't seem to work however. There's still plenty of storage space ...
Tom's user avatar
  • 131
0 votes
1 answer
156 views

I'm using Adafruit 16-Channel 12-bit PWM/Servo Shield with Arduino Uno controller In setup() I have a number of default positions with PWM commands for motors with plug of USB to PC and turning on I'...
lf80's user avatar
  • 105
1 vote
2 answers
495 views

So basically I have a circuit with a phototransistor, and want to convert the phototransistor value into a PWM signal that can control the speed of the motor. The code I came up with is below, however ...
PythoniusNoobus's user avatar
1 vote
2 answers
2k views

I have a very simple circuit with an Elegoo IR receiver module connected to an Arduino UNO. The three wires are connected correctly with the data wire (Y) connected to pin 8. The code works fine, as ...
yannism's user avatar
  • 21
2 votes
3 answers
900 views

I would like to use the Radiohead library and control a servo from the same Leonardo board. Now the Radiohead library occupies timer1 and therefore cant be used together with the servo library. (It ...
clamp's user avatar
  • 73
0 votes
3 answers
495 views

I want to read out data from a load cell, for this I seem to need 2 analog input pins, the Wemos doesn't have this. In the Arduino I was also able to use the digital pint with PWM, there are also ...
Lieke de Mare's user avatar
1 vote
2 answers
103 views

i want to make the stuff, which the output is written from the analogread, but when the A3 == HIGH, the output pin 9 is used, but when the A3 == LOW, the output pin 10 is used, and when i simulate it ...
john caren's user avatar
-1 votes
1 answer
114 views

I recently made a project where output is coming from the differential between data reading and reference value. It works on my Proteus simulation but there is no PWM output on my real world device. ...
john caren's user avatar
0 votes
1 answer
939 views

What is required is controlling the brightness of an LED using both Buttons and a Potentiometer, Button A: Increase Button B: Decrease /Dim Potentiometer: Increase and Decrease, This however must ...
Boi G's user avatar
  • 1
1 vote
2 answers
3k views

I am using arduino uno to control dc motor speed with L298N. But the problem is that the motor is only going at max speed. PWM pin doesn't work for some reason. I heard many people had some problem ...
suu's user avatar
  • 85
0 votes
1 answer
375 views

Ardiuno Mega 2560 I have a legacy PCB that connects PORTA, pins = {22, 23, 24, 25, 26, 27, 28, 29} to the PWM input of a set of actuators. The accompanying code made use of an interupt service ...
DrBwts's user avatar
  • 161
-2 votes
1 answer
920 views

To convert a PWM signal to a DC voltage it must be filtered with a low pass filter. How can you know which cut-off frequency should be used and how do you calculate the values for the resistor and ...
Sophie's user avatar
  • 1
0 votes
1 answer
289 views

I'm working on code that will control micro servo. I use generic servo and built-in library for controling servo. Microcontroller is generic STM32. Controlling servo Works as expected. But I don't ...
Pararera's user avatar
  • 213
0 votes
0 answers
1k views

I'm trying to build a PWM led dimmer with Arduino using this circuit: simulate this circuit – Schematic created using CircuitLab Everything works fine until the pin PWM 3 drops below the analog ...
LuxGiammi's user avatar
  • 101
4 votes
1 answer
580 views

I just finished a reading a couple of online guides on how to use timer registers with pulse width modulation, so I'm still new to its concept. When I looked in the ATMEGA328 specification sheet, I ...
learningtech's user avatar
1 vote
0 answers
195 views

I use an Arduino Uno for controlling one DC motor speed with PWM and one dimmer for control heater. The dimmer and PWM control worked standalone, but when I want them to work together, the dimmer ...
Ismail Tuluce's user avatar
0 votes
0 answers
814 views

Hello i am using ESP8266 to control my 220v AC ceiling fan. I am able to do that easily with a 5v 10A relay module. But i want to know is there any module to control the fan speed as well? i have ...
user3201500's user avatar
0 votes
2 answers
916 views

I am trying to output analog voltage (400 mV) using Arduino Nano PWM pins. Is it okay to directly connect (using jumper wires) the PWM pins to the Vin+ of the INA219 current sensor? I badly need it ...
Jan Lauren Manipol's user avatar
0 votes
2 answers
2k views

I wanted to understand how people are connecting a servo motor to pins without PWM, so I went searching and I read that the Servo library uses the timer1 of pin 9 and pin 10 to be able to use other ...
wesWWW's user avatar
  • 5
0 votes
1 answer
569 views

i'm using arduino to dimmer 9 led strips with different output pins after an FFT audio analysis gives results at 60Hz = 16ms. [FFT is performed by a PC and sent to arduino using a RF24 module] I ...
brazoayeye's user avatar
2 votes
1 answer
1k views

I am trying to determine the total pin power requirements for my Mega 2560 project; it will connect to 3 1m Neopixel strips and 5 RGB laser fiberoptic lights, and control them via PWM. Each strip and ...
David W.'s user avatar
0 votes
1 answer
2k views

I would like to control a DC motor's speed using the PWM output from my motherboard header. Here's the standard pinout for a 4-wire PC fan header: ╔═══╦════════╦═════════════════╦════════╗ ║ # ║ ...
David Refoua's user avatar
1 vote
0 answers
281 views

I set the PWM frequency on MEGA 2560 like this: TCCR2A = 0; TCCR2B = 0; TCNT2 = 0; TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20); ...
laoadam's user avatar
  • 45
0 votes
1 answer
274 views

This is the motor: https://www.aliexpress.com/item/Wholesale-JGA25-2418-8-5-1977-rpm-Electric-Motors-Brushless-Motor-High-Torque-Speed-Controlled-DC/32360228129.html I'm hooking it up to the arduino ...
Scylly's user avatar
  • 15
1 vote
2 answers
2k views

I'm not very advanced in Arduino "core" functions, so I need your help. I'm using a Solid State Relay in order to control a heating element, with a PID Library (PID_v1.h) to obtain the OUTPUT of the ...
Everton JS's user avatar
1 vote
1 answer
2k views

I'm trying to write a simple code for initializing and running the PCA9685. I tested the board with Adafruit library and it's working. But I just want to develop a simple code to include it in my ...
R1S8K's user avatar
  • 283
1 vote
0 answers
425 views

I found this question: Set PWM frequency to 25 kHz It is useful, however, I want to use it to generate ~14KHz? int d = 0; // pwm value void setup() { // Sets Timer1 to Phase Correct ...
laoadam's user avatar
  • 45
1 vote
0 answers
189 views

On my Arduino Mega, there are two PWM pins open. There are eight analog voltage inputs to a datalogger. They are connected through a PCB, and I need test them with a DC voltage sweep. (There are many ...
adamaero's user avatar
  • 198
-1 votes
2 answers
105 views

My current project will be sitting next to a 12VDC power line. It seems a waste no to tap it to power into the Arduino board too. Now I read everywhere that with 12V input quite a lot power gets ...
resurrected user's user avatar
1 vote
1 answer
367 views

I think I've scoured the SE for questions about PWM, and fast digitalWrite etc, but I didn't see this point addressed. I need to use direct writes to some digital pins. Some of the pins on the port ...
Jim Mack's user avatar
  • 269
0 votes
2 answers
730 views

In the Arduino Tutorial Page named "Hello World" aimed to help people connect a 16x2 LCD Display compatible with Hitachi HD44780 driver to an Arduino Uno. The pins used to connect the Arduino Uno and ...
Bryan's user avatar
  • 67
0 votes
2 answers
2k views

The code below should generate a PWM signal on digital pin 3. But know I want to see if it is even working. I was thinking about a Event triggering method like ISR. But somehow it does not work. I ...
Gamdschiee's user avatar
1 vote
1 answer
215 views

I'm using an Arduino to control a BLDC motor connected with the motor driver. It is just a simple control which I'm using a PWM as a signal. Before this, I'm used Arduino Uno pin 5 to control BLDC ...
norul's user avatar
  • 13
0 votes
2 answers
5k views

How to get a pwm pin value that is in pinMode OUTPUT? How to get a digital OUTPUT PIN value: #define pin 3 void setup() { pinMode(pin, OUTPUT); Serial.begin(9600); } void loop() { delay(...
Kvartu's user avatar
  • 33
-1 votes
1 answer
105 views

I tried using this code to output AC power from one H-bridge and then another, switching every second, but when I connected a motor to it, it just seemed to output direct current. This is the code I ...
Tom's user avatar
  • 131
0 votes
1 answer
593 views

I'm trying to generate dim two LED strips simultaneously by generating two PWM signals based on potentionmeter value. The pot sets how bright each of the LED strips will be. To drive this I'm using ...
jnovacho's user avatar
  • 235
0 votes
1 answer
1k views

I need to control a brushless motor that came connected to this ESC using the Arduino CNC Shield V3.00 and Grbl 0.9j. I connected the ESC's black wire to a GND from the shield and the ESC's white ...
GuiRitter's user avatar
  • 121
1 vote
1 answer
663 views

I have noted on more than one occasion the comments in sketches "reserving pin 13 for future PWM backlight dimming of the LCD" while using Uno and Nano boards. Am I missing something ? I always ...
user avatar
0 votes
1 answer
642 views

Note I am able to send and recieve IR signals. This question is only for purposes of learning. When using the existing library #include <IRremote.h> it is very simple to read and transmit ...
Tono Nam's user avatar
  • 986
0 votes
2 answers
1k views

I'm new to Arduino and I'm trying to use PWM to generate a tone through a buzzer. I've created a for loop, however, the for loop doesn't seem to break when the variable ms is < 1000000. int ...
madewithrealfruit's user avatar
0 votes
1 answer
507 views

Alright. This is what I wanted to do: Make a circuit and code the arduino such that there are 2 tactile switches, each with a predefined pwm value. Whenever any one button is pressed the led should ...
Kishore's user avatar
  • 35
1 vote
1 answer
226 views

im a newcomer for arduino and sorry for any grammar error. So what im trying to do is replicating a flickering effect found on spacecraft thruster when they about to take off where the fire bursting ...
user194312's user avatar
1 vote
1 answer
2k views

I want to use ESP32 to control and use a dimmer for 6 LED panels in my bedroom. The specification of each panel is mentioned in the diagram. Although in the diagram it shows ONLY 1 MOSFET and 1 LED ...
Hira's user avatar
  • 41
0 votes
1 answer
4k views

I'm trying to run a Nema 17 motor with a l298N motor Driver for a school project. The issue is that I am running the motor with PWM to avoid overheating of the driver, however the resulting noise at ...
Jordan Gladstone's user avatar
-1 votes
1 answer
2k views

I'm using the PCA9685 module with its Adafruit library. In my code I have one object of the servodriver class that has 14 channels (controlling 14 servos basically). void Positioning(){ ServoDriver....
mechanist's user avatar

1 2 3
4
5
10