Make art with LEDs | HackSpace magazine #16

Create something beautiful with silicon, electricity, your endless imagination, and HackSpace magazine issue 16 — out today!

HackSpace magazine 16

LEDs are awesome

Basically, LEDs are components that convert electrical power into light. Connect them to a power source (with some form of current limiter) in the right orientation, and they’ll glow.

Each LED has a single colour. Fortunately, manufacturers can pack three LEDs (red, green, and blue) into a single component, and varying the power to each LED-within-an-LED produces a wide range of hues. However, by itself, this type of colourful LED is a little tricky to control: each requires three inputs, so a simple 10×10 matrix would require 300 inputs. But there’s a particular trick electronics manufacturers have that make RGB LEDs easy to use: making the LEDs addressable!


Look: you can clearly see the red, green, and blue elements of this RGB LED

Addressable LEDs

Addressable LEDs have microcontrollers built into them. These aren’t powerful, programmable microcontrollers, they’re just able to handle a simple communications protocol. There are quite a few different types of addressable LEDs, but two are most popular with makers: WS2812 (often called NeoPixels) and APA102 (often called DotStars). Both are widely available from maker stores and direct-from-China websites. NeoPixels use a single data line, while DotStars use a signal and a clock line. Both, however, are chainable. This means that you connect one (for NeoPixels) or two (for DotStars) pins of your microcontroller to the Data In connectors on the first LED, then the output of this LED to the input of the next, and so on.

Exactly how many LEDs you can chain together depends on a few different things, including the power of the microcontroller and the intended refresh rate. Often, though, the limiting factor for most hobbyists is the amount of electricity you need.

Which type to use

The big difference between NeoPixels and DotStars comes down to the speed of them. LEDs are made dimmer by turning them off and on very quickly. The proportion of the time they’re off, the dimmer they are. This is known as pulse-width modulation (PWM). The speed at which this blinking on and off can have implications for some makes, such as when the LEDs are moving quickly.


  • Cheap
  • Slowish refresh rate
  • Slowish PWM rate


  • More expensive
  • Faster refresh rate
  • Fast PWM rate
NeoPixels moving in the dark

As a NeoPixel is moved through a long-exposure photograph, you can see it blink on and off. DotStars – which have a faster PWM rate – avoid this.

Safety first!

HackSpace magazine’s LED feature is just a whistle-stop guide to the basics of powering LEDs — it’s not a comprehensive guide to all things power-related. Once you go above a few amperes, you need to think about what you’re doing with power. Once you start to approach double figures, you need to make sure you know what you’re doing and, if you find yourself shopping for an industrial power supply, then you really need to make sure you know how to use it safely.

Read more

Read the rest of the exclusive 14-page LED special in HackSpace magazine issue 16, out today. Buy your copy now from the Raspberry Pi Press store, major newsagents in the UK, or Barnes & Noble, Fry’s, or Micro Center in the US. Or, download your free PDF copy from the HackSpace magazine website.

HackSpace magazine 16 Front Cover

We’re also shipping to stores in Australia, Hong Kong, Canada, Singapore, Belgium, and Brazil, so be sure to ask your local newsagent whether they’ll be getting HackSpace magazine.

Subscribe now

Subscribe to HackSpace on a monthly, quarterly, or twelve-month basis to save money against newsstand prices.

Twelve-month print subscribers get a free Adafruit Circuit Playground Express, loaded with inputs and sensors and ready for your next project. Tempted?