Parts

We're going to use a combination of the Adafruit IO Client Library and Adafruit's CircuitPython to control a Raspberry Pi over Adafruit IO. 

Angled shot of Raspberry Pi 3 - Model B+
The Raspberry Pi 3 Model B is the most popular Raspberry Pi computer made, and the Pi Foundation knows you can always make a good thing better! And what could make the Pi 3...
$35.00
In Stock

If you're following along with a Raspberry Pi, we're going to use a T-Cobbler Plus for the IO Basics Projects. This add-on prototyping board lets you easily connect a Raspberry Pi (Raspberry Pi Model Zero, A+, B+, Pi 2, Pi 3) to a solderless breadboard:

Angled shot of Assembled Pi T-Cobbler Plus next to GPIO ribbon cable
This is the assembled version of the Pi T-Cobbler Plus.  It only works with the Raspberry Pi Model Zero, A+, B+, Pi 2, Pi 3 & Pi 4! (Any Pi with 2x20...
$7.95
In Stock

Want to create an automatic fish-feeder, a door-lock system with vibration-feedback, or maybe you want to just chain a bunch of lights and motors together and control them with Adafruit IO?

You'll need a few PWM outputs. This guide uses three.

The Raspberry Pi is limited to one PWM output. While we could use this PWM output for the servo, we're going to use the Adafruit 16-Channel 12-bit PWM/Servo driver. This board can be used to control up to 16 PWM outputs. This means you can have a bunch of servos, DC motors, LED lights, or even a combination of both.

3 x Resistors
560 Ohm
1 x RGB LED
Diffused RGB (tri-color) LED - Common Anode
1 x Jumper Wires
Breadboarding wire bundle.

Wiring

Make the following connections between the Raspberry Pi and the PCA9685:

  • Pi 3.3V to Power Rail
  • Pi GND to Ground Rail
  • 3.3V to PCA9685 VCC
  • Pi SDA to PCA9685 SDA
  • Pi SCL to PCA9685 SCL

Now we're going to connect the RGB LED to the PCA9685. We'll be using the LED with the flat side of the LED on the left. If you're having trouble seeing which side is the flat side, use the longest pin (3V) as your guide. The longest pin will be closer to the flat side of the RGB LED.

Make the following connections between the RGB LED, resistors and the PCA9685:

  • PCA9685 Channel 15 to one leg of a 560 ohm resistor, and the other leg of the resistor to the first leg (R) of the RGB LED.
  • 3.3V to the second leg (3V) of the RGB led.
  • PCA9685 Channel 14 to one leg of a 560 ohm resistor, and the other leg of the resistor to the third leg (G) of the RGB LED.
  • PCA9685 Channel 13 to one leg of a 560 ohm resistor, and the other leg of the resistor to the fourth leg (B) of the RGB LED.

Next, let's install the required CircuitPython libraries and set up our Pi.

This guide was first published on Feb 20, 2017. It was last updated on Mar 28, 2024.

This page (Python Wiring) was last updated on Mar 08, 2024.

Text editor powered by tinymce.