Use the following diagram to connect an LED to your Raspberry Pi and adjust its brightness using PWM.
A couple of notes before you get started:
To add a Luminosity actuator you will need a PWM controller. For this example we will use a PCA9685 PWM I/O Controller. This tutorial assumes you already have the PCA9685 connected. Refer to the PCA9685 Tutorial if you need help with that part.
Make sure Raspberry Pi is powered off when connecting wires.
When using a GPIO ribbon cable, make sure the power wire (it’s a different color than the others) is connected to the corner of your Raspberry Pi and the top of your Pi cobbler.
The provided diagram is just an example of how to connect the sensor. There are many ways to connect sensors and extensions, so try what works best for you!
Some full-size breadboards (used in diagrams below) have a powerline that is separated in the middle. If this is the case, be sure your sensors are connected on the same half of the breadboard as your Pi Cobbler.
Step 1
Connect one of the PWM pins from the PCA9685 to the LED, through a resistor attached to the longer (positive) lead. In this case, we’ll be using Channel 0 on the PCA9685.
Step 2
Connect ground from Channel 0 of the PCA9685 to the LEDs shorter (negative) lead.
Step 3
You’re done! You can now add the Luminosity actuator to your dashboard, using Channel 0 on the PCA9685 to adjust the LEDs brightness.
You must be logged in to post a comment
About the Author