Skip to main content

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
1 answer
39 views

How can I safely connect a 12V PWM fan with external power to a Raspberry Pi for PWM control?

I'm working on a project where I want to control a 12V PWM fan with a 4-pin header using a Raspberry Pi. I am aware that a Raspberry Pi does not require a fan in day to day use cases but the reasoning ...
Abhinav Dhiman's user avatar
0 votes
1 answer
61 views

Only 1 PWM pin working when controlling via sysfs

I’m using sysfs to control my rpi5’s pwm andI’m having an issue where only one of my pwm pins is outputting a value (The pin that is working is gpio 18/physical pin 12/pwm2). In the pinout.xyz page, ...
Matthew Moller's user avatar
0 votes
1 answer
57 views

How to turn off the display from the Raspberry Pi OS

I searched the web on information about turning off the display and controlling its brightness from within the raspberry pi OS, what I gathered is that it works on some displays and not in others. I'm ...
Movianlost's user avatar
1 vote
1 answer
99 views

Troubleshooting PWM via sysfs

Recently, I've discovered that I can use the sysfs to control the pwm of my raspberry pi 5. (I don't know about any libraries that are supported buy the pi-5 and can control pwm hardware.) Upon trying ...
Matthew Moller's user avatar
1 vote
0 answers
89 views

Rpi-5 Pulse width modulation

I am a beginner learning how to operate the gpio of a Raspberry Pi 5. I’ve heard that the gpiod nor many other Pi-5 compatible libraries do not support pwm. This leaves me with not many options but to ...
Matthew Moller's user avatar
0 votes
1 answer
45 views

What is the role of the components in this AC coupling circuit?

I'd like to learn more about the RP2040 PWM Audio AC coupling circuit found in figure 22 in this document & shown below. Even though I understand the general purpose of AC coupling, can someone ...
Erik's user avatar
  • 101
0 votes
0 answers
49 views

How to control PWM device (more specifically a servo) without using any external modules (preferably with sysfs)

I’m writing a GPIO Python module from scratch. I’ve managed to write code to (in theory, I haven’t tested it on my Pi yet) turn pins on and off, and to read from pins, but for my project (and probably ...
Giwby Albatross's user avatar
0 votes
0 answers
28 views

PWM nozzle with Adafruit TIme of FLight Sensor - Nozzle turns fully on after a while

I'm relatively new to this so apologies in advance. I have a raspberry pi4 with a Bete Ehpi pulse width modulatin nozzle and a Adafruit-Vl53l4cd time of flight sensor. Code below is set to control the ...
Burcin Nalinci's user avatar
0 votes
2 answers
122 views

How to Control Multiple WS2812B LED Strips Using Software PWM

I have built an electronic scoreboard consisting of 15 digits, each comprising of 7 segments of WS2812B LED strips. With a Raspberry Pi 4B and the rpi_ws281x library I can use up to 3 GPIO pins with ...
Colin Winton's user avatar
0 votes
0 answers
23 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
-1 votes
1 answer
45 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
37 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
-1 votes
2 answers
613 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
220 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
288 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
512 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
85 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
98 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
825 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
82 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
22 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
5 votes
2 answers
7k 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
  • 227
0 votes
0 answers
238 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
1k 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,380
0 votes
1 answer
223 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
2k 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
122 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
138 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
159 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
31 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
2 answers
2k 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
  • 61k
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
3 answers
328 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
40 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
885 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
80 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
330 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
490 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
95 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
  • 21
1 vote
1 answer
1k 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
34 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
127 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
2k 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
104 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
4k 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
570 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 votes
2 answers
189 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

1
2 3 4 5
8