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.

Project Help and Ideas » Reactive Light - Connection Problem?

May 01, 2012
by lnino
lnino's Avatar

Hi at all.

I have finished a little program with reactive light. When I light a LED with my flashlight something should happen.

Everything works fine on my breadboard, there is absolutely no problem.

So I let a guy from germany draw a board for me. Today I finished soldering all components on the board, but it won't work as I expected.

Normally (on my breadboard) when I connect the battery the orange light and the red light are on. When I light with my flashlight on the white led the green led turns on.

But now (on the solded board) the orange light and the green light are on when I connect the battery and when I light with my flashlight on the white led there is no reaction.

Did I make something wrong during soldering?

Maybe someone can check my wiring, I really have no clue why it won't work.

I have also tried to change anode and cathode of the leds but this also did not change the result.

Please help me. :-)

Breadboard: Img1

Soldered Board Front: Img2

Soldered Board Back: Img3

Plan of the Board Front: Img4

Plan of the Board Back: Img5

May 01, 2012
by Ralphxyz
Ralphxyz's Avatar

What do you mean by:

When I light a LED with my flashlight something should happen.

???

that and you probable should have used curent limiting resistors for your leds.

But why it might work on your breadboard but not on your PCB is beyond me.

Ralph

May 01, 2012
by pcbolt
pcbolt's Avatar

Hi Inino -

The circuit artwork is a little different than the final board (The artwork has an unconnected ground lead to one of the LED's). I don't think it should make a difference. The next step would be to get out the old multimeter and test all the connections for continuity and shorts. It's hard to tell from the photo, but it looks like you might have a solder bridge or two.

Did you etch and tin the board yourself? The board looks pretty good.

May 02, 2012
by lnino
lnino's Avatar

Hi at all.

Thanks for the reply.

@ Ralph: The white LED is able to differ between Light and Dark. When you light with a flashlight on the white LED the green LED goes on. When you turn off the flashlight the red LED goes on. Green = Light On Red = Light off

On the Site I bought the LEDs there was written they have included resitors, so I haven't used extra resitors. Only the white LED needs an extra resistor.

@ pvbolt: I haven't made the board on my own. I guy from germany made this for me. Yes in the Artwork is the GND missing, but on the soldered board it's there. I do have a bridge between Pin8 an Pin9 counted from the left on the lower site. This Pins both have VCC and I thought connecting them should be no problem? Or might this be the problem?

This is really strange I have really no clue why it won't happen.

Maybe I really have to test with the multimeter the connections. :-(

May 02, 2012
by Rick_S
Rick_S's Avatar

On the Site I bought the LEDs there was written they have included resitors, so I haven't used extra resitors. Only the white LED needs an extra resistor.

I won't say they aren't made, but I've never seen an LED with a built in current limitting resistor. Normally if they say they include resistors, they have separate resistors along side the LED's for a given voltage. I've seen them several times like this on e-bay. Do you have a link to these LED's?

Even if your LED's do need resistors, that doesn't really explain why it worked on the breadboard and not on the PCB. Like pcbolt said, double check for shorts/solder bridges. Check for open traces or breaks in the traces. Check your battery, if the LED's aren't Special and really do need external resisors, they will draw a lot of current and kill the battery quickly. A weak battery can cause erratic behavior.

Rick

May 02, 2012
by lnino
lnino's Avatar

Hi Rick,

thanks for the reply.

I will test the connections on my PCB tonight. I will also make better picture without flash of my PCB, maybe you can see a failure.

May 02, 2012
by lnino
lnino's Avatar

Hi at all.

Now I have made a better picture.

alt image text

In my mind, the soldering is okay. Maybe some drawed connections are not correct, but I don't see any wrong lines. Do you?

Here is a little test you can make really fast.

Take a transparent LED mit Cathode on PB4 and Anode on PB3. If you want to go safe you can put a resistor between PB4 and PB3.

When you use the following source code you only have to light with a flashlight on the transparent LED and it will flash 10 times.

On my breadboard it works great.

But when I use the same code on my PCB, I do not need to light with my flashlight onto the transparent LED. At the moment when I plugin the batterie the LED flashes all the time. Not only 10 times, it starts flashing and never stops.

What can be the reason for this, regarding to the source code.

So the only components which I used in this test are the ATmega168, crystal, capacitor, resitor and transparent LED.

Maybe someone can test it.

Thanks for the help.

// morse_code.c

// for NerdKits with ATmega168

#define F_CPU 14745600

#include <avr/io.h>
#include <inttypes.h>

#include "../libnerdkits/delay.h"
#include "../libnerdkits/lcd.h"

// PIN DEFINITIONS:
//
// PB4 -- LED Kathode
// PB3 -- LED Anode

unsigned char f, i;
unsigned char led_abfrage(unsigned char zeit) {

    PORTB &= ~(1<<PB3); // Portb.3 auf Masse schalten
    PORTB |= (1<<PB4); // Portb.4 auf +Ub schalten, um die LED zu 'laden'
    delay_us(10); // Ladezeit 10 (1) µs, kann ggf. noch verkleinert werden

    DDRB &= ~(1<<PB4); // Portb.4 nun zwecks Abfrage der LED-Ladung auf 'Eingang' schalten
    PORTB &= ~(1<<PB4); // Pullup abschalten, sonst geht's nicht!

    delay_ms(zeit); // Entladezeit zeit_ms (1500 µs) - je kleiner, je unempfindlicher

    i = (PINB & (1<<PINB4)); // Ladezustand einlesen

    DDRB |= (1<<PB4); // Portb.4 wieder auf Ausgang schalten
    PORTB &= ~(1<<PB4); // Portb.4 auf Masse schalten

    return i;
}

int main(void) {
    DDRB  = 0b00011000; // Pinb.3 und .4 auf 'Ausgang', Rest auf 'Eingang' schalten
    PORTB = 0b11100111; // Pullups zuschalten, außer für Pinb.3 und .4

  while(1) {
    if (led_abfrage(6) == 0) { // LED durch Licht entladen?
        for (f = 0; f < 10 ; f++) { // 10x blinken
            PORTB |= (1<<PB3); // PB3 auf Vcc schalten
            delay_ms(32); // 32 ms Blitz
            PORTB &= ~(1<<PB3); // PB3 auf GND schalten
            for (i = 0; i < 10 ; i++)
                delay_ms(32); // ca. 320ms Pause (workaround wegen 8MHz Quarz)
        }
    }
  }
  return 0;
}
May 06, 2012
by lnino
lnino's Avatar

Hi at all.

Now I took a brand new PCB and soldered again. Now it is nearly perfect soldered. But the LED flashes when I connect the battery. The LED should only flash, when it is lighted with a flashlight.

I have now clue why this is not working. I have now connected my breadboard exactly the same why like my PCB. So the drwaed lines must be right, but it does not react like on my breadboard.

On my breadboard it works without a problem.

Maybe someone can find the mistake.

I have uploaded new photos of the breadboard and the PCB.

alt image text alt image text alt image text

Post a Reply

Please log in to post a reply.

Did you know that the microcontroller's crystal oscillator can be used to keep accurate time? Learn more...