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]

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.

1
vote
0answers
32 views

A PWM object already exists for this GPIO channel

I have a bit of a dilemma. I am currently using BCM GPIO 14, 15 and 18 to control an RGB status LED using PWM. I have configured my raspberry pi 3 to pull down pin 14 (red) on boot, to indicate the ...
1
vote
1answer
31 views

connect 4 measuring devices output to a raspberry and set a Pin high if value exceed a particular value

I have a special measuring system. Each measuring unit gives PWM output (total 4 outputs). Maximum frequency will be 10Khz (for each output). I wanna measure the frequency of each PWM evey second ...
-1
votes
1answer
33 views

Sg 5010 servo 360 degree modification not working [closed]

As per the video tutorials out there, I opened the motor, took out the potentiometer and measured its resistance at max. Its a b5k pot so it measured 5kohm I put 2.5k ohm from each pin (s and -) and ...
2
votes
1answer
61 views

pwmWrite() does not change dutycycle immediately

I'm using wiringPi for PWM on BCM18. I tried to use this to generate a STROBE-equivalent signal to turn ON the LED for the Camera Capture. My intention is to synchronize the LED-ON to shutter opening (...
0
votes
1answer
34 views

PWM with pigpio does not trigger alert function regularly

I combine C examples of pigpio for gpioSetAlertFunc and gpioWaveTxSend working with the same pin. My PWM has several pulses, so I expect alert function to print out a message for me several times. ...
0
votes
1answer
52 views

sudo with WS2812 and Raspberry Pi

I'm trying to use the Neopixel Adafruit library with the WS2812 strip. Everything works great however there is something that I have not been able to do. I'm working on a project that requires ...
0
votes
2answers
153 views

Turn a Raspberry Pi into a voltage tester

I would like to create a voltage tester like the one described in this video, using 555 ic, and then connect it to Raspberry Pi, in order to log the frequency a 220V waterpump is switched on. My ...
0
votes
1answer
45 views

Python RPIO.ChangeDutyCycle() Equivalent in WiringPi (C)

I'm currently developing an application with the WiringPi library. I have implemented a prototype in Python, and I'm currently trying to reproduce the same behaviour in C++. However, I ran into some ...
2
votes
1answer
59 views

Generating fast rise PWM signals using software GPIO

I want to use my Raspberry Pi 3 Model B (rev 1.2) as a source for fast rise PWM signal generation. The idea is to utilize RPi as part of a cheap TDR (time-domain reflectometry) setup. For anyone ...
0
votes
0answers
30 views

How to track steps of multiple stepper motors with different frequencies

I’m working on a small stepper motor driven vehicle powered by a Raspberry Pi 3B. For the motor control, I am using the hardPWM function of the pigpio library from Joan, which is working great. I can ...
1
vote
1answer
37 views

GPIO PWM reset to high

I'm using the pi 3a+ pwm to send sync informations to my music gear. When I stop the pwm, I don't use the pwm.stop(), but rather set the duty cycle to 0. This is because I run the pww from a different ...
0
votes
1answer
61 views

Triggering of MAPIR using PWM signal

I am currently trying to trigger a MAPIR Survey3 NDVI Camera with a PWM Signal. The camera is connected via this HDMI trigger cable. For the camera to trigger I need a 2 ms PWM signal. I have given ...
0
votes
0answers
30 views

Generating multiple square waves simultaneously

I'm trying to generate 2 simultaneous square waves (50% duty cycle PWM signals) to step two stepper motors (STEP signal to separate motor drivers) on the Raspberry Pi Zero W. I use GPIO12 and GPIO19, ...
1
vote
1answer
142 views

Calibrating ESC with PCA9685

I'm currently working on a RPi project to control an RC car via my phone, and I am having difficulty setting up my ESC. Based on research I have done online, I need to first calibrate the ESC by ...
0
votes
1answer
164 views

3 PWM pins for RGB LED

I got an RGB LED, one mass and one for blue, red, green. So I got a list there are only two PWM compatible pins listed. Pin 32(GPIO 12) and pin 33(GPIO 13). But for my RBG LED I need three pins with ...
0
votes
2answers
118 views

How to control speed of dc motor using servoblaster

Im using servoblaster in pcm mode and setting pulsewidth from code for turning my servos position to desired angle. But my question is, cant i use it for controlling the speed of dc motor. I read some ...
0
votes
1answer
23 views

RPIO setting: is DELAY_VIA_PCM a hardware PWM?

