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.

learn more… | top users | synonyms

0
votes
0answers
14 views

can't set GPIO.output in a method with a GPIO.setmode in contractor

I have connected 4 DC motors (each two with L298 H-Bridge IC), the code has been built using a Python script running on Raspberry Pi B+. RuntimeError: The GPIO channel has not been set up as an ...
1
vote
0answers
15 views

Optimizing the code that controls 4-DC Motors using Python Dictionary Comprehension

I have connected 4 DC motors (each two with L298 H-Bridge IC), now it's time to get them worked using a Python script running on Raspberry Pi B+. I'll include my code, and I'm totally new that means ...
0
votes
0answers
23 views

Automaticly startup BASH script stop with work after 20min

I made Bash script what running fan for cooling. PIN20 is PWM out and this script work perfect. I run this script over therminal arroun 15 hours. Afer all tests i register script for autoload after ...
0
votes
1answer
23 views

Fan speed control using PWM inside BASH script

Is there a way to run some kind of PWM for fan speed control inside bash script? Here is my current script #!/bin/bash ### BEGIN INIT INFO # Provides: rpipwm # Required-Start: $local_fs ...
1
vote
0answers
23 views

Combination of ServoBlaster and wiringPi won't work

I would like to control a servo and a dc motor. I want to control the dc motor's speed by using pwm with a frequency >= 1000 Hz. The servo on the other hand expects a pwm frequency of only 50 Hz. So ...
0
votes
2answers
43 views

Is there a limited number calling the PWM function from RPi.GPIO and does it interfere with video recording?

I am using a Raspberry Pi 3 to control a servo motor (via PWM with RPi.GPIO) and a Pi Camera. What I want to do is, I want to move the servo motor several hundred times to a specific position. In ...
3
votes
1answer
63 views

PWM Servo - Check availability

I'm writing a program which requires Servo's basic movement. Here's the code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) pwm = GPIO.PWM(18, 100) pwm.start(5) ...
4
votes
0answers
159 views

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

How to turn off / let float a servo attached to GPIO

I'm driving servos attached to GPIO, powered from external PSU and using PIGPIO Library through node.js - everything works just fine but I don't know how to completely "shut down" the servos - once ...
1
vote
0answers
45 views

Controlling a Motor with a Raspberry and a Joystick

I'm realizing a little embedded system with a Raspberry Pi 2 for controlling a dc motor using an analog joystick. In particular i'm using a PCF8591 as adc to read the joystick and a L298N to drive ...
1
vote
1answer
45 views

Pi4J ESC brushless motor is not running stable

I would like to control a brushless motor with a Java program running on a Raspberry Pi model b+. This is the code that I am using: package de.ye.boat_eng; import com.pi4j.wiringpi.Gpio; import com....
0
votes
1answer
35 views

Answers to PWM and ESC

i connected my Rasp. to an ESC. I want to control it with this code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(37, GPIO.OUT) servo = GPIO.PWM(37,60) servo.start(10) ...
1
vote
1answer
31 views

Using hardware PWM and audio at the same time

While using PWM0 and PWM1, sound (buzz) is played through the audiojack. Is it possible to route audio not through PWM so it could be used at the same time as PWM?
0
votes
1answer
33 views

How can I set 100 kHz on Raspberry 2 SCLK pin?

I need to interface with a micro SD card in SPI mode, and the datasheet says that the serial clock speed should be between 100 and 400 kHz. So I connected it to the 23rd pin but I can not find any ...
0
votes
0answers
48 views

RPIO.PWM causes I2C to stop working [solved]

EDIT: Problem solved. I had configured the PPM output to GPIO 3, which is also the I2C clock line. Yyeah… :) My sincere apologies. I'll be sure to check the pin reference first in the future. I'm ...
0
votes
1answer
64 views

pigpio: PWM range for quadcopter ESC(electronic speed controller) command

Good day, I am currently working on a quadcopter project and am currently using the pigpio library for the PWM used to command the ESC's of the quadcopter motors. Will increasing the range of the ...
1
vote
1answer
134 views

PWM - What does pwmSetClock() and pwmSetRange() mean?

