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.

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:

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.
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.
Page last edited March 08, 2024
Text editor powered by tinymce.