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
0answers
96 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
112 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
218 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
420 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 ...
1
vote
1answer
2k 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
456 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
206 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
3k 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
686 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 ...
1
vote
1answer
886 views

Python Chiptunes with PWM

I'm building a super barebones game console with a rasPi zero. I'm trying to get it to play some rudimentary music - I'd like to be able to write little tunes programatically (eventually have the ...
-1
votes
1answer
354 views

convert py file for RPIO to RPi.GPIO [closed]

According to Joan's instruction. First, git clone https://github.com/metachris/RPIO.git cd RPIO sudo python setup.py install sudo python3 setup.py install and sudo python3 jjy.py I made a jjy ...
1
vote
2answers
332 views

Send PWM signal from Raspberry Pi 3 BEFORE boot

I am using my raspberry pi 3 to run some services. When someone powers on the Raspberry I want to use RGB LEDs to indicate the status instead of using a LCD screen to output messages. The LEDs I plan ...
0
votes
1answer
623 views

SG90 servo is vibrating and heating when I try to control it using Raspberry pi 3

I brought a new SG90 servo and I tried to control it using my Raspberry Pi's pin 17 writing the following code on the terminal's python >>>import RPi.GPIO as GPIO >>>import time &...
-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
1answer
1k views

Best settings to drive a DC 24V motor with PWM [closed]

I'm driving a 24V motor like this using this motor driver connected to a RPi B+. I'm controlling it with Python and PWM with the following snippet: import RPi.GPIO as GPIO from time import sleep ...
2
votes
0answers
274 views

Using Hardware pwm as event timer?

in modern PC based Linux Machines it is possible to use hpet and realtime processes to get a reasonable good realtime performance (+-10us response time) While Raspberry Pi Hardware does not have a ...
2
votes
2answers
193 views

L293D to send data to a NeoPixel LED strip?

Does a L293D return the same signal on the output as it gets on the input? Or does it change a pwm signal to a rather constant voltage?
2
votes
0answers
345 views

Multiple servo motors with serial commands

I am trying to control multiple servo motors with a Raspberry Pi. I am using a USB to TTL cable for this. I am currently sending following serial commands for the movement. --> gpio -g mode 18 pwm --...
1
vote
2answers
1k views

Android Things: Any way to PWM on GPIO 20?

I'm playing with a motor board, a PWR.A52.A, that is mapping the ENA and ENB of its L298P to the BCM13 and BCM20. The problem is that Android Things is mapping the PWM to BCM13 and BCM18. I don't ...
1
vote
0answers
6k views

PWM with wiringPi library and C in order to blink an LED at a given frequency

I am working with the wiringPi library with C on a Raspberry Pi 3 Model B and attempting to understand and develop a model so that I can predict the blinking behavior of an LED connected to GPIO #18, ...
3
votes
3answers
2k views

Motor running slow using PWM

I'm new to PWM. This is my motor and controller. When I have the jumper in (ENA pins: I assume this gives the PWM pin the full 5V, as that is what the controller board runs on). My 6V 47 RPM motor ...
0
votes
1answer
216 views

Trouble using Pi's GPIO pin PWM to control ESC powered by separate battery

Can I use my Raspberry Pi to provide the PWM controlling my ESC, but have the ESC powered by a separate battery? The ESC I'm using is "A1S 3A Blheli 1S Super Mini Brushless ESC". It's awesome. And it ...
0
votes
1answer
481 views

“NameError: name 'L_R' is not defined” using GPIO.PWM inside a Class

I'm trying to create a class to define various led status using 3 leds. For some status only I need to use GPIO.output method, but in other cases I want to use GPIO.PWM method to create a blink effect ...
0
votes
1answer
333 views

How to use the DMA-DREQ/PANIC threshold of the hardware-PWM

I'm using the hardware PWM that is described on page 138 of the BCM2835-ARM-Peripherals document. The description of the DMAC-register (page 145) indicates that one can set the FIFO-threshold at ...
1
vote
0answers
313 views

Segmentation fault using PWM with RPi.GPIO?

I have some simple code that plays tones on a piezo buzzer. I thought it would make sense to use the PWM support in RPi.GPIO rather than rolling my own; my resulting code looks like this: def ...
0
votes
2answers
336 views

How would I control multiple solenoid locks?

I would like to control 16 separate solenoid locks using PWM (It is not imperative that the lock is 12V, it could be 6V for example). The PWM source is this 16-channel servo driver from Adafuit. Is ...
1
vote
1answer
965 views

Gpio PWM make interference with Audio jack output

I've connect a servo motor to raspberry. I have too an speaker connect via audio jack 3.5 mm. When I use gpio pwm it produces interference with speaker and it begins to make annoying noise. When I ...
3
votes
1answer
3k views

My servo jitters sometimes

I'm trying to build a toy model of self-driving car for my FYP. I have a RPi3 B+ Model with a custom 3D printed chassis which uses a futaba s3003 servo for steering front wheels. Servo is currently ...
1
vote
2answers
342 views

Updating to Raspbian 9 leading to errors using PWM (wiringPi)

A few days ago I updated my Raspberry Pi (Rev. 3) to the new Raspbian 9 (based on Debian "Stretch"). Everything went fine but when I tested some of my own tools I recognized a strange behaviour ...
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://...
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
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/...
1
vote
2answers
1k views