I have looked at the WiringPi site and have found: pwmSetRange (unsigned int range) ; This sets the range register in the PWM generator. The default is 1024. pwmSetClock (int divisor) ; This sets ...
0
votes
1answer
80 views

HC-SR04 ultrasonic sensor reading becomes highly unusable when PWM is active

Good day I am trying to sample distance using a sonar/ultrasonic sensor for altitude measurement. When the PWM is not active, the sensor gives accurate measurements in centimeters, however with the ...
0
votes
0answers
52 views

How do I control the PWM output at GPIO 18 using the wiringPi library?

I want to control an actuator that is connected to the PWM output of the Raspberry Pi. The actuator has to be controlled at a frequency of 1000000 Hz (1 MHz). Is this possible with the Raspberry Pi ...
0
votes
0answers
14 views

Motor not moving as input given by PI [duplicate]

I have connected motor to RasPi on Pin0(Actual PIN 11) to control motor as command given to motor using Raspi using WiringPi but when I give input from 0 to 5 it doesnr move BUT When I give input 5 it ...
1
vote
1answer
95 views

Servo motor using wiring Pi problems

I am looking for solution for something wrong happen in my programme i have configuration for control RC motor over RasPi using Wiring Pi here is code #include<stdio.h> #include<netinet/in.h&...
0
votes
1answer
80 views

Controlling multiple Digital LED light strip through Servo hat/driver

