Micro processor or not micro processor that is the question?

Hello i have a project coming up in my kitchen. I have a led strip that has two colors in it a warm white led and a day white led on it. Only 3 wires come from it 12v+ and the the two minues wires from each color so it looks like theb12v+ on both led colors are tired together.

Here is my problem i would like to change it from the warm white to day white when i turn off and on thw power switch that goes to my outlet that will be powering up the led strip.

The problem is i really don't want to use a remote control. Is there a way in arduino that can sense when the power is on or off from the 12v power supply. Or maybe a way i can do this without having to have a micro processor?

Basically I'm trying to make this as simple as possible. Without over doing it. So do i really need a micro processor or i don't. That is the question.


I'm confused. Do you want to switch to the other LED when the power supply is turned off? I'd use a SPST SPDT switch between the colors instead of the current power switch.

Thanks for proofreading :slight_smile:

Which LED strip? How is it connected?

i would like to change it from the warm white to day white when i turn off and on thw power switch that goes to my outlet that will be powering up the led strip.

You need power to drive the LED's so what you are suggesting is not possible.

You need a switch as in #1. If the 2 minus wires are the switch wires, connect one each to the n/o and n/c of this new spdt (not spst as quoted) and your supply negative to the common of the switch.

Hello the leds strip came from yugi leds i guess that is how you spell it. A friend of mine gave me the strip about a year ago. I just never got around to using it.

The led strip have two different leds in one A warm white led and a day white led. Both are 12v dc. Both are tied together to plus 12v wire or another word is tired as a common anode on then12v plus side. And thenmine side of the 12v are two wires one for the warm white and one for the day white led. I can manually swotch back and forth with the power supply by disconnecting one mine side and applying it to the other side. However sense the outlet is in the ceiling i can not run new wires to put two switches. So I'm stuck with kne main power switch that turn off and on the outlet.

So i was thinking of using a arduino and some mofest to switch from the warm white leds to the day white leds. Problem is i dontd want a extra remote control to do that. So i was thinking of sensing when the power is on then12v side of the power supply that it can go to warm white and if power is off and comes back on it can automatically switch to the day white leds side.

You mean a toggle relay.

Here is one.

Hello What I’m looking todo is yes toggle between two leds on the same strips a pound powering up. So when it is first time powered up and goes to one relay for the leds strip. then when power is taking away it and power is reapplied again it can toggle to the second led color on that strip. Problem is i didn’t know how to do that i didn’t even know if it is possible to do it without a micro processor of some kind but the more i look at it and thought about it. The more i had to go with a micro processor.

So i was brain storming with a friend of mine Hari a great Guy helped me with a lot of my problems. in the past. But he is a Super busy guy at work making the world better hehe. So we talked maybe he said putting a external battery to keep the arduino powered up. and just check the state of the 12v sensing it when there is power to have it automatically switch when there is power applied. i said that is to much is there a way of doing it without sensing or having to have a external batter for the arduino only when there is power on the arduino like in eeprom or something he said therem ight be a way and he can figure it out and let me know. Because he haven’t work with arduino in a long time for work. 1 to 2 hours has passed and message me with Success he did it store it in eeprom everytime there is power it runs through the sketch once and store it then flip between the one color to th second color where there power is on.

So now I’m sharing what he came up with and hope This can help others as well maybe someone can take it and use it and help them. It’s just something simple that in my mine was so complex it was driving me nuts. But a Big thanks to everyone in the arduino forum for helping me and a big thanks to my friend hari i know it is a busy guy for taking the time out and helping me.

byte lite1Pin = 2;
byte lite2Pin = 3;

#include <EEPROM.h>

void setup() {
  pinMode(lite1Pin, OUTPUT);
  pinMode(lite2Pin, OUTPUT);

  int address = 0;
  byte value = 0;
  byte newValue = 0;
  EEPROM.get(address, value);

  byte lite1Status = LOW;
  byte lite2Status = LOW;
  if (value == 0) {
    newValue = 1;
    lite1Status = HIGH;
  else {
    newValue = 0;
    lite2Status = HIGH;
  digitalWrite(lite1Pin, lite1Status);
  digitalWrite(lite2Pin, lite2Status);
  EEPROM.put(address, newValue);

void loop() {

You can power the Arduino and the LED strip from the same 12V supply. If that supply is switched off, you cannot power neither the Arduino nor the LED strip without another 12V supply. Solve this problem first, else nobody knows the code to write for your solution.

Hello I'm not asking for anyone to write any code for me. I'm asking for help to figure out how to solve this problem. Not once have i asked for someone to write this code or anything else for me.

Second thing is Already figured out how to solve this problem with a help from a friend of mine. We both came up with a code that works. Well he helped with the eeprom of the code.

And yes we figure out the problem for the power.

And yes we figure out the problem for the power.

So you fix it yourself...??
For future reference, a sketch of what you have in the form of a diagram can be more helpful than any description.
Descriptions tend to get buried by what you think it should be rather that what it actually is.
Such is the saying, a picture is worth a thousand words.

to clarify what you want to do.

you apply power and LED #1 lights up.
you remove and re-apply power and LED#2 lights.

if you leave the lights off for some time and then turn them on, then LED #1 lights.


one way is :

if you get a capacitor and charge it from a pin through a resistor, you can have the pin output high
then become an input and read the cap to see if the value is high enough to make the pin high.

if you leave the lights off too long, the capacitor will drain.
when you turn on the power the capacitor will be low on the pin.

once the capacitor is charged, and you turn off the switch and turn it back on, the capacitor will be charged so the pin would read high.

another way is to use a super cap, charge with the power when the lights come on.
it would have enough power to keep the micro powered for a few minutes.

every time the light switch is toggled (turn off, then on) the change of input to a pin, the output would change.
if you use a super cap to keep power when the switch is off, you would need to monitor power before the cap.
a voltage divider with resistors and an LED would work.

That "power taken away" is done by you pressing a physical switch mounted on a fixed position?

There are three way switches. Press once, output 1. Press another time, output two. Press another time, off. Etc. That's the simplest, cheapest, most reliable solution to your problem.

Now if you must, you can of course throw an Arduino in the mix and make the thing more complicated.

I took this as the OP has an existing light in the ceiling that has 2 wires. simple off-on switch.

the question then was , how can I control a light to be off, on-low or on-high without running new wires and not going wireless ?

This style of control for lights is more common for accent lighting, say, white as the first color, then maybe blue as the second, then red as the third. just keep toggling the switch.

"TRI-LIGHT Technology i2Systems Tri-Light Technology offers 3 colors of light within a single fixture with only 2 wires. Simply toggle the input voltage off and back on again to change from one color to the next. "

I took this as the OP has an existing light in the ceiling that has 2 wires. simple off-on switch.

And yes we figure out the problem for the power.

I took it the OP has it sorted and didn't bother to say how.