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 ~).
-1
votes
0answers
14 views
How would I make ShiftPWM-Redux compatible with the Arduino MKR1000 (SAMD21)
I'm trying to get the ShiftPWM-Redux library compatible with an Arduino MKR1000 board (similar to an arduino zero), but I haven't figured out how to do so. It fails at compile, with the following ...
-1
votes
0answers
22 views
Motor is not as powerful when connected and controlled through arduino and H-bridge using PWM
I am working on controlling the speed and direction of a DC motor.
The motor will has a 12v power supply, and it is controlled through an L298N H-bridge, and the PWM from and arduino UNO.
I have been ...
1
vote
1answer
30 views
Change from using the external crystal to the internal oscillator
BACKGROUND
I have made my own Arduino PCB based on the circuit of the Arduino Pro Mini (below) (including the external oscillator).
I have already written the firmware and the code is stable. The ...
1
vote
2answers
43 views
Can a timer be used in both CTC and (fast) PWM mode simultaneously?
I would like to generate a sequence of pulses of varying lengths in the range of 0-100us, so that from the start of one pulse to the start of the next there is a delay of 100us. I have set up timer0 ...
-1
votes
0answers
25 views
ATmega328P fast PWM code in timer 1 to fade the LED [closed]
I have to code about using Timer1 in ATMega328P to generate PWM signals in " fast PWM " mode.
Use the PWM signal to let an LED light up and fade out gradually.This is the homework but i just barely ...
1
vote
1answer
29 views
Help managing the fallout from timer0 mode and prescaler change on ATMega2560 without modifying wiring.c
For a driving application I need the PWM mode to be phase correct and the prescaler to be 1. The issue is that the board I am working with has the load hooked up to a PWM pin reliant on timer0. The ...
3
votes
0answers
32 views
Write PWM with only 8 bit? (Timer2)
I have a problem with the Servo library.
I need to read a PPM signal and create a PWM signal of each channel. The problem is that PPM has a higher resolution than PWM so I want to use the 16 bit ...
1
vote
1answer
34 views
Code Optimisation [closed]
I have tried fading the RGB Led with different colour format and sequence.
Working of Code :-
When value of number is 1, the Red LED fades gradually and glow up with the delay interval of 10ms with ...
0
votes
0answers
26 views
Generate the step signa for running a stepper motor
I am the moment trying to make a stepper motor run, aren't that sure what kind of signal i should provide the Step pin of my control board.
I read somewhere that a simple PWM would make it make it ...
1
vote
1answer
60 views
Individual control of multiple RGB leds
I'm trying to control several RGB leds individually. So far I've been able to control multiple RGB leds using only 3 PWM outputs using NPN transistors as shown here (pic below).
I would like to ...
0
votes
0answers
59 views
How To Generate Preamble bits using Arduino Uno
How to transmit 125Khz signal using Arduino Uno. It should have a carrier burst,seperation bit,Preamble bits and manchester encoding pattern as attached in the picture. How do I program this in ...
1
vote
1answer
32 views
Controlling 12v DC LED strips using Arduino UNO
I have 2 LED strips with 6 LEDs on each. They use a 12V power supply.
My question, how can I use them like regular LEDs using Arduino UNO? Without any MOSFETS or transistors if possible.
And can I ...
0
votes
1answer
51 views
Why is one LED more luminous (brighter) than the other?
Given that there is a circuit with two pins (12 and 10) from an Uno providing power to LEDs on two separate branches, why is the yellow LED dimmer than the green LED? (Please see below image.) To my ...
0
votes
1answer
26 views
Problems with running multiple ESC
I've written a program which allows me to use my Arduino Uno to send a PWM to an Electronic Speed Controller. 5 seconds after startup the ESC is sent a config via PWM to signal the low to high PWM ...
0
votes
0answers
32 views
Arduino PWM to control electronic toy
I am trying to control a basic childrens' electronic toy using Arduino Uno. I mean, I'd like the different sounds to be activated automatically by transistors driven by Arduino as opposed to actually ...
0
votes
0answers
23 views
a board with very high sampling frequency than arduino boards
Arduino can sample to frequencies of only few MHz. Which specialized board that have chips capable of sampling at very high frequencies (Gbps).
0
votes
3answers
69 views
Frequency generator
Can arduino generate the frequency with the resolution of 2 decimal places?
i.e. 100.12 Hz, 98.23Hz, 1.92Hz...
recently I need to generate a frequency to allow a stepper motor to move accordingly. ...
0
votes
1answer
32 views
How can I convert PID correction values to an PWM brushless command?
Please I'm working on a quadcopter, and I have to made my own flight controller based on arduino uno.
First of all please how can I get a filtred angular velocity and linear acceleration from the ...
0
votes
1answer
51 views
Generating an 8V PWM signal
I have a control module that accepts 8V PWM signals. My goal is to send a 500Hz PWM signal from an Arduino to an 8V PWM input on the control module. Looks like everything generated from the Arduino ...
0
votes
0answers
29 views
For statement break problem
I'm trying to make a timer but running into a problem. The seconds segment is working fine, however in the minuets segment I have a problem.
I've currently got a commented out break to stop it ...
1
vote
2answers
36 views
Switch statements with Bluetooth serial input not working
I am trying to control the brightness of an LED using PWM. I am also trying to make it so that when I click a button on my bluetooth app, I can get it to change the frequency of the PWM pin.
For ...
0
votes
1answer
77 views
How do you use an Arduino to control a 4 - 20 mA transmitter?
I am using an Arduino Mega to control the speed of an AC pump. This can be done by connecting to the variable frequency drive. Here is a link of the relevant datasheet, pages 66 and 67 relate to what ...
1
vote
1answer
430 views
Why do I get negative voltages for a PWM waveform?
I used my Arduino Uno's pin 3 to generate a PWM output. The code is:
void setup() {
// Put your setup code here, to run once:
}
void loop() {
analogWrite(3, 180);
}
I connected the output ...
0
votes
1answer
26 views
Does anyone have a data sheet for MC16-0072 [closed]
I can't seem to relibly find data sheets for MCM electronics parts.. Searched for hours.. Any help?
0
votes
1answer
54 views
Arduino Dim RGB LED
I have an RGB led and I (just) would like to dim is brightness programmatically.
I searched Google thoroughly without any interesting code.
Some of them present only "how to" fade from on to another ...
0
votes
1answer
169 views
NodeMCU Arduino set PWM Frequency to specific frequency
I am using NodeMCU and I program it using Arduino IDE, I need to change the PWM frequency of a port, in Arduino I used to change the frequency using timers registers like that:
TCCR1B = (TCCR1B & ...
0
votes
1answer
18 views
Trouble reading analog (PWM)
I'm trying to test my analog signal before I send it to an actual analog device. I've written some code and considering the analog square I have expected to see a digital ON or OFF during a single ...
1
vote
0answers
68 views
Arduino Quadcopter problems
I'm currently trying to make a quadcopter flight controller based on the Arduino Uno, and I've managed to make everything work for one axis by printing the values of two of the motors, except now that ...
1
vote
1answer
29 views
How can I get analog-in reading from Digital-PWM-out on the same board?
I have a wire going from PWM4 to A0 but I don't dare turn on my Arduino Mega in case this is incorrect.
PWM4 will eventually go to an analog device but I want to make sure the read value is what I ...
0
votes
1answer
162 views
Arduino PWM fading led in assembly
I'm writing Arduino UNO (=ATMega328P-PU) programs in assembly to save memory, so I use avra.exe (same as atmel studio's avrasm32) to compile and avrdude to upload, and simple programs like blinking ...
0
votes
1answer
38 views
PWM output voltage too high
I'm experimenting with PWM with the code below, but (according to my analog multimeter) the voltage on the output pins reach up to 5V whilst the largest analogRead(IN1) value is only around 700:
...
1
vote
1answer
62 views
PWM Every Other Pin Doesn't Read
Scenario
I've plugged 6 pins from my RC receiver into my Arduino in order to read the incoming values.
Problem
I'm using Digital PWM~ pins 2-6. Oddly the Arduino only reads odd channels:
1480, 0, ...
1
vote
2answers
846 views
Need help to set PWM frequency to 25kHz
I currently can set four pwm pins to around 31kHz with the following code:
void setup()
{
TCCR1B = TCCR1B & B11111000 | B00000001; // Set PWM frequency for D9 & D10 :
pinMode(...
0
votes
0answers
49 views
Multiple joystick axes without conflicting numbers
I am programming a system for a four motor control system for an underwater ROV. The four motors are in this configuration for horizontal movement:
/ \
\ /
The motor drivers we use control ...
0
votes
1answer
112 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
67 views
Help with modifying PWM code on DUE
I've found this really helpful, much faster PWM code online that works perfectly, but only for one output pin. I need 2 different duty cycles on 2 different pins, whether or not they are on the same ...
0
votes
1answer
44 views
How to detect the pulse width from microphone as Input?
I'm working on a project that detects the pulse width of an audio signal, which uses a microphone as an input. The user gives 2 different types of sounds one last less 0.3 seconds and other lasting ...
0
votes
2answers
114 views
how to implement PWM LED fading into a random case switch?
Ive recently bought my self a arduino Mega 2560 and managed to get a sort of RANDOM function to work with different cases which go of by the number selected.
My question is is there a way to also make ...
0
votes
0answers
38 views
Synchronize PWM edges
I am using the Teensy 3.2 and would like to create 2 Clock signals via PWM.
PWM 1: 4MHz
PWM 2: 1kHz
I have to use two different timers, but how can I synchronize both clocks, so that the rising ...
0
votes
4answers
76 views
Fan control circuit with Ardunio
I have a fan control circuit with Arduino(pwm). I did all things and it worked. My question is why we did not directly connect the fan to Arduino. Why should we have a driver circuit?
0
votes
1answer
40 views
Why can't the OCR1A register be set to 1 to get a 8MHz PWM?
The max PWM frequency that can be achieved with an Arduino is by using the PWM fast mode with the pre-scaler set at 1 and the TOP counter value at 3, getting 4MHz
f_OC = 16000000/(1(1 + 3)) = ...
0
votes
1answer
72 views
How do I lock a servo motor? [closed]
I am working on a robot which uses Ackermann's steering principle. Now the steering principal itself is in the development stage and the first prototype is pretty much good except for the fact that it ...
0
votes
1answer
72 views
Powering 3 servo motors and Arduino Uno with one 9 V battery
I wish to power an Arduino Uno board AND 3 servo motors using a single 9 V battery.
I have connected the positive terminal of the 9 V battery to the VIN pin. The negative terminal of the battery is ...
0
votes
1answer
69 views
Why is timer0 the fastest timer in the arduino?
In the documentation, it shows that the higher frequency that can be reached with an Arduino UNO for and 8bits PWM is using timer0 with the pre-scaler set at 1. That gives a Fs of 62500 Hz, but ...
0
votes
1answer
36 views
How to implement an alternating current using only two PWM pins on STM32 Nucleo L053R8?
I am an arduino rookie and definitely not an expert in electronics, even if I do know the physics that is behind it.
Before burning my object of experience, I prefer to ask my silly question to the ...
4
votes
1answer
68 views
How can I maintain PWM output while still performing other tasks?
I want to generate a PWM signal that I can turn on and off with a button press without using interrupts. Is there a way to keep the PWM output going while running other processes?
1
vote
1answer
69 views
reading pwm signal doesn't work correctly
my goal is to read a pwm signal from a rc receiver. For that i tried to use an arduino.
i ran this code on the arduino:
#define Pin 3
int pwm_value;
void setup() {
pinMode(Pin, INPUT);
Serial....
0
votes
0answers
60 views
Controlling brushless gimbal motor
I'm using a standard board for control this type of motor (SimpleBGC), this board uses an atmeg328p e some brushless drivers. I'm writing a simple code for turn left/right with some velocity, but i'm ...
2
votes
1answer
51 views
How can i set 4 Arduino Leonardo PWM-ports between 200Hz and 1kHz?
I've noticed that I can set D9, D10, and D11 to around the timer 1 can be set to ~244Hz, however i need 4 ports that are between 200-1000Hz but have been unable to figure out how to find the last one. ...
0
votes
2answers
143 views
PWM on non PWM pins
Why does this code not function in a similar way to the example fade sketch?
I have had to resort to using bit-banging as a way to implement PWM onto non PWM pins due to a lack of available free pins ...