NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Control LED Stripes with 2N7000 MOSFET

March 09, 2013
by lnino
lnino's Avatar

Hi guys,

I am back with a nice simple project. At least it looked like that. :-)

I made a circuit to control a LED Stripe which needs 12V to light up. I realised it on my breadboard with the nerdkit. It works great. The LED stripe turns on for 6 seconds and turns off for 6 seconds. Repeating in a loop.

So I thought it would be nice to bring this on a pcb. I want to control 4 LED Stripes with it and 1 door opener.

But when I put the MCU from the working curcuit of the breadboard into the circuit of the new pcb it won't work. The led stripe is always turned on. It never turns off.

I can't find the mistake. But I am sure there has to be one, because it don't work.

Maybe someone has an idea or input to help me getting forward it this project.

  int main() {

      // LED as output
  DDRD |= (1<<PD6);

  // loop keeps looking forever
  while(1) {
    // turn on LED
    PORTD |= (1<<PD6);


    // turn off LED
    PORTD &= ~(1<<PD6);


  return 0;


alt image text


alt image text

PCB Eagle Board:

alt image text

PCB Eagle Schematic:

alt image text

Breadboard Circuit:

alt image text

March 09, 2013
by Noter
Noter's Avatar

Maybe you need the 22pf capacitors on the crystal as called for in the spec. The breadboard has enough capacitance in the contact strips for the ocillator to work but on a PCB there is no built-in capacitance.

Also, you don't need all those diodes for driving led's, they are only needed for inductive loads.

March 09, 2013
by lnino
lnino's Avatar

Hi Noter,

i think that could be the key.

I forgot that the capacitance is different.

I will add the capacitors and give you a feedback.

Thanks for your help.

Post a Reply

Please log in to post a reply.

Did you know that you can connect digital calipers to a microcontroller? Learn more...