# How do I control ten lightbulbs individually using one wire and processor? [closed]

Completely new at electrical engineering. My only degree is in Comp Sci.

I want to know that if I had something like a raspberry pi and a power source, how can I use them to turn on and off individual bulbs in a collection of ten without connecting a separate wire for each bulb? Rather, there would only be one connection from the computer that can split into different ones to control the bulbs.

With digital logic gates, you could perhaps use a decoder to input a signal from the pi and interpret to one of ten outputs.

But beyond that I don't really know where to start with this.

Edit: I apologize for being unclear. What I meant was that computer connection wouldn't require ten different physical wires from it to the bulbs, but the computer could choose which light bulb it can connect to with only one connection throughout the set up. The reasoning for this is that if you scale this up to 100 bulbs, how exactly can you connect hundred wires to a computer?

• without connecting a separate wire for each bulb contradicts split into different ones to control the bulbs .... please post a clear description of what you are asking Commented Mar 3, 2018 at 0:59
• One wire with many outputs??? A bit confusing. Please clarify your design.
– user105652
Commented Mar 3, 2018 at 1:11
• Battery power and WiFi or Bluetooth communication? Zero wires. One wire won't do much by itself. Commented Mar 3, 2018 at 1:54
• Using a decoder such as a 74HC154 still gives you up to 16 wires. You either have 10 Wi-Fi/Bluetooth channels to use (and ten coin cells), or ten wires. Decide please.
– user105652
Commented Mar 3, 2018 at 1:59
• Okay. You're new so I get it. But. This site functions better (and you'll get better answers) if you put the info up front. You can't just randomly change bulb numbers between 10 - 100's and wattage between 100W - 0.25W. The solutions are different. With respect, some of the chaps here will go to great lengths to help, but you need to do your bit too and flesh out details, not leave them for later. You can't write software like this can you :-) Commented Mar 3, 2018 at 2:29

## 2 Answers

If LEDs are an option then addressable LEDs - easily available in strips - could be a solution.

Figure 1. Addressable LED strips require three wires. V+, GND (ground) and data.

Each of the LEDs in the photo above typically have RGB leds and a built-in controller chip. Data is transmitted as a series of RGB levels starting with the first chip to the first chip's DIN (data in) pin. It strips off the first RGB value and passes the remaining data to the next chip and so on.

Figure 2. Close-up of LED chip at its dimmest setting. Source: see link below.

Have a look at these WS2812B, for example. The ones in Figure 1 may suit you well as they can be cut into individual units with solder pads on each one. By arranging these back to back or in a square or cube array you could create your "bulb" for whatever viewing angle you require.

• This is what I was looking for. Thanks for the links! Commented Mar 3, 2018 at 21:24
• Good. Wait a day or two to encourage other answers. Then accept the best answer to your question. Commented Mar 3, 2018 at 21:26

First, following Paul's comment, you'll need a handful of other components in order to turn light bulbs on and off. I'm not sure of the time and effort scale of your project; for a simple solution you might want to look into these controllable power outlets. You could then get some I2C GPIO expanders like the MCP23017. The nature of I2C allows you to connect many devices together on a bus consisting of two wires, and with the MCP23017 having 16 GPIO each and 8 different possible I2C addresses, you get 16*8 = 128 GPIO controlled by four wires from your Pi (two for data, plus logic power and ground). Each GPIO could then trigger an outlet.

However, this doesn't scale well due to the cost and size of the outlets. For something involving a hundred bulbs you'll want to look into some power relays and control circuitry. But this involves a deeper level of understanding of how these devices work, and more importantly, how to use them safely with mains voltage.

• Thank you for the answer. I also apologize for the individuals that were frustrated with my question. In hindsight the amount of effort I put into framing the question was subpar. And I hadn't considered the details mentioned by Paul and Sparky. Commented Mar 3, 2018 at 2:25