Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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 ~).

0
votes
0answers
29 views

Arduino Uno Controlled Heater

I am a novice in Arduino. I am working on a temperature controller for a hot plate. I have a PT100 as sensor which is being driven by a 1mA constant current source. As the resulting output voltage is ...
0
votes
1answer
37 views

There is no PWM output

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. ...
0
votes
1answer
33 views

PWM Control, How to stop LED from Flickering?

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 ...
0
votes
0answers
16 views

AC load control [closed]

I got my arduino connected to a triac with a zero detection circuit. Using this to control the number of AC pulses sent to a load. So far i am detecting each to 220V AC period and use a 10 period ...
0
votes
2answers
47 views

Setting a pin to a continous wave output

Is there any way in Arduino to set a particular pin(pwm or not) to just generate a square wave out of the desired pin? For instance, I want to have two pins on my Arduino Uno that output two square ...
0
votes
1answer
35 views

Not able to control DC motor speed with l298N & pwm pins

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 ...
0
votes
0answers
34 views

PWM C Code some logical error

I don't know what's wrong with the code I have activated all the bits I need. I want the code to slowly increase the brightness of the bulb and then reset and then the same thing goes on. Please help ...
-1
votes
2answers
56 views

L298N Motordriver [closed]

I am working on a schoolproject for a line-following car. We are using 2 motors, which operate between 12-24 Volts ( https://uk.rs-online.com/web/p/dc-geared-motors/4130638/ ). We use 3 9V batteries ...
0
votes
1answer
50 views

Replicate output of pwm pin on another output pin?

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 ...
-2
votes
1answer
43 views

What should the cut-off frequency be? [closed]

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 ...
0
votes
1answer
32 views

Attach() resets servo's angle

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 ...
0
votes
0answers
50 views

Arduino LED PWM dimmer starts blinking on low PWM values

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

What does “Update of OCR1x at” mean in the WGM table of ATMEGA328?

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 ...
0
votes
0answers
21 views

Use PWm and zero_cross_detect interrupt

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 ...
0
votes
0answers
56 views

Control Fan Speed Using ESP8266

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 ...
-1
votes
1answer
46 views

Outputting 400 mV using Arduino Nano PWM pin

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

Servo Motors PWM pins, Arduino Uno

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 ...
0
votes
1answer
63 views

SoftPWM update limitations

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 ...
2
votes
1answer
41 views

Mega 2560 pin output power and control question

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 ...
0
votes
1answer
72 views

How to read a 25 kHZ PWM signal from PC fan header?

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: ╔═══╦════════╦═════════════════╦════════╗ ║ # ║ ...
0
votes
0answers
32 views

Sketch works on MEGA 2560 timer2, but does not work on timer1

I set the PWM frequency on MEGA 2560 like this: TCCR2A = 0; TCCR2B = 0; TCNT2 = 0; TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM20); ...
0
votes
1answer
32 views

Do you need an ESC to run this brushless DC motor with Arduino Uno?

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 ...
1
vote
2answers
36 views

Arduino Mega PWM - 100ms Period - SSR and Heater

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 ...
1
vote
1answer
72 views

How to initialize and run PCA9685?

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 ...
0
votes
0answers
98 views

How to get PWM frequency to ~14KHz?

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 ...
-1
votes
2answers
68 views

let Arduino limit it's own input power

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 ...
1
vote
1answer
54 views

Does direct port access interfere with PWM?

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

Which LCD Pins, if any, require PWM?

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

Generating and reading a PWM signal at the same time on Arduino Uno R3?

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 ...
1
vote
1answer
47 views

Arduino Uno vs Arduino MKR1000 analogRead discrepancies

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

How to read a PWM OUTPUT PIN value?

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(...
0
votes
1answer
37 views

Programming a switching AC current?

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 ...
0
votes
1answer
54 views

Reading analog value while generating PWM signal

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 ...
0
votes
1answer
91 views

Actuating a Hobbywing Skywalker 50A-UBEC ESC with Arduino CNC Shield

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 ...
0
votes
1answer
114 views

Arduino pin 13 as PWM output, not possible?

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 ...
0
votes
1answer
40 views

Turn infrared LED on and off in order to simulate an infrared signal

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

Won't break out of for loop

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 ...
0
votes
1answer
95 views

Problem with interrupts

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 ...
0
votes
1answer
42 views

Help with simple gradually brighter flickering led

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 ...
-1
votes
1answer
271 views

ESP32 Dimmable LED Panel with MOSFET [closed]

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 ...
0
votes
1answer
360 views

Changing PWM on Arduino Mega, pins 9 & 10 to 20 to 25 KHz

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 ...
0
votes
1answer
160 views

How to change speed of multiple servos acting at the same time with PCA9685 module?

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....
0
votes
1answer
154 views

More than 4 PWM output at 25khz?

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 ...
1
vote
2answers
121 views

PWM of a frequency signal?

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 ...
1
vote
1answer
100 views

Increase PWM bit resolution on only one timer 2 output

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 ...
0
votes
3answers
154 views

Using delay(1000); without influence on analogWrite?

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 ...
-3
votes
2answers
288 views

1-10 volt analog signal

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 ...
0
votes
1answer
114 views

Generating two 1MHz, 33% duty cycle PWM signals [closed]

I have been trying to generate two identical PWM signals. Both the signals should have a duty cycle of 33%. The first signal starting at 0us and the other at 0.5us. After watching the tutorials I came ...
0
votes
2answers
77 views

Sending arduino signal to another arduino

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 ...
3
votes
2answers
555 views

How close to 5 kHz can I set the PWM frequency on an UNO pin 11?

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 ...