So I have a project that is going to use audio and need to do some PWM to control a motor. As I understand it (and I could be very wrong here), there are two chips a pi can use to produce PWM. In ...
0
votes
1answer
35 views

Provision Pwm out makes 3.5mm audio hang

Using pi4j and wiring pi configuring hardware pwm pins for driving servo motors. Also using freetts (speech to text) library for speech. My speaker is actually connected to amplifier to 3.5 mm jack (...
0
votes
1answer
145 views

PWM and Output Voltages at High[er] Frequencies

I am attempting to set an analog voltage control signal with a Rasberry Pi 3 B+. My Python 3 script uses RPi.GPIO to output PWM across a range of duty cycles to simulate analog output---without the ...
2
votes
0answers
50 views

Trying to use pigpio wavechains to drive very specific acceleration and deceleration

I'm working on a kinetic sculpture that involves a large pendulum swinging perpetually left to right. I'm using a raspberry pi 3 B+ / arduino uno with a DM860AC to control a nema 34 stepper. I was ...
0
votes
1answer
223 views

How can I control a 12V solenoid door lock - Pi Zero

I have a solenoid door lock that requires 3 different voltages to operate - Unlocked Idle: Requires low voltage (6V) that'll hold the solenoid seated - Locked: No power (0V) - Unlock: 50-100ms ...
0
votes
1answer
325 views

LED pwm fading is flickering

This is how I'm fading some LEDs using a logarithmic function. But with that the LEDs are flickering somehow. I don't understand why... import time import math import RPi.GPIO as GPIO GPIO.setmode(...
1
vote
1answer
78 views

Can I use PWM with hardware audio input?

I know that i cannot use pwm and audio output at the same time, can I use the audio input? I want to move some servos based on an audio trigger signal.
2
votes
1answer
293 views

Using hardware PWM and audio simultaneously

I am developing a project on a Raspberry Pi 3 B+. I am using the PWM0 channel to send a custom-made IR signal using PiGPIO waves. I gather it might then be possible to use PWM1 for mono audio; is that ...
0
votes
1answer
76 views

GPIO.Cleanup() starts motors again after script ends

I have written a script that controls a L298N motor controller, and I have one strange issue with it. When the script ends, one of the two motors do not stop, and instead go full speed in forward ...
0
votes
0answers
68 views

How to generate a hardware PWM wave for driving an LED through RPIO?

I've looked through the documentation of RPIO, and used GPIO18 to get my PWM up and running. This is my code: from RPIO import PWM servo = PWM.Servo() servo.set_servo(18, 4000) As explained in the ...
3
votes
1answer
61 views

pigpio pwm — gpio <pin_no> bad dutycycle (nnn)

I'm tinkering with the pigpio [C] PWM functions and get ``pio bad dutycycle (nnn)'' messages while cycling an LED with increasing/decreasing gpioPWM() values. As always, any help will be greatly ...
0
votes
3answers
66 views

Raspberry Pi Random Turns Off

So, I was doing a project with PWM (Pulse-width modulation) but something unsual happens, my raspberry pi turns off. I am using a RPi model 2B, and my circuit looks as follows simulate this circuit &...
1
vote
2answers
184 views

Testing my low frequency generator

I have my pi hooked up to a shaking device, and I'm looking to drive it at relatively low frequencies. My code looks like this: # Import the necessary header modules import RPi.GPIO as GPIO from time ...
0
votes
1answer
405 views

How to connect speakers onRaspberry Pi WH through PWM?

Let's say I am trying to embed a Pi WH in my motorcycle helmet. I need thin speakers just by the ear to hear sounds (so, I don't need them to be too loud). * by the way, piezo speakers won't do it ...
0
votes
1answer
116 views

Speeding up updating of GPIO pins

I have a program where each step, two GPIO pins have their duty cycle updated (I'm using pigpio). I'm running the program for millions of steps (think 50 to 100 million) and running the PWM outputs ...
1
vote
1answer
95 views

Trying to drive monitor backlight with gpio

Project: I am making a Pi powered photo frame with google photos integration. Object: I have added a pir sensor for auto screen off when no activity is detected and now i am looking to control ...
1
vote
1answer
2k views

RasPi3 and L298n PWM Speed Control

I have got all motors running correctly on the L298n. I want to set up speed control with them also. According to this tutorial, to do that I attach a PWM GPIO to the Ena on the L298n. They also are ...
0
votes
0answers
461 views

Controlling 30 LEDs with 2 PCA9685 boards - need to increase performance

I have a Raspberry Pi 3 and two Adafruit PCA9685 interfaces with which I am trying to control 30 white LEDs. Currently, I am using Python and Adafruit's module, this works fine, however, with the ...
1
vote
1answer
367 views

Python Chiptunes with PWM

I'm building a super barebones game console with a rasPi zero. I'm trying to get it to play some rudimentary music - I'd like to be able to write little tunes programatically (eventually have the ...
-1
votes
1answer
179 views

convert py file for RPIO to RPi.GPIO [closed]

According to Joan's instruction. First, git clone https://github.com/metachris/RPIO.git cd RPIO sudo python setup.py install sudo python3 setup.py install and sudo python3 jjy.py I made a jjy ...
0
votes
2answers
192 views

Send PWM signal from Raspberry Pi 3 BEFORE boot

I am using my raspberry pi 3 to run some services. When someone powers on the Raspberry I want to use RGB LEDs to indicate the status instead of using a LCD screen to output messages. The LEDs I plan ...
0
votes
1answer
345 views

SG90 servo is vibrating and heating when I try to control it using Raspberry pi 3

I brought a new SG90 servo and I tried to control it using my Raspberry Pi's pin 17 writing the following code on the terminal's python >>>import RPi.GPIO as GPIO >>>import time &...
0
votes
1answer
918 views

Hardware PWM for Python 3.5 or higher?

I am developing a camera tracker to follow objects identified via OpenCV in a dedicated environment on mt Pi3. Currently the two SG90 servos are controlled by software PWM using RPi.GPIO - but the ...
0
votes
1answer
883 views

Best settings to drive a DC 24V motor with PWM [closed]

I'm driving a 24V motor like this using this motor driver connected to a RPi B+. I'm controlling it with Python and PWM with the following snippet: import RPi.GPIO as GPIO from time import sleep ...
3
votes
2answers
2k views

How to generate accurate PWM signals for many servos

I've ran into a bit of an issue with the Raspberry Pi's ability to generate accurate PWM signals for servos. My problem with this is that the servos jitter because of this lack of accuracy. Is there ...
2
votes
0answers
175 views

Using Hardware pwm as event timer?

in modern PC based Linux Machines it is possible to use hpet and realtime processes to get a reasonable good realtime performance (+-10us response time) While Raspberry Pi Hardware does not have a ...
2
votes
2answers
129 views

L293D to send data to a NeoPixel LED strip?

Does a L293D return the same signal on the output as it gets on the input? Or does it change a pwm signal to a rather constant voltage?
2
votes
0answers
257 views

Multiple servo motors with serial commands

I am trying to control multiple servo motors with a Raspberry Pi. I am using a USB to TTL cable for this. I am currently sending following serial commands for the movement. --> gpio -g mode 18 pwm --...
1
vote
2answers
754 views

Android Things: Any way to PWM on GPIO 20?

I'm playing with a motor board, a PWR.A52.A, that is mapping the ENA and ENB of its L298P to the BCM13 and BCM20. The problem is that Android Things is mapping the PWM to BCM13 and BCM18. I don't ...
1
vote
0answers
3k views

PWM with wiringPi library and C in order to blink an LED at a given frequency

I am working with the wiringPi library with C on a Raspberry Pi 3 Model B and attempting to understand and develop a model so that I can predict the blinking behavior of an LED connected to GPIO #18, ...
2
votes
3answers
851 views

Motor running slow using PWM

I'm new to PWM. This is my motor and controller. When I have the jumper in (ENA pins: I assume this gives the PWM pin the full 5V, as that is what the controller board runs on). My 6V 47 RPM motor ...
0
votes
1answer
153 views

Trouble using Pi's GPIO pin PWM to control ESC powered by separate battery

Can I use my Raspberry Pi to provide the PWM controlling my ESC, but have the ESC powered by a separate battery? The ESC I'm using is "A1S 3A Blheli 1S Super Mini Brushless ESC". It's awesome. And it ...
0
votes
1answer
186 views

“NameError: name 'L_R' is not defined” using GPIO.PWM inside a Class

I'm trying to create a class to define various led status using 3 leds. For some status only I need to use GPIO.output method, but in other cases I want to use GPIO.PWM method to create a blink effect ...
0
votes
1answer
178 views

How to use the DMA-DREQ/PANIC threshold of the hardware-PWM

I'm using the hardware PWM that is described on page 138 of the BCM2835-ARM-Peripherals document. The description of the DMAC-register (page 145) indicates that one can set the FIFO-threshold at ...