LED strip with individual light switch control

Around the time my child turned 1yr, she started loving turning on and off standard house light switches when we would enter or exit a room. That put the idea in my head that I wanted to make her a toy that would use those switches and would turn on light. The goal was to give her the satisfaction of the switch while learning colors and color blending.

I since built and manufactured a PCB board that used a logic gate to control 6 LED diodes. RED, YELLOW BLUE for the primary colors when the given switch is thrown; PURPLE, ORANGE, GREEN for the secondary when 2 or more switches are thrown. It works great, but I want to take it a step further and use LED strip lights and an Arduino. The goal would be the same, with a brighter more vibrant glow. Now I need help on the code.

Three standard house switches, each turning on or off a single primary color, then that allowing for blending and color mixing, when two or more switches are thrown. So she can continue to learn her colors. :slight_smile:

I have ALITOVE WS2812B LED's on hand, which offers a single 5v, ground and data in and I know the Arduino library FastLED works with control (I was testing things for my church a while back), but I would be willing to switch to LED tape that has individual RGB input connection if a single data line won't work.

I have very little knowledge of Arduino but do understand low voltage circuits, and wiring. Thoughts and expertise is strongly need!! Thank you so much for anything you can offer.


I have looked everywhere on this forum before posting - but I know I could have missed if this topic was covered. Very sorry if it's a double. I don't like to post of forums without really knowing that the subject does not exist. The last thread I tried was, multiple switches to control multiple colours on an LED strip - Project Guidance - Arduino Forum, but there are too many differences between the projects.

Always start with a schematic showing all the things in your wish list.

Write your schematic in the 'sand' (not stone) so you can change things as need.

Once you are satisfied with the schematic (we can tear it apart for you ;)) then proceed with writing code.

How does a 1-yr old reach the light switches on the wall?

Nonetheless, controlling individual LEDs on a strip or string as you describe would be fairly easy on an Arduino with the Fastled library.

Look at the analog_input sample sketch for some ideas.

Here is my thoughts in a block diagram. (Only one of a few possible solutions).

The switches would give you seven different voltages on the analog input, then our sketch would interpret the voltage to seven colors. Eight if your count black.

brianmorgs:
I since built and manufactured a PCB board that used a logic gate to control 6 LED diodes. RED, YELLOW BLUE for the primary colors when the given switch is thrown; PURPLE, ORANGE, GREEN for the secondary when 2 or more switches are thrown.

This sort of toy for children who like to play with domestic light switches has been described here previously - some time ago. :grinning:

I was initially a trifle puzzled about what you were doing there and how it would involve logic gates. It would seem you were trying to demonstrate subtractive colour mixing with separate lights. To us, used to working with colour synthesis, this is somewhat counter-intuitive but well, if that is your intent, so be it.

Clearly you can do the same using programmable RGB LEDs - you can actually do pretty much anything you want! For any serious project, you should be using a Nano rather than a UNO as it is a much more practical form factor. Note that the Arduino is not a source of power for other devices though you can feed a limited amount of current (up to about 500 mA) through to the "5V" pin from the USB connector. Do not be tempted to use "Vin" or on a UNO, the "barrel jack".

Using the NeoPixels (WS2812 and similar) of course allows you to add animations and with a relatively short strip, this would be very effective. Perhaps the strip responds directly to changes in the switch settings, but after a period of time, progressively changes into a corresponding animation.

SteveMann:
How does a 1-yr old reach the light switches on the wall?

Now there's a good question!

SteveMann:
Here is my thoughts in a block diagram. (Only one of a few possible solutions).
The switches would give you seven different voltages on the analog input, then our sketch would interpret the voltage to seven colors. Eight if your count black.

A very odd approach. There is no shortage of available pins on the Arduino, why make it unnecessarily complex (and slightly less reliable)? :roll_eyes:

Thanks all! The gate is just a way to turn on the secondary color when two switches are on. It works great. I just wanted brighter lights and I know that LED strip would be better (brighter) than the single 3v diode would do.

I will try and draw up a sketch of what I'm envisioning. I'm sure it goes against what a professional would do or could be looked at as "counter-intuitive", but I'm going for function and working.

I'll get that asap!

Paul__B:
A very odd approach. There is no shortage of available pins on the Arduino, why make it unnecessarily complex (and slightly less reliable)? :roll_eyes:

I think mine is the simpler approach because it's less wiring. If the OP wants, the switch box could be remote to the light display and the Arduino. RGB LEDs colors look better at a distance. If the LEDs are on the box, the operator would see the individual red, green and blue LEDs.

As the child further understands the binary effect of mixing colors, then the OP would be in a position to design analog mixers using slider potentiometers:

RGB Sliders.jpg

On the colors, the LED color could be additive or subtractive- it's all in the code. Artists render colors on paper using subtractive primaries of cyan, magenta, and yellow, but light sources are additive.

Be prepared to explain additive versus subtractive colors as the child begins experimenting with finger paints and crayons because the observed colors will be confusing at first.

Color-Wheels.jpg

brianmorgs:
I will try and draw up a sketch of what I'm envisioning. I'm sure it goes against what a professional would do or could be looked at as "counter-intuitive", but I'm going for function and working.

We're professionals now? Nope, most of us on the forums are hobbyists with a few who work professionally in the field.

Color-Wheels.jpg

RGB Sliders.jpg