Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
0 answers
17 views

Pi4J support of 16 channel PWM / Servo Hat

I have a Raspberry Pi 4 and am programming it with the brilliant Pi4J library To implement my table tennis robot project I need: 3 brushless dc motoros for the ball firing motors. 2 servos for up / ...
Simon B's user avatar
  • 101
0 votes
1 answer
26 views

ESC, BLDC control with pigpio: set_PWM_dutycycle or set_servo_pulsewidth, and other ESC questions

I am new to Raspberry Pis. I am using a Raspberry Pi 4. I am trying to control a BLDC motor from the BLHeli_32 ESC, using PWM signals output from GPIO pin 18. For this project, I need the motor to go ...
Tsz Kit Koon's user avatar
0 votes
0 answers
28 views

How to find IRQ numbers on Pi5?

I want to write a custom PWM kernel module, I want to write a handler which is called when the PWM interrupt is triggered. What IRQ number do I use when attaching the handler?
FourierFlux's user avatar
0 votes
2 answers
214 views

Raspberry Pi 5 Servo Jitter

I’m trying to control 2 MG996R servos with my Pi 5. I’m using gpiozero and python. I’m using GPIO12 and GPIO13. I have a separate 5v power supply to power the servos. The servos both move but jitter ...
Bri's user avatar
  • 1
0 votes
1 answer
86 views

Raspberry Pi pwm fan control

I have a PWM fan connected to pin 18 What is the simplest way to make the fan turn on at 50 degrees and turn off when the temperature drops to 35 degrees.
JBC's user avatar
  • 1
0 votes
2 answers
152 views

Can’t control servo with Raspberry Pi 5

I’ve just recently bought my first Raspberry Pi and opted for a Pi 5 as it was the latest. I’ve had no luck getting gpiozero or gpiod working with Python and my MG996R servos yet. I don’t mind if it’s ...
Bri's user avatar
  • 1
1 vote
1 answer
210 views

Is it possible to have 4 hardware PWMs on RPi 5?

Some internet resources mentioned that RP1 chip on RPi 5 has 4-channel PWM output. For example, this one. I was able to make 2 outputs working by adding dtoverlay=pwm-2chan to /boot/firmware/config....
Andrey's user avatar
  • 11
0 votes
0 answers
53 views

Accurate PWM pulse length with PIGPIO

