Questions tagged [pwm]

Pulse-Width Modulation (PWM) is a technique used for controlling the power given to electrical devices. The average power supplied is controlled by rapidly turning the supply on and off. Questions here concern driving PWM outputs from the Raspberry Pi.

331 questions
110
votes
5 answers

Can I use the GPIO for pulse width modulation (PWM)?

Can I use the GPIO as a pulse-width modulation output? If so, how would I go about doing it and how many concurrent, distinct PWM outputs can I have?
berry120
  • 10,886
  • 10
  • 51
  • 62
29
votes
9 answers

How can I control an RC servo?

I'd like to control a small RC servo (5 V, 500 mA) from the GPIO pins via Python. Hardware What are the required electrical connections? Can I connect multiple servos to the Raspberry Pi? Are there any current limitations? Do I need to buffer the…
Alex L
  • 7,585
  • 12
  • 42
  • 53
25
votes
3 answers

Control Hardware PWM frequency

I'm using the hardware PWM output with wiringpi. It provides the function pwmSetClock that should make it possible to change the frequency. (https://projects.drogon.net/raspberry-pi/wiringpi/functions/). I believe since the default is 200 Mhz…
user1217949
  • 747
  • 1
  • 7
  • 14
10
votes
9 answers

PWM input in Raspberry Pi

Is there a way to read a PWM signal from the pins on Raspberry Pi? I tried googling it, but I only found PWM output, and not input.
Caio Keto
  • 355
  • 1
  • 4
  • 10
10
votes
5 answers

3.5 mm jack starts to "hiss" after sound is played

I'm having the following issues with my amp on the Raspberry Pi 2, Model B. Boot up the Pi, everything sounds great. Play a sound byte through the Pi (using ALSA) Speakers hiss regardless of PCM being "muted" (using alsamixesr) or having a any kind…
Mikey A. Leonetti
  • 291
  • 1
  • 3
  • 11
8
votes
2 answers

Driving PWM output frequency

After many hours of fruitless searching and reading, I still didn't have a complete understanding of how and why to output specific frequencies from the hardware PWM pin on the RPi without using someone else's 'blackbox'. There seems to be quite a…
Neil
  • 361
  • 1
  • 2
  • 5
7
votes
1 answer

pigpio - set_PWM_dutycycle vs hardware_PWM

What is the difference between the set_PWM_dutycycle function and the hardware_PWM function in the pigpio python library when assuming the same frequency is set for both the functions. Will I get a more stable output from one versus the other? I'm…
Peter Zhu
  • 278
  • 3
  • 12
7
votes
1 answer

Raspberry Python Libraries

I am currently working with a Raspberry Pi (Model B+) and have some experience with Arduino (and it's derivates). Now, there are three Libs for GPIO access with Python for the Pi: WiringPi (WiringPi2) RPi.GPIO RPIO What are the…
RichyGuitar
  • 179
  • 3
6
votes
4 answers

Android Things: How many PWM pins on Pi 3 Model B?

I'm interested in using the Android Things on the Pi 3 Model B, but I need to access a minimum of 4 pins and use them for PWM control. On the pin-out diagram on Google's Android Things site, there are only two pins labeled PWM 0 (BCM 18) and PWM 1…
artus9033
  • 175
  • 1
  • 8
6
votes
1 answer

RPIO does not work on Python 3, only in Python 2.7

I've installed RPIO library to my RPI following these instructions: $ sudo apt-get install python-setuptools $ sudo easy_install -U RPIO I'm trying to run this code (test.py): from RPIO import PWM servo =…
Alex
  • 95
  • 2
  • 10
6
votes
5 answers

Interfacing with an RC receiver using PWM on the GPIOs

I've been struggling for a few days and haven't managed to turn up a lot on the internet. I'm looking to READ from the PWM output of an RC receiver through one of the GPIO's on the RPi. I've read other questions where it's not suitable for…
Wyatt
  • 83
  • 1
  • 5
5
votes
2 answers

Powering 2 servos with 5v output of L298N dual motor driver

I am using L298n Dual Motor Controller to control two dc motors for my robot. But I want it to power the servos too. I have created this circuit design. can I power the SG90 Servo with L298n? Is there any fault in the circuit? Any Other suggestion…
Anshul Bansal
  • 79
  • 1
  • 6
5
votes
2 answers

Using PWM on raspberry pi 3 vs pi 2 with bcm2835 library

In one application we are using the raspberry p to control motor speed via PWM. We were able to get a valid working code on the raspberry pi 2, but when we transferred this code and drivers over to the pi 3 the code simply does not work. Is there…
Sean
  • 51
  • 1
  • 2
5
votes
1 answer

PWM Control on Raspberry PI

Alright so I understand this question is fairly saturated, but my use in pwm is for two differing pieces of hardware. (Sourced from: https://www.modmypi.com/blog/raspberry-pi-gpio-en-franais) From what i understand i have two available ports that…
Pariah
  • 372
  • 1
  • 4
  • 14
5
votes
2 answers

Can I control this ESC/Brushless Motor with a Raspberry Pi and/or Arduino

My friend and I have been reading up on articles talking about controlling ESC/Brushless Motors from a Arduino or Raspberry Pi. Articles i've read give caution on the idea that controlling such systems depends on the specifications of the ESC. For…
Shane C. Yost
  • 95
  • 1
  • 2
  • 4
1
2 3
22 23