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

having issues with arduino uno and max6675

I am trying to make closed loop a automatic temp controller to heat a thin metal plate using a buck converter, max6675 thermocouple module for temp sensing and a 250 watt halogen lamp. I am giving ...
0
votes
2answers
535 views

Use Adafruit 16-Channel 12-bit PWM/Servo Shield to switch relays

I'm wondering if using the Adafruit 16-Channel 12-bit PWM/Servo Shield is it possible to switch relays, such as use that shield as a multiplexer and use digital output without PWM. Is it possible? ...
0
votes
0answers
20 views

maximum interrupt-based PWM frequency at 500 Hz

I need to control a 24 kHz ultrasonic transducer and decided to use an arduino uno I have lying around. Using tone() or the atmega's hardware pwm is not very suitable because I need two 50/50 square ...
1
vote
1answer
73 views
+100

Trouble with setting the PWM frequency for Arduino Due

I'm using Arduino Due and I set the analog read and write resolution to 12-bit for better resolution. Basically all I do is to vary PWM duty cycle by controlling analog DC input voltage from 0 to 3.3V....
0
votes
0answers
54 views

Why the PWM blinking the LED?

The LED on PWM pin is blinking while turning it on! Here's the code: int onHourONE = 11; int onMinuteONE = 00; int offHourONE = 23; int offMinuteONE = 00; unsigned long PWMdelay = 236; int PWMstatus =...
0
votes
0answers
28 views

Servo PWM Pin seems to be interfering with Wire.onRequest i2C function

A newbie here. I am thinking of interfacing Raspberry Pi with Arduino via I2c to control a few servo motor (as RPi have limited PWM pins). Meaning I would send input from RPi to Arduino to allow to ...
0
votes
1answer
23 views

Losing top brightness when using tip120 and PWM with 70w LED panel

I have been experimenting with pwm dimming using TIP120 on various high powered LED's, and have noticed a marked drop in the top level brightness compared to original connection without the tip 120 in ...
0
votes
1answer
38 views

ESP 32 changing frequency instead of duty cycle

Using this code on an esp32 allow to vary duty cycle of the PWM with a fixed 5000Hz frequency and is working fine. My question is how to vary frequency and keep duty cycle on a fixed value? // the ...
0
votes
1answer
37 views

Phase and frequency correct PWM mode Arduino Mega 2560

I wrote a code to generate 1kHz Phase and frequency correct PWM signal from Arduino mega 2560 using timer 4. When I try the code with fast PWM mode it works perfectly. But phase correct mode didn't ...
-1
votes
0answers
24 views

How to create a phase delay of 30 degrees in PWM using timer registers

I am trying to generate the PWM pulse of 157khz with zero degree and 30 degree phase delay. I obtain the zero degree delay. How can I phase shift 30 degrees?
0
votes
0answers
11 views

IRF520 max frequency [migrated]

I'm having trouble supplying 300mA to an led COB using an IRF520 MOSFET as PMW, controlled with arduino nano. What is the maximum Frequency, in which I can turn the led on and off in this setting? ...
0
votes
0answers
27 views

PWM voltage appears to be low (~0.33V) and fails to trigger a PWM dimmer LED controller

I am attempting to use the Arduino Uno to tune the current on a SparkFun Femtobuck LED driver. The driver itself appears to work fine and outputs 0.33A when the PWM pins are not connected. However, ...
0
votes
1answer
47 views

PWM delay without blocking the code

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

Can I use the PWM pins as regular digital input/output pins?

In regards to the arduino which has pwm pins, can I use these pins as normal input/output digital pins or not? Thanks in advance.
-1
votes
2answers
92 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
40 views

DC motor phototransistor control

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

Send serial data at custom voltage using PWM

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

16-Channel 12-bit PWM/Servo Shield check if it is powered by adapter

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

Is it possible to output a variable clock using Fast PWM?

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

6 channel PWM with 2 - 5 kHz frequency

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

Arduino programming with multiple loops

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 ...
2
votes
2answers
818 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 ...
4
votes
8answers
22k views

How to eliminate noise from PWM controlled 12V fan at low speed

I am trying to build a simple fan controller (single fan). So far I have successfully created a circuit which powers the fan with an external 12v DC adapter and added a transistor (NPN) to switch it ...
0
votes
1answer
50 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. ...
2
votes
3answers
114 views

Using Servo on Timer3 on a Leonardo

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

Timer CTC Set and Clear modes — How to un-Clear and un-Set?

Nick Gammon's cheatsheet for the Ardunino UNO's ATmega328P (below) shows some hints on the Clear Timer on Compare (CTC) modes of AVR chips. Most of the examples for CTC mode I find use the COMxxx ...
0
votes
2answers
41 views

How does input from IR receiver to Arduino UNO board work?

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 ...
-1
votes
2answers
79 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
93 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
2answers
74 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
45 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
0answers
43 views

How to change phase correct PWM mode frequency

I've tried many method to change the phase correct pwm frequency, but failed. I need to change the phase correct pwm frequency to 20khz. The code below, provide phase correct pwm at 31272Hz frequency. ...
4
votes
1answer
1k views

PWM signaling with Arduinos: What is the reason for the ground connection?

This may sound like a very dumb question and I apologise in advance. I've gone through reading about PWM and working on some example sketches to control PC fan speeds using PWM and Arduino. In all ...
0
votes
3answers
26 views

For Arduino Uno it is possible to use the digital pins with PWM to read analog data, is this also possible with the Wemos D1 Mini?

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

the code and the actual output didn't match

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

generate two phase-shifted PWM pulses triggered by frequency-divided external signal with Arduino uno?

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() { ...
0
votes
2answers
460 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
617 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
509 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
252 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
214 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
153 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
895 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
43 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
51 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
47 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
67 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
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 ...