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

Is it possible using an arduino to control more than 4 PWM fan at 25khz ? I have found this but 4 PWM limited with an UNO https://arduino.stackovernet.com/fr/q/8407 An other arduino, like a 2560 ...
Seb Lemania's user avatar
1 vote
2 answers
568 views

Working on my first real sketch, so will try to keep this short. Feel free to ask more info if needed. To power a flyback transformer I need to apply PWM -to- a PWM signal. The easiest way to ...
Sam43's user avatar
  • 11
1 vote
1 answer
256 views

I am new here and I know that this basic question has been answered in the past but what I want to know is this. And I cant figure out how to add this to one of those threads. Sorry in advance if I am ...
user49780's user avatar
0 votes
3 answers
2k views

So, I'm trying to read the voltage on analog pin A0 and make a "regulation", where if the voltage will be lower than 2.5V (analog value 512), then it should be output pin 9 used as PWM with duty cycle ...
Jakey's user avatar
  • 196
-3 votes
2 answers
2k views

I have an Arduino project where I am using an ESP8266 (Wemos D1 mini) powered via USB. I want/need to output an analog voltage from 0 to 10V. Goal: A solution that is pre-made (eg a shield or ...
David's user avatar
  • 125
0 votes
2 answers
274 views

I'm working on a project which consists of 2 different function. since the arduino only can do 1 function so i decide to use 2 arduino instead. my idea is 1st arduino will give a output and the sketch ...
Asrul Asyraff's user avatar
2 votes
2 answers
4k views

I'm rebuilding a laser CNC machine and using LaserWeb4 as the control interface and GRBL 1.1 as the low-level interface to the stepper motors, limit switches and the laser. I have all the motion ...
Transistor's user avatar
2 votes
2 answers
14k views

I want to control a single pin of an ESP-WROOM-32 to have a 25 kHz PWM signal. How do I do that in Arduino Studio? I compiled a "hello world" program for such a device successfully in Arduino Studio, ...
Regis May's user avatar
  • 131
0 votes
1 answer
2k views

I would like to create a 18650 battery automatic management system that can handle and restore used up cells using solar panels for power. To do that I need to create adjustable constant current ...
Filip Franik's user avatar
  • 1,312
1 vote
1 answer
141 views

I'm using a PWM port and outputting a freq. Is it possible to pulse the PWM port using software to simulate a pulse gate. For example, I'd like to output a freq of 111hz, but would like to gate that ...
Wildview's user avatar
  • 115
0 votes
1 answer
112 views

Please help me determine the circuit's power consumption from the battery and help me outline the steps to calculate?
Walex2bad's user avatar
3 votes
1 answer
340 views

The following question is based on the Arduino Pro Mini (8MHz, 3.3V) I'm in process of developing (yet another) LED strip driver shield. For that I wrote a simple control loop, that adjusts the ...
Patrick's user avatar
  • 33
2 votes
1 answer
2k views

I need to obtain 200 kHz from Arduino Uno. I am using Timer0. I have configured it to run in normal mode and the Prescaler is set to clk/8 (the clock frequency of Arduino is 16 MHz). TCNT0 ...
Prabhat Narang's user avatar
0 votes
2 answers
968 views

I have a Teensy 3.2 and I am using the Arduino IDE to program it. I am trying to generate 8 pulses with the frequency of 40 kHz and this needs to be repeated every second. I have written 3 different ...
csg's user avatar
  • 141
1 vote
2 answers
1k views

I have this code, which puts the Arduino into CTC mode with interrupts, and outputs a square wave on PD6 (OC0A): void setup_timer(double p_ms, double duty){ DDRD |= (1 << 6); // set pin 3 as ...
Greenonline's user avatar
  • 3,152
0 votes
2 answers
335 views

I tried to obtain 32Hz pulse train(between 30Hz and 35Hz is also fine) with around 20us pulse width with Arduino Uno but couldn't succeed. The problem is: If I do the following: void setup() { ...
user16307's user avatar
  • 237
0 votes
1 answer
3k views

I am learning Arduino programming and my current project for real use is to connect 10-17 PC chassis PWM fans to be temperature controlled by the arduino. So, I have connected the fans exactly as in ...
10100111001's user avatar
1 vote
2 answers
293 views

I found a working code that uses pin9 (PB1) on my Arduino for controlling a Servo, but in my project, an ultrasonic sensor is already using that pin/timer. I want to convert the code to use pin6 (PD6),...
Peti's user avatar
  • 11
1 vote
0 answers
213 views

I'm playing with the standard L298N motor board and Arduino MKR 1000. However something strange happens: when I upload a new firmware and when I turn on the Arduino power supply (every time Arduino ...
Surfer on the fall's user avatar
0 votes
2 answers
4k views

I'm a beginner and I've been developing my own library for a wave player. so far I have the SD card installed and OLED and rotary encoder all connected. I've successfully read the wave chunk and it's ...
Sankalp's user avatar
  • 11
-1 votes
2 answers
916 views

I have a 4kHz pulse as trigger and I need two phase-shifted PWM output with divided frequency from arduino uno. Now I've managed one PWM output using the following code: int cnt = 0; void setup() { ...
7E10FC9A's user avatar
  • 209
0 votes
1 answer
1k views

I am working on a project to blow air gently through a number of pipes and variable speed. I would like to use a standard PC case fan and have control of whether the fans are on/off and also what ...
Steve's user avatar
  • 103
-1 votes
1 answer
2k views

I am new to the Arduino stuff and I am using L298N to drive two DC motors. When I searched online for sample code, I noticed that there are two types of design. One type uses analogWrite(pin, ...
roTor-roTor's user avatar
1 vote
1 answer
279 views

board: Arduino Mega (ATMEGA2560) I want to generate pulses using timer1 configured as Fast PWM, this is my code which works fine: #include <avr/io.h> int main(void) //void setup() { DDRB ...
Mr. C's user avatar
  • 113
0 votes
1 answer
390 views

On Arduino Uno Rev3, I just ran the speaker_pcm demo that used TIMER1 and TIMER2 to generate a PWM wave. However, this means that the Pins 3, 9, 10 and 11 can not be used anymore; according to the ...
strNOcat's user avatar
  • 111
0 votes
1 answer
662 views

I am using "blue-pill" STM32F103C8 (http://wiki.stm32duino.com/index.php?title=Blue_Pill) to create VGA output. I am connecting PB6 to VSync, PB0 to HSync, and PA0 to red using 278 Ohm resistor. I ...
Andrey Belykh's user avatar
1 vote
2 answers
2k views

I d'like to test if the PWM mode is working correctly on the pins of my Arduino Board. Do you know a simple schema to do this ?
snoob dogg's user avatar
3 votes
3 answers
7k views

I have recently bought this light dimmer, and only when I received it I noticed it works with PSM (Pulse Skip Modulation) and not PWD (Pulse Width Modulation). Does anyone know how to write Arduino ...
Guy Sopher's user avatar
0 votes
1 answer
730 views

I have a NodeMCU controlling an RGB strip. I have followed a guide and used this code: #include <ESP8266WiFi.h> #define redPin 13 //D7 - Red channel #define grnPin 12 //D6 - Green channel #...
Username's user avatar
1 vote
0 answers
757 views

I have old speaker which I want to use to play sound. I chose to use PWM mode on ATMega328 (which is in turn on Arduino Uno R3 board) in order to do it. For signal on the speaker I chose rectangular ...
LRDPRDX's user avatar
  • 183
-1 votes
1 answer
1k views

I would like to generate a sinusoidal signal of 40kHz using Arduino Uno. Maximum I could generate was 1kHz, using bit banging, fast PWM. Do you have ideas of how to boost it to 40kHz? I used "...
Bogdan Raspopin's user avatar
0 votes
2 answers
148 views

So I am writing code to control a servo with an RC radio. I am using an Arduino Mega. I get this error whenever I compile. I am not that experienced with Arduino so I am probably not doing something ...
Ethan J's user avatar
  • 35
0 votes
1 answer
176 views

I have a 62.5 kHz square wave created by timer2 on the pin 3. I would like to be able to use digitalWrite(3, HIGH) to force pin 3 high for several clock cycles, but then I would like it to return the ...
Micah Spurrell's user avatar
0 votes
2 answers
2k views

I'm kind of new on the field of Arduino. Although I have a question concerning multiple fan connection on 1 arduino PWM pin. The goal is to connect around 8 to 16 fans on 1 arduino pwm header pin and ...
dmxyler's user avatar
0 votes
2 answers
594 views

I'm working on a project where I could have up to six devices connected to an arduino, it might be the case that not all of them will be attached at the same time, and all of them need to be able to ...
ProfFalken's user avatar
0 votes
1 answer
187 views

I'm working on a project with Arduino to make LED timer with fading feature. After doing some research finally I wrote some code but it's not working until now P.S i don't have any knowledge in coding ...
kamal's user avatar
  • 3
1 vote
1 answer
1k views

So I am using Arduino to control RGB Strip light, the analogueWrite(Pin,Value); Works with the prebuilt AnalogueWriteMega example - on pins 8, 9, and 10. When I move this into my program, Pin 8 still ...
user42506's user avatar
2 votes
2 answers
6k views

I am currently working on a robotics project that requires 16 PWM outputs to control 16 servos. Is it possible to use Arduino Uno's digital pins as PWM output pins through code? If it is not possible,...
Miguel's user avatar
  • 118
1 vote
1 answer
1k views

I have noticed that when I used a log pot from a guitar amp I found, it gives janky results when using it in a motor PWM sketch, but if I use it in a fade sketch, it works. why does log pots give ...
Jim's user avatar
  • 31
1 vote
1 answer
4k views

I've noticed that when using the USI interface on the ATTiny to send I2C via the methods from "Wire.h" with the ATTiny Arduino implementation included from the library manager (ATTinyCore), while ...
MattyZ's user avatar
  • 135
1 vote
1 answer
55 views

I learned from answers here that pinMode(0, OUTPUT) is a platform-independent equivalent of DDRB = 1<<DDB0, on the ATTiny85. Are there platform-independent functions for the following? TCCR0A =...
johny why's user avatar
  • 163
2 votes
1 answer
225 views

Okay, so here is what I'm trying to accomplish: I have four LEDs, under my fish tank, that I want to fade in and out. I want each LED to fade at a different rate, start at a different "brightness" ...
antiDill's user avatar
4 votes
1 answer
299 views

i have this simple code that i use for generating a square wave signal of 125 KHz on pin 9 using Timer1 in the "Clear Timer on Compare Match (CTC) Mode". I also use Timer1 Compare Match A interrupt ...
Anacleto's user avatar
1 vote
3 answers
2k views

How to produce 6 PWM signals with 60 degrees phase shift using Arduino Uno 6 PWM pins like in the image below?
Ahmad Naoum's user avatar
1 vote
2 answers
7k views

I have Arduino Uno and I attached it to 2 DC motors with L298N bridge. I want to control the speed of the motors so they don't move at maximum speed. I use analogWrite() but it does nothing,and the ...
Mustafa Mohamed's user avatar
1 vote
0 answers
182 views

I need generate 4 pulses, for the digital outputs, for example 8,9 and 10,11, at this moment I am using an Arduino Mega. The pulses have these characteristics: 1) 8 and 9 are the same pulses, but I ...
Juanda Franco's user avatar
5 votes
2 answers
2k views

I fail to use PWM in power saving mode. The output behaves erratically. This should be possible, I guess. The following is a minimal working example: /* MWE: Cannot use PWM in any power saving ...
stefan's user avatar
  • 153
3 votes
3 answers
26k views

I have been using an Arduino Nano as a PWM controller for a heating element. I am currently using D11 (PB3). I could change, although all pins with PWM are in use, and would require a re-write and re-...
Milliways's user avatar
  • 1,655
2 votes
2 answers
471 views

I am making use of the code below to control the speed of an AC fan and the intensity of an AC Lamp with an Uno. The problem I am having is that, when I set the lamp intensity to low or medium, the ...
Imraan's user avatar
  • 23
2 votes
1 answer
134 views

I have made a custom-development hardware for our school, where you can plug in an Arduino Due. It is mainly for driving all kind of motors and reading sensor signals. Therefore I added a custom SAM ...
Chris's user avatar
  • 23

1
3 4
5
6 7
10