0
\$\begingroup\$

I have this existing LED circuit with 2 LED strips with built in resisitors and 1 switch. Normally 1 LED strip is always on and when the switch is closed the other LED strip also turns on. Power Source is a Sealed Lead Acid battery 6Ah and the switch is a regular rocker switch.

enter image description here

I want to modify this circuit so that an MCU can control the LED strip which was wired to be always on in the existing circuit. So I have made this new circuit diagram which I want to verify is correct or not. In the new circuit diagram (+) power from the closed switch goes to a tiny buck converter which steps it down to 5V for the MCU (ATTiny13a). (- ground) of the second LED strip goes to the drain of an N channel Logic level MOSFET which has it's gate connected to the digital out pin of the MCU. The function of the MCU is to make the LED strip blink every other time the switch is closed. The programming for the MCU will make use of the EEPROM to achieve this so that it knows (remembers) when the switch was closed last time.

In short, the intended function of this circuit goes like this

  • Switch Open - Both LED strips OFF
  • Switch Closed - First LED strip ON, Second LED strip OFF
  • Switch Open - Both LED strips OFF
  • Switch Closed - First LED strip ON, Second LED strip blinking

... and this function repeats

Note: I want the second LED strip to stay OFF even if the MCU isn't powered.

So I wanted to know if my circuit was correct or is there something wrong? like the way MOSFET is connected to the MCU?. Also is it possible for me to switch the (+) of the second LED strip with the MOSFET instead of switching it's (-) ground?

enter image description here

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

If you took more time thinking about drawing your circuit (extremely important) you'd be able to unclog your thoughts and see that the addition of a 1 Mohm resistor (purple) would be a good idea: -

enter image description here

Note: I want the second LED strip to stay OFF even if the MCU isn't powered.

The 1 Mohm resistor is there to protect the MOSFET and achieve the above should the ATTiny become disconnected. It's optional of course.

It's still not drawn perfectly but is a lot better and folk might have a chance of understanding it better.

Also is it possible for me to switch the (+) of the second LED strip with the MOSFET instead of switching it's (-) ground?

You could use a high-side PMOSFET and low side NMOSFET to do that like this: -

enter image description here

Picture from here.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the explanation. You really have a knack for drawing circuits. \$\endgroup\$
    – Kokachi
    May 24, 2020 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.