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
2answers
426 views

Encoders for precise robot turns

So I recently purchased: DFRobot Wheel Encoders DFRobot 3PA and 4WD Rovers (2pk) Romeo V2 Arduino Controller I was doing a bit of research online and I'm trying to figure out how to use the ...
0
votes
1answer
367 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
477 views

Is it possible to use Arduino PWM for audio within a PAM8493 amplifier?

I've seen some projects using PWM for playing audio files, and it seems like it needs an amplifier, otherwise the sound is very low. I already made a project using a DFPlayer and PAM8403, but now I ...
0
votes
1answer
162 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....
1
vote
1answer
198 views

Simplest/best way to control a set of 8-10 PWM signals from a smartphone

As part of a larger project, I would like to be able to control a set of 8-10 PWM signals remotely, from a smartphone at a distance of 10 meters or more. I will probably convert the PWM signals to ...
0
votes
1answer
93 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
3answers
878 views

Converting Random Binary Data to PWM Signal

I am using a Arduino Due. I am doing a project on Visible Light Communication. I need to convert a binary data into a PWM Signal. Can anyone suggest me a method of generating that PWM Signal based on ...
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
38 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
34 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
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
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
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
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
1answer
1k views

Arduino crashing and rebooting

I have recently written a program which is supposed to change the duty-cycle to keep the feedback voltage measured on A0, A1 constant. The problem is that the Arduino will start crashing at pretty ...
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 ...
0
votes
2answers
9k views

PID control for Motor Speed control

I was trying to apply PI controller to a motor using Arduino. I have somewhat achieved the task but the problem is that it oscillates too much. Also i couldn't figure out what to do when pwm signal ...
-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
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 ...
0
votes
1answer
33 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 ...
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 ...
1
vote
4answers
16k views

Issue with PWM output pin

I'm just starting off with using the Arduino and was learning about PWM (http://arduino.cc/en/Tutorial/PWM). Below is what my circuit looks like. Below is the very simple code. const int pinNine = 9;...
3
votes
4answers
6k views

Transistor amplifier to drive speaker using Arduino PWM [closed]

I have been working on a project lately which uses Arduino to play a wav file from SD card. I am using TMRPCM library which made the job very easy. But the problem is that the output sound in the ...
0
votes
0answers
23 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 ...
-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
2answers
4k views

How to make sure Arduino's PWM pulses are phase shifted?

I'd like illuminate my room solely with several RGB LED strips using Arduino's PWM (together with LED amplifier and few transistors). I want the Arduino to control 2 independent chains of LED strips,...
0
votes
0answers
58 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 ...
2
votes
2answers
245 views

Does the square-wave nature of PWM dictate how much resistance you need?

I think the answer is yes, but I wanted to ask the question anyway for future common reference. And to check my understanding. Say I want to power 10 LEDs with PWM with my Mega 2560. I have a bunch ...
7
votes
1answer
1k views

How can the Arduino Uno support up to 12 servos if it only has 6 digital PWM pins?

According to this: The Servo library supports up to 12 motors on most Arduino boards and 48 on the Arduino Mega. On boards other than the Mega, use of the library disables analogWrite() (PWM) ...
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 ...
0
votes
1answer
74 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: ╔═══╦════════╦═════════════════╦════════╗ ║ # ║ ...
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
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
33 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 ...
7
votes
2answers
34k views

Set PWM frequency to 25 kHz

I currently can set four PWM pins to around 31 kHz with the following code: void setup() { TCCR1B = TCCR1B & B11111000 | B00000001; // Set PWM frequency for D9 & D10: pinMode(...
1
vote
4answers
2k views

Generating a 38 KHz signal without timers

I am currently trying to generate a 38 KHz signal for my TSOP4838 (http://www.vishay.com/docs/82459/tsop48.pdf) with an ATtiny84A. I know the real thing would be to utilize a timer but the ATtiny ...
1
vote
3answers
7k views

Arduino Nano PWM frequency

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

Help - Atmega328p, converting a PWM servo code from pin9 to pin6

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),...
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 ...
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
1answer
144 views

How to control RC power switch with Arduino-/Adafruit-Board?

I want to control (switch on/off) a solenoid valve via an RC power switch and an Adafruit M0 Feather Bluefruit LE. The RC power switch is this one, and this is the Adafruit Board Pinout. My ...
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 ...
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 ...