The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 views

Connecting infrared LED circuit to raspberry pi GPIO pin

I'm using this circuit for my project, which I referred from https://www.sparkfun.com/news/1396. I don't really understand how current works in GPIO pins, so the question is: instead of connecting ...
0
votes
1answer
25 views

How can I power a IR LED ring using GPIO port?

Okay so, I'm currently working on a final year project about vein visualization with Raspberry Pi 3 Model B+ and a NoIR camera V2. An infrared light source is required to capture clear vein image. I'...
2
votes
2answers
83 views

AC mains dimmer dimming 7W LED lamp problem (RpiZero + MPDM V4.1)

I'm trying to dim a 7W LED with a Raspberry Pi Zero for home automation. However it doesn't work as expected. I followed this tutorial : https://www.youtube.com/watch?v=wqY4-gHqvZI . I have the exact ...
1
vote
1answer
12 views

I2S 3W Class D Amplifier and 2.2“ SPI-Display (ILI9341) - GPIO 18 Problem

I want to connect the Adafruit I2S 3W Class D Amplifier Breakout Board and an 2.2" TFT Display (ILI9341) to a Raspberry Pi Zero. However, it seems that by default both components use the GPIO 18 (the ...
0
votes
0answers
35 views

Setting up the second PWM channel from kernel module not working on RPI 3 model B+

I'm trying to set up both PWM channels (PMW0 and PMW1) on my Raspberry Pi 3 Model B+ from my kernel module. I've successfully set up channel 0 with the desired frequency and variable duty cycle and I'...
1
vote
1answer
13 views

What is the frequency and cycle length of the pigpio library?

I've got a raspi 3b with an esc and a brushless motor attached. I can run the motor using pigpio the following commands: # First start the pigpio daemon sudo pigpiod # calibrate the esc pigs s 12 ...
0
votes
2answers
58 views

Using a raspberry pi to control a model of the USS Nimitz, and possibly using an arduino to read PWM for the pi

I want to create a python equivalent of the RCPulseIn library for arduino that does all the same functions of the library. I have written up a code that has lots of errors, but has sort of a framework ...
1
vote
1answer
29 views

PIGPIO problem with delay on scripts

I am trying to run an old Raspberry Pi 2011.12 as a server to control a RGB LED strip. To this I am using PIGPIO since this is the best solution (RPi.GPIO is software based, which creates flickering). ...
3
votes
1answer
154 views

PWM on 5V GPIO pin

I have a 12V Noctua industrial fan (it's for a project, the amount of airflow is needed). The fan doesn't turn on by itself (with only 12V and GND connected), but it does turn on when I connect GPIO ...
1
vote
1answer
63 views

GPIO PWM. ESCs still run different after calibration

I’m putting a quadcopter together. I’m using a python script to calibrate the ESCs... they beep like a blinking led when I give them power. Then I run the calibrate script and they give me the proper ...
1
vote
0answers
42 views

Adafruit ServoHat importing PWM object

I am following the Adafruit page regarding the ServoHat for the Raspberry Pi. I am unclear what module to import to get the PWM class. This is the page about using the PWM class: https://learn....
1
vote
1answer
129 views

No module named 'adafruit_circuitpython_servokit' [closed]

I have a Adafruit PWM hat and I am trying to run play around with some servos. However, when I run this line: from adafruit_servokit import ServoKit It returns: No module named '...
0
votes
1answer
43 views

How to use at the same time 2 hardware pwm in wiringpi

I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing ...
1
vote
1answer
33 views

Piscope resolution

I generate a carrier frequency at 38KHz and I see the output LIVE in the piscope, but the "pulse widths" are not perfect ... the pulses are more or less wide when they must all have the same width. It ...
0
votes
1answer
30 views

PWM in raspberry with L293D

maybe this ask is repeated but i need solve this special situation, i have an arm robot with 3 Freedon deegre, i want to control position of each motor with a raspberry pi 2 and L293D like a motor ...
2
votes
0answers
39 views

Waveform not cancelling out hardware PWM

I've run into problems using pigpio's wave generator in combination with hardware PWM. Currently I'm working on a motion control with acceleration/sustain/deceleration phases. The phases are saved ...
1
vote
0answers
95 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
42 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
76 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
128 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
50 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
180 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
194 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
86 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
104 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
46 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
86 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
90 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
39 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, ...
2
votes
1answer
288 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
213 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
177 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
34 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
40 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
294 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
66 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
337 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
506 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
104 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
419 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
93 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
88 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
71 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
95 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
243 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
826 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
187 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
130 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
528 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 ...