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
1 answer
40 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 ...
  • 13
2 votes
0 answers
44 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 ...
  • 31
1 vote
1 answer
152 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 ...
1 vote
0 answers
30 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 ...
-2 votes
1 answer
45 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; ...
2 votes
1 answer
308 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 ...
  • 21
0 votes
0 answers
64 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 ...
1 vote
1 answer
535 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 [...
0 votes
0 answers
32 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) ...
0 votes
1 answer
122 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,...
  • 127
1 vote
1 answer
67 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 ...
0 votes
2 answers
86 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 ...
-1 votes
1 answer
218 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 ...
  • 1
0 votes
2 answers
45 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 ...
0 votes
1 answer
67 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 ...
-1 votes
1 answer
49 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 ...
  • 109
1 vote
3 answers
71 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 ...
  • 111
1 vote
1 answer
153 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 ...
  • 111
1 vote
1 answer
487 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. ...
0 votes
0 answers
221 views

Hardware PWM not working in Ubuntu 20.04

I'm running Ubuntu 20.04 on an RPI 3b. I need both Hardware PWM channels. I added the following line to /boot/config.txt and /boot/firmware/usercfg.txt: dtoverlay=pwm-2chan,pin=18,func=5,pin2=13,func2=...
  • 113
0 votes
1 answer
45 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 ...
  • 11
0 votes
1 answer
562 views

AttributeError: module 'RPi.GPIO' has no attribute 'ChangeDutyCycle'

Starting Day 2 troubleshooting this error. Code used to work on a previous rasp pi 4B but doesn't on a new one so I'm assuming I'm missing some breaking change. Problem: Using import RPi.GPIO as GPIO ...
  • 153
0 votes
1 answer
343 views

troubles with bcm2835 hardware PWM

I try to use hardware PWM on RPI 3b+ (Linux 11 bullseye) by using bcm2835.h (ver. 1.71) with small C code given below #include <bcm2835.h> #include <stdio.h> #include <stdlib.h> #...
0 votes
1 answer
286 views

ERROR: PWM Generation using pigpio C library

I am working on the RPI-CM4 board with raspbian buster OS. I am trying to generate the 38KHz PWM wave using pigpio the library. My code is as follows. #include <pigpio.h> #include <unistd.h&...
1 vote
1 answer
37 views

how to get more juice thru the Adafruit DC and Stepper Motor HAT?

We have a hat https://www.adafruit.com/product/4280 to turn i2c signals into pwm signals, into raw power for a DC motor. Let's start with this sample code: import time from adafruit_motorkit import ...
  • 308
1 vote
0 answers
42 views

Can i use a I2C PWM expander as a Digital output module?

i want to use a "IS31FL3731" I2C PWM expander to dim my LED Strip. This expander does have a lot of PWM outputs and i also need a lot of Digital outputs. So is it possible to use a few PWM ...
0 votes
2 answers
255 views

Keeping a Python script for PWM running and just changing duty cycle

I am currently trying to connect a laser to my 3D printer and give a TTL signal manipulated by an M106 command. The "official" way didn't work out for me so right now I am trying to control ...
1 vote
0 answers
120 views

Brushless Motor not spinning when controlling with PWM and ESC

I'm currently working on a drone which is controlled by a Raspberry Pi. I try to controll the motors by using PWM on the connected ESCs, which is described in many guides and forums. For that I use ...
1 vote
1 answer
343 views

How To make Raspberry Pi Hardware PWM off after startup

I am driving motor using ESC with Hardware PWM signal comes from Raspberry Pi ,I set the GPIO 19 (PIN 35) to be PWM1 , the problem is when the Raspberry Pi startup it gives output value to PWM1 (GPIO ...
  • 11
-1 votes
1 answer
266 views

How to set raspberry pi gpio to low at boot (PWM pins)

I have project that works with raspberry pi 3 which control a motor speed through PWM0 pin (GPIO 19), the problem is that raspberry pi give high state after startup , which cause the spinning of the ...
  • 11
1 vote
2 answers
997 views

Using GPIO PWM with sysfs

I'm able to write to GPIO pins with sysfs with the standard commands like echo "1" > /sys/class/gpio/gpio6/value, but that only turns the pin on or off. I tried echo "0.5" > /...
  • 121
3 votes
4 answers
1k views

Can unstable PWM timing be corrected?

I would like to set the motor speed of a RPLidar A3 which requires a 25 kHz PWM. So I played around with the following: from RPi import GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(12, GPIO.OUT) pwm = GPIO....
  • 219
0 votes
2 answers
232 views

38kHz, 50% duty cycle PWM output on GPIO

I'd like to generate 38kHz & 50% duty cycle PWM signals on multiple GPIO pins. Hence hardware PWM won't work for me. Does anyone have a chance to generate this signal by using python or node.js? ...
  • 113
-1 votes
1 answer
203 views

PWM input to raspberry pi 4B

I want to read PWM output signal which I got from a sensor. Is there any way to give PWM signals as input to Raspberry pi 4B?
1 vote
1 answer
27 views

PWM transducer won't update frequency

I'm creating a simple script that outputs a text input to morse with an LED and a transducer via the GPIO pins on a Raspberry Pi 4 Model B. I tried to add input functionality with buttons that can ...
1 vote
1 answer
1k views

What is a 'func' in PWM configuration?

To enable PWM on RPI, you need to modify /boot/config.txt. I found nice examples of what line I should add for various cases: https://github.com/dotnet/iot/blob/main/Documentation/raspi-pwm.md I do ...
  • 113
-1 votes
1 answer
149 views

How do I change the PWM GPIO port in the sine_wave_pwm sample application of pico-playground?

This is the sample code in question: https://github.com/raspberrypi/pico-playground/tree/master/audio/sine_wave I cannot see where it has set it's PWM output pin. Inside "..pico-extras\src\...
  • 119
0 votes
0 answers
83 views

RaspBerry Pi pwmchip0 doesn't always work

I'm in a project currently using the RPi's pwmchip0 to implement Hardware PWM. I added the dtoverlay = pwm-2chan in the cofig.txt. Now when I follow that explanation https://jumpnowtek.com/rpi/Using-...
1 vote
1 answer
241 views

Speed control for a generic 12v fan using Pi Zero

I am trying to speed control a generic 12V 2 pin computer case fan (80mm x 80mm x 15mm). I have purchased an Adafruit TB6612 1.2A DC/Stepper Motor Driver Breakout Board and a Raspberry Pi Zero W. I ...
1 vote
2 answers
203 views

Issue with DMA+PWM based signal generator

I want to generate some signal on GPIO pin on Raspberry PI Zero W using DMA control blocks and PWM to pace data. However I faced with some problems while trying to generate signal at ~10-50kHz. When I ...
0 votes
1 answer
117 views

GpioPinPwmOutput set pwm value with floating point

I have a raspberry pi 4 B and I want to control servo motor. I am using NetBeans IDE and Java programming language with pi4j library for raspberry. Also I have a servo motor that can rotate for 300 ...
1 vote
0 answers
111 views

How to set PWM frequency below 1Hz on RPi?

does anybody know how to generate a PWM with less than 1Hz of frequency on Raspberry Pi? I'd like to generate a PWM with 0.1Hz if possible. Thanks in advance!
2 votes
2 answers
517 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
1 answer
77 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
1 answer
466 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
1 answer
324 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 ...
  • 109
0 votes
0 answers
122 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 votes
1 answer
77 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 ...
1 vote
1 answer
129 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
  • 111
1 vote
0 answers
245 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 ...

1
2 3 4 5
7