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

raspberry pi fan don't start to spin without hand help!

Raspberry Pi has recently added fan control feature in its raspi-config tool. This made me curious to add a fan to my RPI 4. I did it recently with a 680-ohm resistor, 2N2222 transistor, 1N4007 diode, ...
0
votes
1answer
29 views

Best GPIO API for high data rates and frequencies?

Using RPI3B+. I need to have 2 pins (a clock and data) to write data to shift registers on frequencies of 1,76 MHz or rate of 1,76 Mbps, and 1 pin(connected to GPIO 18) on 20 kHz. Tested RPi.GPIO.PWM ...
0
votes
1answer
21 views

Do GPIO 12 and GPIO 18 share the same frequency since they are the same channel?

Using RPI3B+. I already use GPIO 12 (the other PWM channel 0 pin) for a ledstrip. [Question: Can I use GPIO 18 on a different frequency, or do GPIO 12 and GPIO 18 share the same frequency when used as ...
0
votes
0answers
13 views

Noise on interrupt pins while using Hardware PWM

i have been using the RPI4 to control 2 brushless motors with encoders, using 2 PWM signals to the motor driver, and reading both 3.3 V encoders(2 channel resolvers each) using interrupts. If i move ...
2
votes
1answer
408 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
137 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. ...
-1
votes
1answer
133 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 ...
0
votes
1answer
19 views

What is the relationship between angles and pulse length of servo motor?

I've been working on a project where I've to drive the servo motors. I am using Raspberry Pi 3B+ model and Adafruit PCA9685 to drive the servos. For that I need to find which angle is at what pulse ...
0
votes
1answer
61 views

Controlling LED using PWM

When I run this code I’m expecting to get a led that brightens but I get a led that dims. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) dc=0 LED=GPIO.PWM(11,...
1
vote
1answer
446 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'...
0
votes
0answers
22 views

Hardware Timed Servo PWM

I am working on a some time-critical system that will run image processing and controlling 4 SG90 servo motors. In short, I will do visual-servoing. In this topic, joan pointed out some library, ...
0
votes
1answer
26 views

Controlling 4 servo motors through hardware PWM

I am working on a some time-critical system that will run image processing and controlling 4 SG90 servo motors. In short, I will do visual-servoing. Since I will do visual servoing, I don't want to ...
0
votes
1answer
253 views

Using pigpios waves and audio output

I am using a Raspberry Pi 3 B+. I want to play audio through the 3.5mm jack and use PWM at the same time or successively to simulate a IR-Remote. I know that you can't use the hardware PWM while ...
0
votes
0answers
27 views

LED strip works through Arduino PWM, but not Raspberry Pi PWM

I've been stuck on this for a while. I'm following a simple tutorial for RPi-controlled LEDs. From this, my LEDs do random stuff and don't light up correctly. I've been trying strandtest from this ...
1
vote
1answer
23 views

Controlling WS2812 with a non-PWM pin

I was looking for a way to control WS2812 led without PWM pin (specifically I would use pin 4 (1-WIRE pin) to control WS2812). Is it possible? Thanks
0
votes
2answers
888 views

How to use Rpi python to read/write/convert, to/from Arduino PPM and PWM servo control signals?

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 ...
0
votes
0answers
21 views

Beginner question: Bad results with WS2812B and strandtest.py

I have a setup for testing my WS2812B led strip with the raspberry pi. I am following the AdaFruit best practice guide Including using the recommended level shifter after the pwm pin. I've included ...
1
vote
3answers
145 views

How to use Rpi python GPIO pins in PWM output mode to create PWM signals?

I was trying to understand PWM when I ran across this example: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setup(12, GPIO.OUT) p = GPIO.PWM(12, 0.5) p.start(1) input('Press return to stop:')...
3
votes
1answer
260 views

How to use Rpi GPIO to PWM adjust IR LEDs brightness?

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
2answers
42 views

pigpio scrambles hardware PWM signal

I'm using a dedicated library to run a ws2812 led strip. As far as I understand, this library sends a signal using the hardware PWM, via GPIO pin 18. This works fine and the led strip shows the colors ...
1
vote
0answers
47 views

How to make/get a proportional flow control valve [closed]

I want to use hydraulic flow to proportionally vary the resistance of a rpi controlled exercise machine. The victim would rotate a positive displacement pump where the inlet and outlet ports are ...
0
votes
1answer
227 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
2answers
3k 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
3answers
1k 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
votes
3answers
889 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 ...
0
votes
2answers
239 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 ...
2
votes
1answer
607 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
99 views

Raspberry Pi Software Driven servo control with PWM using C and Wiring Pi LIbrary

I'm trying to get my raspi zero to move an SG90 PWM driven servo. I have achieved this with python already using the gpiozero library, so I know my hardware works but I am trying to do it with C using ...
0
votes
1answer
26 views

Sending Square Waves to more than one gpio pin with pgpio

I've been searching around for a few days and couldn't find a solution to this problem. I'm using the pgpio library that is native to the RPi4 and been looking all over their website: http://abyz.me....
0
votes
1answer
270 views

Using pwm to send packets

does anyone one know if it's possible to use the Raspberry pi to send packets via pwm? I want to interface the raspberry pi with some escs(electric speed controllers). These escs use Dshot (https://...
1
vote
3answers
418 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....
3
votes
2answers
314 views

PWM frequency/profile for “official” pi fan?

I have a pi4 with the "official" fan case and I would like to write my own fan control code. I have looked online for a datasheet for the fan but haven't found it yet. I see on the case fan ...
0
votes
1answer
55 views

RPi PWM issues - (re)start results in oscillating pin

I'm building a sauna controlling mechanism, controlled by the Pi, using PWM and solid-state relays. Works fine, but after a while, the PWM breaks down. At this moment, when I run the program and the ...
0
votes
1answer
66 views

Turn on an LED with dimming and stay on

I want to start the LED gradually with dimming by using PWM. And then once at a ChangeDutyCycle(100) I want it to remain on GPIO.output(led, GPIO.HIGH). import RPi.GPIO as GPIO import time led = 17 ...
0
votes
2answers
49 views

How to create unfazed pwm signals?

I have two pins with the same frequency (10Hz) and same duty cycle (50%) assigned to two different leds. How can I make the two leds blink alternatively? How can I put a delay of 50% in one of the ...
0
votes
2answers
1k views

Controlling DC motor with PWM in Processing

I'm trying to control DC motors with L298N motor driver. I'm using Raspberry Pi 3B and java GUI called Processing. I can't find PWM libraries for software control or use hardware PWM because I need ...
0
votes
1answer
139 views

How to control a Servo via libgpiod on a raspberry PI

I am trying to control a Servo in c ++ using the libgpiod library. My problem is in defining the 50Hz pwm pulse on the pin that the servo is connected to. The servo signal cable is connected to pin 33 ...
-1
votes
1answer
780 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
1answer
59 views

Reading current PWM output configuration

I use gpio #32 (wPi #26) as PWM output to control the speed of a fan based on temperature. The job starts at system startup with a dedicated account. I would like to display the current value that is ...
0
votes
3answers
4k views

Raspberry pi Software Driven PWM using C++

I am using software driven PWM which is capable of outputting a PWM signal on any GPIO pins. Following Gordon's page. I am trying to run 2 DC motors I am using GPIO pin 18 also knowing that it is ...
0
votes
1answer
80 views

Set different frequencies for the two hardware PWMchannels on PI 4B

I'd like to generate two PWM signals with SAME duty cycle (50%) but DIFFERENT frequencies on raspberry pi 4B. The difference between the frequencies is within +/-80%. The two GPIOs I'll use are GPIO ...
1
vote
2answers
920 views

Control a 12V dc fan via PWM and a level shifter

I wish to control a 4 pin 12V dc pc fan (https://www.arctic.ac/en/F9-PWM/AFACO-090P2-GBA01) with my raspberry pie. After reading several threads I came up with the following: First problem is that the ...
0
votes
0answers
39 views

Redirect Rpi Audio/Mic to Sim module

Raspberry Model: Zero W. External Modules: SIM800L Image Adafruit I2S MEMS Microphone Breakout Small Audio Speaker I'm aiming to make phone calls with the sim800L and 'bind' them with the RPI and I'...
0
votes
3answers
11k views

How do I do a basic MOSFET switch with Pi?

I have my GPIOs doing PWM with pi-blaster. Now I just need to figure out the wiring. I checked over electrical engineering, and found this question: https://electronics.stackexchange.com/questions/...
0
votes
1answer
68 views

Sending a NEC like signal via a GPIO

I'm trying to control an existing LED strip controller with a Raspberry Pi. The controller has an IR receiver to receive commands. I removed the IR receiver of the controller and added a connection to ...
2
votes
1answer
161 views

Trouble getting sg-90 servo to work with R-PI 4

I have read several answers and approaches to controlling an SG-90 servo with a raspberry pi and I have tried the following approaches, with varying but never satisfactory results. Wiring Setup: ...
3
votes
1answer
2k 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
votes
1answer
2k 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
2answers
704 views

PWM issues with pigpio and RPi.GPIO

I am using Pi Zero W with latest Raspberry Pi OS. I have a backlight of an LCD that I am trying to control via PWM. If I use RPi.GPIO I get flicker at anything other that 100% (or 0%) duty cycle. As ...
0
votes
1answer
166 views

What values for PWM to set intensity from 0 to 255?

I am using hw-479 that looks like the picture below. I cannot find much of information for it but the Alibaba page says The RGB LED module is made of a plug-in full-color LED. The PWM voltage input ...

1
2 3 4 5 6