cannot control pwm through c program by wiringpi

I am trying to control frequency and duty cycle through c-program based on wiringPi library. Here is the code: #include <wiringPi.h> #include <stdio.h> #include <stdlib.h> #include ...
0
votes
1answer
256 views

Error: GPIO #num# is not enabled for pi-blaster

I currently have a project where I need to be able to use 12 GPIOs to control lights. I'm using pi-blaster for my PWM needs, and it works great where it works, but some GPIOs it throws no error when ...
1
vote
0answers
320 views

Rpi python GPIO PWM Controlling Digital Servo JX 5521MG Problem

I ordered a digital servo JX 5521MG to use with my Pi but when I use the code below the servo does not move but there is a slight tick or twitch inside. gpio pwm-ms gpio pwmc 192 gpio pwmr 2000 ...
0
votes
0answers
329 views

ESC PWM Duty Cycle between 20 - 70

I've wired my ESC and my Motor and I'm able to spin it at different speeds, but it only works between 20 - 70 DutyCycle. How can I make it start spinning at 1 and max throttle at 100? I'm using ...
0
votes
2answers
512 views

PWM via GPIO to trigger a MAPIR Camera

I am currently trying to trigger a MAPIR NDVI Camera with a PWM Signal. The camera is connected via this HDMI trigger cable. The white wire is connected to GPIO PIN 17, the black wire is connected to ...
0
votes
1answer
923 views

Increase Pi 3 PWM resolution for more accurate ESC control

Currently I am building a tricopter which runs on nodejs and uses pi-blaster(https://github.com/sarfata/pi-blaster) I've got everything working nicely except my custom PID can't stop small ...
3
votes
1answer
2k views

PWM stop respond after hundreds of start/stop

The code is simple, just randomly start/stop a PWM in an infinite loop: #!/usr/bin/python import RPi.GPIO as gpio import time import random gpio.setmode(gpio.BCM) gpio.setup(21, gpio.OUT) pwm = ...
5
votes
4answers
9k views

Android Things: How many PWM pins on Pi 3 Model B?

I'm interested in using the Android Things on the Pi 3 Model B, but I need to access a minimum of 4 pins and use them for PWM control. On the pin-out diagram on Google's Android Things site, there ...
1
vote
1answer
371 views

use pwm to control contrast on CHAR LCD

In the following code I am trying to use pwm to control contrast of a Character LCD. I have been reading this page. http://raspi.tv/2013/how-to-use-soft-pwm-in-rpi-gpio-pt-2-led-dimming-and-motor-...
0
votes
1answer
824 views

pigpio ESC (Electronic speed control) problem

I'm trying to control a BLHeli ESC (link) controlling a Gemfan motor (Gemfan RT-2205 2300KV - 3-4S - 425W - 1160g) with a Raspberry Pi 3B with a python program which I've written two days ago: from ...
2
votes
1answer
1k views

Accessing pwm module without root permissions

I am trying to use the hardware PWM module on my pi 3 by writing to the /sys/class/pwm/pwmchip0 directory (which I think is just a symbolic link to sys/devices/platform/soc/3f20c000.pwm/pwm/pwmchip0). ...
0
votes
0answers
159 views

Quadcopter beginner using pigpio

I'm trying to build quadcopter using my raspberry pi. I have a few questions I would like to get some answers.. When I connect my ESC to the battery is starts beeping with 1-2 seconds spaces and ...
0
votes
1answer
138 views

IR Remote - Working with RPi2, not with Pi Zero Wireless

I have a frustrating problem here. Wondering if anyone has any thoughts on what the issue might be. I'm building an IR remote with RPis. I built the first one with RPi2 and got it to work with no ...
1
vote
2answers
4k views

How to create multiple GPIO pwm waveforms that are in sync using pigpio for trapezoidal motor control?

Explanation I am using a Rpi 2 model B, and PIGPIO to generate PWMs. Goal is to run a three phase permanent magnet synchronous motor using the Rpi 2 with IRAMS10UP60A. Need 6 repeatable waveforms to ...
1
vote
1answer
3k views

What is the pin number for PWM outputs on RPI3 model B?

What is the pin number for PWM on RPI 3 model B? On the RPI2 i used to 18 pin, I used to set it up like "gpio -g mode 18 pwm" However, is it same on the RPI 3? Where can I found the doc, ...
0
votes
1answer
2k views

Pigpio With Pi 3 Controlling Two Servos

I am brand new to using the GPIO pins on the Raspberry PI and I'm having a lot of trouble trying to control two continuous rotation servos using pigpio with python and a keyboard. Servos here: https:...
1
vote
2answers
2k views

Raspberry pi PWM stability

Is it possible to control 3 servos with a raspberry pi without hardware for it? My firsts tests showed me it was possible, but sadly just ssh connecting to the raspberry pi makes the servo move ...
0
votes
0answers
323 views

pwm input to rpi from LIDAR sensor

I want to use pwm signal as input which is the output of LIDAR sensor that i want to interface with R-Pi. So please help me I am new to Rpi and pwm as input. How can i read the pwm signal in Rpi ....