What is "charlieplexing"? (a short demo using the Raspberry Pi)

While I was reading Raspberry Pi Cookbook, I came across a few things that looked interesting to demo. One of them was the concept of “charlieplexing“. On past projects, when I needed multiple LEDs (like in my Simon clone), I just connected each individual LED to its own GPIO pin. I was fully aware that current had to travel through the LED in one direction and that it wouldn’t light in the other direction, but it hadn’t occurred to me to take advantage of that fact. This is where charlieplexing comes in – we arrange multiple LEDs such that »

Creating Your Own Indoor Vegetable Garden

Since building my first raised garden bed a couple years ago (there’s a second one next to it now), I’ve really enjoyed growing our own veggies. It’s a fun project if you’re into that sorta thing – fairly easy to setup, cathartic in its rhythm (weed, water, harvest, repeat…), and the payoff half-way through summer is a lot of fresh snacks! Pretty much every weekend… End-of-summer harvest of basil We had lots of caprese salad! It can be a good activity for the whole family too. Most of the work is on me, which is fine since »

Connecting an Analog Joystick to the Raspberry Pi (and using it with an RGB LED to simulate a color wheel)

One of the coolest things about the Raspberry Pi is its GPIO pins. They’re just sitting there, waiting to be connected to all kinds of useful peripherals so your Pi can interact with the world around it. Power an LED to signal the user. Place a button in the path of a circuit and detect when a user presses it. Attach sensors to read temperature and humidity, and plug other cards like the Sense HAT over top of the pins. A few months ago, I got a set of 37 sensor modules on Amazon. I knew they wouldn’t »

Creating a Flickering Candle Using an RGB LED on the Raspberry Pi

After getting PWM (pulse-width modulation) to work with an RGB LED last week, I was trying to think of what else I could do with an LED that demonstrated changes in color as well as intensity. I’m not sure why – maybe it was because we lost power in our neighborhood recently – but I thought a flickering candle could be an interesting little challenge… Materials In order to test this out, you’ll need a few things. An RGB LED A button A breadboard A T-cobbler (optional, but makes life easier when wiring up to GPIO pins) A range of »

How to Use an RGB multicolor LED with Pulse Width Modulation (PWM) on the Raspberry Pi

If you buy a kit with random LEDs, wires, switches, etc, like this one I purchased from CanaKit, you’re likely to end up with one or two of those funky little LEDs that appears to be white, and has 4 wires instead of 2. I had set mine aside and made a mental note to figure it out later… well, I’m bored with regular LEDs so that time has come! It’s a special kind of LED that consists of 3 separate LEDs… red, green and blue. By adjusting each color independently, you can create any color (similar »

Creating a "Simon" Game Clone on the Raspberry Pi

Have you been around long enough to remember the popular Simon game from the 70s and 80s? There’ve been plenty of remakes over the years, but I had one of the originals when I was younger. It’s a game of patterns that tests your memory. It flashes a color and sounds a corresponding tone, which you repeat. Then it repeats the same color/tone and adds a new one. The pattern keeps getting longer and longer. Technically, it could go on forever, but I think you “won” after 20 or 30 colors… not that I ever got close! »

How to Flash an LED on Your Raspberry Pi When You Get New Email

This week we’ll create an email notification system using the Raspberry Pi. The idea is to check for new email, and flash an LED when we get one. Connecting to Gmail The circuit will be extremely straight-forward, so let’s focus on the more difficult part first – connecting to an email service. We need to create a secure connection to our email provider, so we can find out when new mail arrives. Do a quick search, and you’ll likely find scripts like this one where you just connect with your username, password and a few other pieces of »

Generating Morse Code on the Raspberry Pi Using a Button on a Breadboard

Last time, I created a morse code generator. It took user input from the console, translated it into morse code, and blinked an LED to “transmit” the message. I decided to build on that a bit, adding a button to the circuit that allows me to generate morse code from a button click. The clicks are read in by a GPIO pin, and interpreted by a Python script. Defining the Rules We should always figure out what a program is going to do before we start writing it, so here are a few rules to guide us: Dots and dashes »