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.
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.
You will need to make the following connections between the Pi and the PCA9685:
- Pi 3.3V to PCA9685 VCC
- Pi GND to PCA9685 GND
- Pi SDA to PCA9685 SDA
- Pi SCL to PCA9685 SCL
Make the remaining connections:
- PCA9685 PWM Pin (on channel 15) to one leg of the 560 ohm resistor
- Pi GND to LED Cathode (short LED leg)
-
LED Anode (long LED leg) to the other leg of the 560 ohm resistor
- note: resistors are not polarized, so the 560 ohm resistor can be connected to the circuit in either direction.
Next, we're going to set up our Pi.