- Hey, folks, I'm Rob from "The MagPi,"
the official Raspberry Pi magazine.
And as you can probably tell,
I've got something a little
different to show you today.
How to create your own
multi-colored lights
for display in your house.
Let's go.
(energetic rock music)
Now if you've been following along
to The MagPi magazine, the MagPi twitter,
you'll know that in March
we had The Month of Making.
It was just a call for makers to show off
what they were working on
and maybe offer some advice
for people in the community
that were asking for a little bit of help.
Now, I wanted to join in
and decided that I finally should add
some cool lights to a display
cabinet I have in my home.
(record scratch)
(intense rock music)
Look, I know what you're thinking and yes,
I do have an incredible
display of Power Rangers toys.
Thank you so much.
Now they live in an IKEA Detolf which,
while being affordable and quite nice,
also comes with the handy
feature of letting you
add some LED lighting to it
by a little plug on the
roof of the display.
My plan was to get some NeoPixels
and control them with a Raspberry Pi.
Feed in some wires
through that little hole
and then attaching them to
the ceiling of the cabinet,
with a bit of glue or whatever.
Now, the first step here is to learn
how to wire up NeoPixels,
so they can work with a Raspberry Pi.
All the NeoPixel products
require three inputs.
A positive, a ground, and a data in
to tell the LEDs what to do.
Now, the strips require a five volt input,
which the Raspberry Pi
can technically handle.
However the power drawage LED is
relatively high for the Pi,
so you can only do a couple really.
So instead, I'm powering
them by four batteries here,
but if you have another kind
of five volt power supply
you can also use that.
Also means you don't have to keep changing
out the batteries.
Now you also need to make sure
you wire up to the correct end.
The trick is to look for the D-in pad.
The D-out pad is just to
connect all the strips
in NeoPixels, whereas the D-in
will go straight to the pipe.
Now as you can see, I've also
added a button to the circuit
which I've wired up just as normal.
The next step is programming,
neo pixels use their own Python
library, which has improved
significantly over the last few years.
But it's still a little
bit different to G Pro I0.
You need to the let the
library know how many LEDs
are in your system, what
kind of RGB they are
and a few other details.
You can check out the code we created
for this specific project on GitHub,
the link for which is right down here.
So far, just gonna plug it in.
So far, it's just glowing white
but this is where the button comes in.
To fit with the theme of my top shelf
the buttons run through the
colors of the main Ranger squad
which is red, and then
to blue, green, pink
it'll get to silver-ish
before returning to white.
Now this is a very rough set up
for the NeoPixel display lights here.
As you can see I've got it
on a breadboard with a Pi 3
however when I go home I'm gonna create
a more permanent circuit
and I'm also going to
replace it with a Pi 0
to save on some space and some power.
Anyway, I hope this has
inspired you to make something
quick and fun for a display
cabinet or bookshelf
or even just a Christmas
tree in a few months time.
The full tutorial for
this will be showing up
in a future issue of the MagPi
and you can make sure
you never miss an issue
by taking out a subscription.
You can find all our
amazing subscription offers
at the link here
or by clicking the little pop up
that I should've put right here.
Any way, I'm Rob the at MagPi,
at the official RaspberryPi Magazine
and happy making.
(calm hip hop music)