After gathering some requirements in my project, I thought that it should be possible for us to control multiple LED Light strip through a servo hat (Considering that we are able to provide enough ...
0
votes
3answers
31 views

Difference between Servo hat and driver?

I am very new to Raspberry pi, especially electrical components. And when I am working with hooking up a digital LED light strips, I am planning to plug it into a 16 channel PWM/Servo hat. But I ...
1
vote
0answers
40 views

Synchronize two PWM signals on two Raspberry PI

I wanted to know if it's possible to synchronize two PWM signals on two different Raspberry Pi? If yes, what's the suitable module (Bluetooth, WIFI,...) the two Raspberries will be in 10m maximum ...
1
vote
1answer
142 views

Can I use a GpioPin as a PWM pin safely on my Raspberry Pi 2?

Windows 10 IoT doesn't support use of the PWM functionality of Raspberry Pi 2. So, as a workaround, I'm planning on using a GPIO pin and just toggling it from High to Low REALLY FAST to achieve the ...
3
votes
3answers
89 views

What components are required for connecting servo motor to PI?

I'm planning to integrate a servo motor with a raspberry PI to press a switch button and found this post very helpful : PWM Control on Raspberry PI I'm considering this motor VicTsing Mini SG90 9g ...
0
votes
2answers
133 views

Two servos connected causes shaking

I have two servos which I want to control from my RPi. My problem is that the servos start shaking if I use them both. Both servos are connected to the +5V pin and to the ground of the Pi. So I have ...
0
votes
1answer
41 views

Why a resistance between signal and GPIO - External power source

I'm trying to power my servo from an external power source and control it with my Pi and I've found following circuit: http://razzpisampler.oreilly.com/images/rpck_1001.png Why is there a resistance ...
3
votes
2answers
76 views

Project needs multiple PWM

I'm working on a project that needs three (or more) PWM pins to work. But unlike Arduino, the Raspberry PI B+ has just one PWM pin. I've searched for solutions and I found that I can use the WiringPi ...
1
vote
0answers
142 views

Can't open pwm pin

I know there are many questions about using pwm pins in RPi, but nothing helpfull for me. Here is my code with described error: #include "pch.h" #include "MainPage.xaml.h" using namespace ...
1
vote
1answer
306 views

Raspberry Pi 2 B GPIO pwm and interrupt pins

Good day! I would like to use pwm and interrupt on raspberry GPIO pins but i don't know which GPIO pins are actually dedicated for pwm output and which is for hardware interrupts, is there a way for ...
4
votes
1answer
478 views

PWM control of motors with PHP front end

I have a dual H bridge connected to my Pi for controlling 2 brushed DC motors with. I intend to have a web interface to control the speed of the motors. I'm thinking of a HTML page submitting AJAX ...
1
vote
1answer
104 views

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

Low-level PWM driver that works with the Raspberry Pi 2

Is there any low-level hardware PWM driver (such as RPIO.PWM or ServoBlaster) that is written in Python or C++ or Java (Python or Java preferred) and is compatible with the Raspberry Pi 2 model B?
3
votes
1answer
90 views

Output Accurate, Detailed PWM signal

I'm building a quadcopter using the RPI 2 Model B. I'm currently using the Pi4J library (Java library that wraps the WiringPi library) for my project. All is going well except my ESC (Electronic Speed ...
1
vote
1answer
78 views

pigpio PWM and ALSA

My Qt ( C++ ) application successfully dims the screen using the pigpio library on my Raspberry Pi compute module. It works great and is very stable using the code below. The problem, is that my ...
1
vote
2answers
305 views

ALSA - piezo buzzer directly on PWM pin?

Pre-empting the fact that the Raspberry Pi Zero has no analogue headphone jack - has anybody managed to setup the audio such that a Piezo Speaker directly attached to a GPIO PWM pin would make a sound?...
1
vote
2answers
381 views

Dimmer - How synchronize PWM with 230V power supply?

I need your's help with dimmer which is controlled by Raspberry PWM. My problem is lack of synchronization PWM with power supply. Unfortunately , I don't have oscilloscope waveforms to show my problem,...
0
votes
1answer
75 views

WiringPi - GPIO Output Vs PWM

So in the GPIO utility from WiringPi there is a command to change the mode of the GPIO pins. There is input mode, output mode and PWM mode. What is the difference between output mode and PWM mode? Is ...
0
votes
1answer
101 views

How can I send the same PWM output to multiple connections?

For a update to a small robot I am doing, I am controlling a robot using the Pi. This works very well but I would like to add more precise control, using PWM on the H bridge that controls the motors, ...
5
votes
3answers
2k views

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

Counting Pulse Length Using PiGPIO

Background I am trying to get a particle sensor to work with the Raspberry Pi (model B+). I am using the Shinyei PPD42N6 (datasheet here). The sensor outputs a digital signal with pulses ranging ...
1
vote
1answer
245 views

Count Pulses Width on RPi-GPIO

I have a Coin Acceptor, that sends a 30ms pulse when the coin was dropped. So I tried to use many codes, but I search in the net and I think the way is use PWM to read the pulse. But this doesnt work: ...
1
vote
3answers
218 views

PWM Fan causes clicking sound

I am using PWM to control the speed of the fan on my RPi 2. The problem is, when I am PWMing it, a clicking sound can be heard from the fan. I am using a 6v power supply for a 5v fan to compensate ...
1
vote
0answers
103 views

Run brushless motor with esc

I have looked all over the internet on how to run a brushless motor with an esc through RPi.GPIO and have no results. I have tried simply wiring the esc as it is supposed to be and programming it ...
2
votes
0answers
88 views

Controlling LED results in flicking

Using the amazing Pi-Blaster daemon I managed to control a connected RGB strip (to be exact: this particular one http://www.ledstripkoning.nl/led-strips-rgb/losse-ledstrips-rgb/5-meter-150-leds-rgb-...
0
votes
3answers
142 views

pwm fan on pin 18 help!

Can someone help me? I'm trying to control a fan using PWM and I cannot work out how to do it. This worked for a short amount of time and then stopped working. According to the docs, GPIO pin 18 ...
1
vote
2answers
322 views

Python - GPIO PWM control backlight LCD display

I want to manage an LCD HD44780 display connected trought my Raspberry Pi B+. The backlight pin (on Hd44780 display) need a resistor and I have 2 different display version, so the resistor value are ...
0
votes
0answers
40 views

how many external expander chips can the 5v output of the raspberry pi power?

I'm currently using PCA9685 gpio PWM and DO chip expander which can be powered by 5V . I'm currently powering it by using the 5V output on the raspberry pi . I would like to know how many of these ...
4
votes
3answers
2k views

PWM on Raspberry Pi 2 and Windows 10 Core IoT RTM

Now that windows 10 Core IoT - final RTM version is available. Are there any ways to program a Windows Universal App to use PWM hardware connected to the GPIO? I need this for controlling the color ...