Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
47 views

Using the Syren 10A Motor Driver with a RPI-zero to drive a Peltier

I'm kinda new on how to drive power consuming devices such a Peltier with a microcontroller and I would like to hear your opinion. So I have bought the following parts: A 2.8A Peltier and The Syren ...
1
vote
0answers
21 views

Trying to use pigpio wavechains to drive very specific acceleration and deceleration

I'm working on a kinetic sculpture that involves a large pendulum swinging perpetually left to right. I'm using a raspberry pi 3 B+ / arduino uno with a DM860AC to control a nema 34 stepper. I was ...
0
votes
1answer
44 views

How can I control a 12V solenoid door lock - Pi Zero

I have a solenoid door lock that requires 3 different voltages to operate - Unlocked Idle: Requires low voltage (6V) that'll hold the solenoid seated - Locked: No power (0V) - Unlock: 50-100ms ...
0
votes
1answer
47 views

LED pwm fading is flickering

This is how I'm fading some LEDs using a logarithmic function. But with that the LEDs are flickering somehow. I don't understand why... import time import math import RPi.GPIO as GPIO GPIO.setmode(...
0
votes
0answers
30 views

Advanced motion control on raspberry pi

I'm working on a reasonably advanced robot/machine where I'm needing to use an RPi for at least some of the control, because of the need to interface with our MSSQL server and other devices via TCP. ...
1
vote
1answer
31 views

Can I use PWM with hardware audio input?

I know that i cannot use pwm and audio output at the same time, can I use the audio input? I want to move some servos based on an audio trigger signal.
1
vote
1answer
74 views

Using hardware PWM and audio simultaneously

I am developing a project on a Raspberry Pi 3 B+. I am using the PWM0 channel to send a custom-made IR signal using PiGPIO waves. I gather it might then be possible to use PWM1 for mono audio; is that ...
0
votes
1answer
54 views

GPIO.Cleanup() starts motors again after script ends

I have written a script that controls a L298N motor controller, and I have one strange issue with it. When the script ends, one of the two motors do not stop, and instead go full speed in forward ...
0
votes
0answers
33 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
36 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
48 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
81 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 ...
0
votes
1answer
69 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
56 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
54 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 ...
0
votes
1answer
1k 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
291 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
217 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
101 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 ...
0
votes
2answers
131 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
201 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 &...
0
votes
1answer
537 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
573 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 ...
3
votes
2answers
707 views

How to generate accurate PWM signals for many servos

I've ran into a bit of an issue with the Raspberry Pi's ability to generate accurate PWM signals for servos. My problem with this is that the servos jitter because of this lack of accuracy. Is there ...
1
vote
0answers
121 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
97 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
170 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
506 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
1k 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, ...
2
votes
2answers
475 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
118 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
122 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
123 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
209 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
148 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
408 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 ...
1
vote
1answer
1k 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
207 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
100 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
1answer
729 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
0answers
97 views

Missing PWM Files For DIOZero

I'm running a Raspberry Pi Zero W with a fresh install of the latest Raspbian Jessie. I'm making a robot and I want to control its two DC Motors with PWM. I decided to use the DIOZero library, (...
1
vote
2answers
2k 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
522 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
122 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 ...
0
votes
0answers
197 views

Voltage amplifier module for Pi

Is there any voltage amplifier module designed specifically for Raspberry Pi ? I need to amplify output voltage from pi to range 0-5V ? I need to amplify RasPi voltage in range of 1–5v if duty cycle ...
0
votes
0answers
154 views

Pi PWM output amplification

What can be done to amplify PWM ouput of RasPi (0-3.3v) to voltage range of 0 - 5v ? Should op-amp be used for the same?
0
votes
0answers
185 views

300hz digital servo not working with Raspberry Pi

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
129 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
1answer
241 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
460 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 ...