EDIT: Added details/clarity I’m using the PIGPIO library on an RPi4, using the monitor_pwm/read_pwm example to get the time signal from the WWVB AM radio broadcast. (http://abyz.me.uk/rpi/pigpio/code/...
Arlo's user avatar
  • 21
0 votes
2 answers
76 views

Multiple (ramped) square waves, independently controlled (multi stepper motor control)

TLDR; how to smoothly run two or more independent stepper-motors from a raspberry? I have been reading, testing, monitoring and finally now asking to figure this out. I am attempting to control two ...
anrola's user avatar
  • 1
0 votes
2 answers
414 views

RPi 5 PWM precise frequency output

On RPi5, it seems we have to use gpiozero. In gpiozero, pwm output is available for various devices within a range 0 to 1. I want to use a piezo transducer with musical frequencies from say c = 130....
Trober's user avatar
  • 1
0 votes
1 answer
44 views

sysfs pwm: corresponding pins and LED driving

Using a Raspberry Pi 3B+ with Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux I would like to drive an LED with pwm. There are two couples of GPIO pins which ...
BowPark's user avatar
  • 101
0 votes
0 answers
16 views

Will a L298N Control a Maxxair RV Fan with a Raspberry Pi?

MaxxAir RV Exhaust fans are 12v DC motors with a 5 amp max draw. People have replaced the boards with these: https://www.amazon.com/gp/product/B08JG3CD8F/ref=ewc_pr_img_2?smid=A2RFU0Q5Y99ZUG&psc=1 ...
Matt Ralston's user avatar
3 votes
2 answers
4k views

Disable automatic fan speed control of the Raspberry Pi 5 to control it manually

I have a Raspberry Pi 5 with the official cooler/fan. The firmware enables it from 50°C and up in different steps. I'd like to control it manually, which is possible by writing the steps to /sys/class/...
Lion's user avatar
  • 207
0 votes
0 answers
152 views

Control multiple addressable RGB LED Strips (ws2812) with Raspberry PI

I'm building a project where I would like to control multiple addressable RGB LED strips with Raspberry Pi Zero. Initially I've done everything using PWM0 (pins 12, 18) and PWM1 (13, 19), however now ...
Victor Buldakov's user avatar
0 votes
1 answer
638 views

What kind of JST connectors are needed for the Raspberry Pi 5?

All of the documentation I can find for the new JST headers on the Raspberry Pi 5 fails to mention which series of JST connectors it uses. If I want to make up my own 4-pin PWM fan, 3-pin UART or 2-...
Mark Booth's user avatar
  • 4,370
0 votes
1 answer
72 views

It is safe to connect the PWM pin of a 4-wire FAN directly to the Raspi PWM output?

I have a 4-wire PWM FAN. The PWM pin it seems to be pulled-up to 12V with a 47k ohm resistor. Now, with this pin floating, it has almost 12V on it. And this pin must be connected to the Raspi PWM ...
Marus Gradinaru's user avatar
0 votes
1 answer
1k views

How can I generate a hardware PWM on Raspberry Pi 4 using Python?

I need a PWM signal of 25KHz and duty cicle 0-100%. It must be "hardware" becase I don't want to bother the CPU with that. The ony way I found to do that in Python is by using ppigpio ...
Marus Gradinaru's user avatar
0 votes
0 answers
85 views

RPi Zero as 4-pin-fan-controller: Faulty RPM readings on open collector with gpiozero

Introduction and Goal Disclaimer: I do not have profound but basic knowledge in electronics and hardware and my python is a bit rusty. For tl;dr, jump to the problem section below. Hello, I'm trying ...
ArmoredGoat's user avatar
0 votes
1 answer
118 views

PWM output frequency incorrect

I am trying to create an accurate PWM output using a raspberry pi, model 4b, and hope you can help. At this stage I am wanting to; change the Duty cycle and frequency, run the code, and see these ...
Ben's user avatar
  • 11
-1 votes
1 answer
148 views

Connecting a wire to GPIO 18 (PWM) changes the state of GPIO 23

I have a circuit with a Schmitt trigger connected to GPIO 23 (on a Raspberry Pi Zero W). It should give a high (3.3V) signal when there is an AC current on the other side of the circuit. If there is ...
tolazytosignup's user avatar
0 votes
0 answers
28 views

PWM frequency completely off

Don't know anymore what todo, it seems like my hardware PWM frequency is off completely, I have set it to 10Hz (tried different values) and measure with the oscilloscope a frequency of about 5us, the ...
Lukas K's user avatar
1 vote
1 answer
41 views

Using init.d to Start Script Driving Hardware PWM

I'm using init.d to start a Python script on boot. The script employs hardware PWM. When I run the Python manually as the pi user, it works fine. When I start the script manually, calling the daemon ...
KDM's user avatar
  • 718
1 vote
2 answers
1k views

How to set Hardware PWM Pins

I need a fairly deterministic PWM duty cycle. I don't believe it's rocket science to use hardware PWM. Numerous sources tell us that we can modify /boot/config.txt by adding dtoverlay=pwm-2chan which ...
KDM's user avatar
  • 718
0 votes
1 answer
2k views

How can I use dtoverlay=pwm

I have tried the dtoverlay=pwm but couldn't seem to get PWM working. It puts the pin/s in PWM mode and creates /sys/class/pwm/pwmchip0 but no signal. The dtoverlay description states 4) Currently the ...
Milliways's user avatar
  • 60.3k
1 vote
0 answers
32 views

Problem controlling 3 servos of different types [closed]

I had a remote developer do code for 3 servos to control a mechanism. He made sure to aquire similar hardware. Rpi4 and 16channel pwm driver. He used 3 sg90 servos. I have 1 sg90 and 2 smaller servos....
Bob's user avatar
  • 11
-1 votes
2 answers
160 views

Translate GPIO pwm commands to linux sysfs interface

I am trying to translate some raspberry pi gpio pwm commands to use the linux sysfs interface to control the pins instead in order to get the same pwm output. The goal of this is to provide pwm output ...
turtlemcnuggets's user avatar
0 votes
0 answers
38 views

Unable To Make MicroServo99 SG90 spin with raspberry pi

I am having an issue with my raspberry pi and making it spin a motor with python. I am currently using a battery connected to a PCA9685 16-Channel 12-bit PWM driver which connects my motor on channel ...
TheCrazyCreeper's user avatar
0 votes
1 answer
732 views

How do I connect a 4th analog input to a Raspberry Pi Pico?

I have to connect 4 different analog inputs to the raspberry pi pico. However there are only 3 pins available for usage. Is it possible to use the PWM pins for additional analog inputs? or should i ...
Anamika's user avatar
0 votes
1 answer
72 views

How to PID Control a 47 Ohms, 8W resistor with a Raspberry Pi and Python?

I got a Raspberry Pi 4B, a 12V power supply, a 12V air pump controlled by a MOSFET, a ds18b20 for feedback and a 47 Ohms, 8W resistor that we should somehow heat. Everything up to actually heating the ...
Mito's user avatar
  • 129
-1 votes
1 answer
283 views

How to run a bidirectional ESC with pigpio library

I'm using a Raspberry Pi 4. I have managed to run a unidirectional ESC using the following code: import time import pigpio ESC=13 pi = pigpio.pi() if not pi.connected: exit() # step 1 to arm ...
Arif's user avatar
  • 11
1 vote
1 answer
428 views

How to run Brushless Motor with raspberry pi 4

I'm using raspberry pi 4 with the pigpio library. I can get the motor to turn on by entering the following commands into the terminal but how do I run the motor with python in visual studio code lets ...
Arif's user avatar
  • 11
2 votes
0 answers
93 views

How do I turn an brushless dc motor 1 cycle per second using pigpio and c++

I am using an esc and a bldc and im trying to slowly spin my bldc I can get my motor to spin with gpioServo() but when I use gpioPWM() It just continues to beep when i use gpioServo() it spins way ...
thomedy's user avatar
  • 29
1 vote
1 answer
989 views

Audio via PWM pins?

Okay, kinda a noob here. I've been looking around, trying to find an answer to playing audio via the PWM pins. I tried rerouting the audio to no avail. I've tried making a script that uses PWM to play ...
Foxy6670's user avatar
1 vote
0 answers
33 views

I2C 1 light at a time`

i am currently using the NCP5623 (I2C LED Driver) to light up my 5V 1A (as written on the box) RGB LED strip. i followed the sample connection as shown on the datasheet of the NCP5623 and when i ran ...
seonghwife's user avatar
-2 votes
1 answer
113 views

Hardware PWM 0 oscillating before application runs

I would like to use Hardware PWM0 on a Raspberry Pi 3B. There i enable it in "/boot/config.txt" with dtoverlay=pwm,pin=18,func=2 In software I use the following code using System.Device.Pwm; ...
Koenieboy's user avatar
2 votes
1 answer
1k views

Creating a servo PWM signal for BLDC ESC Controller using PICO

I am trying to use my RPi PICO to control a BLDC ESC. Using a servo tester it works perfectly, but I want to be able to use this with my PICO and with a trigger/spring potentiometer. Basically it will ...
vm1988's user avatar
  • 21
0 votes
0 answers
95 views

Continuous servo takes time to stop?

I am using a Raspberry Pi 3 to control a modified TowerPro SG90 servo, where I have removed the potentiometer to make a continuous rotation servo. Using the code below, the motor starts exactly when I ...
thecompassguy's user avatar
2 votes
1 answer
3k views

Using Hardware PWM in Raspberry Pi 4

I was working on a project where I needed 4 different hardware PWM signals to control actuators using PWM drivers. I know that Raspberry pi has four PWM pins but the BCM2711 datasheet shows each pair [...
gaurang navelkar's user avatar
0 votes
0 answers
34 views

How to Properly Stop Electronic Speed Controller

I have a brushless electronic speed controller connected to my RaspberryPi. I have tuned it to 700 - 2000. It runs correctly, but whenever I set the speed to 700, it stops (this is supposed to happen) ...
Brendan R.'s user avatar
0 votes
1 answer
502 views

How to connect four analog microphones to Raspberry Pi GPIO?

I have four microphones that has pins: VCC, GND and Analog Data. I need to connect it to Raspberry Pi (I need it for detection direction to source of sound). As I know, GPIO doesn't have analog inputs,...
Robotex's user avatar
  • 135
1 vote
1 answer
104 views

ServoMotor I2C module

I want to control a ServoMotor with THIS module: I asked a question before in THIS topic. And as you can see in the topic, they guided me perfectly. And they said I should use THIS code. But I have a ...
Reza Gholipour's user avatar
-1 votes
2 answers
156 views

How to set PWM to actual 0

I am controlling a stepper motor using PWM on a RPi 4 and python. The motor has a controller/driver (BLDC-8015A) that accepts 0-3.3V to set the rotational speed. According to the documentation, this ...
user7408924's user avatar
-1 votes
2 answers
1k views

How to control (angle specific) a continous 360degree servo?

I want to control a "Servo motor analoog Micro Servo 9g SG90 360°/continous rotation" with a python script. I do understand the control of a 180° servo but somehow the 360° is not reacting ...
Mart's user avatar
  • 1
0 votes
2 answers
156 views

How to create a data signal using pwm from a gpio output?

I'm a new member of the raspberry pi community and I have problems with starting my first project. I want to be able to create a data signal using pulse width modulation with the gpio headers. The ...
muuuc123's user avatar
0 votes
1 answer
171 views

Heatbed module control with Raspberry Pi 3+

I want to control a nichrome wire with the PWM signal from a Raspberry Pi. The MOSFET modules that can be found on the net for the combination with a Raspberry became much too hot. So I decided to try ...
Jan Schmidt's user avatar
-1 votes
1 answer
127 views

Triggering MAPIR camera with PWM via GPIO on RPi

I have similar setup as this post: PWM via GPIO to trigger a MAPIR Camera but a different camera: https://www.mapir.camera/collections/survey3/products/survey3w-camera-red-green-nir-rgn-ndvi. I am ...
Sulphur's user avatar
  • 109
1 vote
3 answers
474 views

What options exist to manipulate voltage using a Raspberry Pi, above 5v?

I have a model train set which runs on 0-12v based on the position of a rotary encoder. I would like to have somewhat granular, digital control over the voltage on the track. So far, I'd implemented ...
XtrmJosh's user avatar
  • 111
1 vote
1 answer
266 views

GPCLK vs PWM using micropython with Pico

I have a DC motor I can spin via ESC connected with a Raspberry Pi 4, but I want to use a Raspberry Pi Pico instead. Using GPIO4, that has the clock, I have this code that works for spinning the motor ...
zapshe's user avatar
  • 111
1 vote
1 answer
916 views

Can't generate PWM output on RP2040 other than square waves

I was playing with PWM on the RP2040. I can do square waves, but pretty much everything else does not work. I have recorded the PWM output with a sound card at 44100 Hz in order to verify it visually. ...
Evgeniy Berezovsky's user avatar
0 votes
1 answer
97 views

Pigpio Hardware PWM_unable to write frequency above 5Khz

I have been using the pigpio library as a modified spi interface to send and receive serial data. I use Chip Select, Clock, and Data Lines but i am using "bit-banging" for the timing between ...
Cody's user avatar
  • 11

1
2 3 4 5
7