I am trying to use a WS2812E LED-Strip with the raspberry pi.
I am using the HW131 Power Supply and a RaspberryPI 3B+. The LED strips GND is connected to both the HW131 and the RaspberryPI GND. The Strips +5V is connected only to the HW131, and the Data line is connected to the RaspberryPi at GPIO18. Although i have also tried GPIO12 and GPIO 10, which i have found in different tutorials.
Using a Multimeter i have checked that the Strip actually receives 5V. And using a logic analyser I can see the PWM Signal (however I do not know whether those are correct).
I have both tried this code (with basically all interfaces on but audio off)
import RPi.GPIO as GPIO
import time
Pin configuration
PWM_PIN = 18 # GPIO pin connected to your PWM device
GPIO setup
GPIO.setmode(GPIO.BCM) # Use BCM numbering
GPIO.setup(PWM_PIN, GPIO.OUT)
Set up PWM on the pin with a frequency of 100 Hz
pwm = GPIO.PWM(PWM_PIN, 100) # 100 Hz frequency
pwm.start(0) # Start with 0% duty cycle (off)
try:
while True:
# Gradually increase the duty cycle from 0% to 100%
for duty_cycle in range(0, 101, 5):
pwm.ChangeDutyCycle(duty_cycle)
print(f"Duty Cycle: {duty_cycle}%")
time.sleep(0.1)
# Gradually decrease the duty cycle from 100% to 0%
for duty_cycle in range(100, -1, -5):
pwm.ChangeDutyCycle(duty_cycle)
print(f"Duty Cycle: {duty_cycle}%")
time.sleep(0.1)
except KeyboardInterrupt:
print("Exiting...")
finally:
pwm.stop() # Stop PWM
GPIO.cleanup() # Clean up GPIO settings
And this code:
import time
import board
import neopixel
pixels = neopixel.NeoPixel(pin=board.D10, n=1, bpp=3, brightness=1.0, auto_writ>
Cycle through colors
while True:
pixels.fill((255, 0, 0)) # Red
pixels.show()
time.sleep(1)
pixels.fill((255, 255, 0)) # Green
time.sleep(1)
pixels.fill((255, 255, 255)) # Blue
time.sleep(1)
(Pins are just set to where i tried last but i checked each time that its the actual pins)
There is nothing happening for the one LED of the strip i connected.
As i am a beginner with all of this I have no idea what else could be wrong or what I could check to find the problem. Any advice would be greatly apprechiated
Os versions:
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"